Skip to content

Instantly share code, notes, and snippets.

@jdforsythe
Created May 3, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdforsythe/4e3f5e2f8c70b95474d43d2abfe04c49 to your computer and use it in GitHub Desktop.
Save jdforsythe/4e3f5e2f8c70b95474d43d2abfe04c49 to your computer and use it in GitHub Desktop.
Use Visual Studio Code as long command editor in Git Bash on Windows
## Bash lets you use CTRL+X CTRL+E to edit-and-execute a command
## This will allow you to set up VS Code as the editor for this (and other Bash edit functions)
echo "export VISUAL=\"code -n -w\"" >> ~/.bashrc
source ~/.bashrc
## Then when you're typing a long command and need to change something or otherwise want better
## editing control over a command, simply hit CTRL+X CTRL+E and edit the command, then save
## and exit VS Code and the command will execute
## For Sublime Text
echo "export VISUAL=\"subl -w\"" >> ~/.bashrc
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment