Skip to content

Commit

Permalink
Use EDITOR=code within VS Code
Browse files Browse the repository at this point in the history
  • Loading branch information
statico committed Mar 10, 2024
1 parent a2aa4f0 commit f718ce4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ if _has less; then
export LESS='-Ri'
fi

if _has vim; then
if [ "$TERM_PROGRAM" = "vscode" ]; then
export EDITOR=code VISUAL=less
elif _has vim; then
export EDITOR=vim VISUAL=vim
elif _has vi; then
export EDITOR=vi VISUAL=vi
Expand Down Expand Up @@ -437,7 +439,7 @@ vix() {
echo -e "#!/usr/bin/env bash\n\nset -eo pipefail\n" > "$1"
fi
chmod -v 0755 "$1"
vim -c 'normal Go' "$1"
$EDITOR "$1"
}

# Make a new command in ~/bin
Expand Down

0 comments on commit f718ce4

Please sign in to comment.