Skip to content

Instantly share code, notes, and snippets.

@speto
Created March 23, 2022 14:40
Show Gist options
  • Save speto/14e05a963f5d726f404b9690ded56fac to your computer and use it in GitHub Desktop.
Save speto/14e05a963f5d726f404b9690ded56fac to your computer and use it in GitHub Desktop.
intellij or vscode as git editor

IntelliJ or Visual Studio Code as a git editor

Permanent setup for git:

config --global core.editor "webstorm --wait"
config --global core.editor "code --wait"

Ad-hoc usage with git commands:

EDITOR="webstorm --wait" git rebase -i sha1hash
EDITOR="code --wait" git rebase -i sha1hash

Permanent setup for all apps (haven't tried):

On unix-like OS, put this into your ~/.profile:

# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then # SSH mode
  export EDITOR='vim'
else # Local terminal mode
  export EDITOR='webstorm --wait'
fi
export VISUAL="$EDITOR"

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment