Skip to content

Instantly share code, notes, and snippets.

Last active Jan 21, 2016
What would you like to do?
A script for generating the requisite directory structure for VSCode's "Local History" plugin

Having installed VSCode's Local History plugin I found that I was getting ENOENT errors. This command will generate the required directory structure within your projects .history folder.

Please Note: This will remove any existing .history folder from your project.


  1. Open your .bash_profile or .zshrc file
  2. Add to the bottom of the file
  3. Either restart your terminal, or run source .bash_profile or source .zshrc


  1. Open Terminal and navigate to your working directory
  2. Run the command gen-vshistory
  3. Lean back and wait for your .history/ directory to be created
gen-vshistory() {
echo "Cloning directory structure to ./.history"
rm -rf .history
rm -rf /tmp/.history
find . -type d -exec mkdir -p -- /tmp/.history/{} \;
mv /tmp/.history ./.history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment