Skip to content

Instantly share code, notes, and snippets.

@ForbesLindesay
Created July 5, 2022 09:01
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 ForbesLindesay/b671fc81fc719482c61a073e9ea0c5b1 to your computer and use it in GitHub Desktop.
Save ForbesLindesay/b671fc81fc719482c61a073e9ea0c5b1 to your computer and use it in GitHub Desktop.
export EDITOR='code_wait_new_window'
export VISUAL='code_wait_new_window'

To use VSCode as your editor for command line apps (git, graphite etc.) You will need to:

  1. Install 'code' command in PATH by openning VSCode and pressing CMD+Shift+P to open the command palatte and then running "Shell Command: Install 'code' command in PATH"
  2. Add code_wait_new_window to /user/bin/code_wait_new_window
  3. Make sure /user/bin/code_wait_new_window is marked as executable
  4. Set EDITOR and VISUAL env vars in your .zshrc or wherever your shell profile is stored.
#!/bin/zsh
emulate -LR zsh
code --wait --new-window $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment