Update vscode section in ~/.zshenv to support insider edition for just the "code" command in its shell

This commit is contained in:
Tony Blyler 2023-05-23 20:44:11 -04:00
parent 49e1cdd1b0
commit 4f062c3706
No known key found for this signature in database

View file

@ -11,8 +11,14 @@ done
# if we're in vs code's terminal, set the editor to vs code # if we're in vs code's terminal, set the editor to vs code
if [ "${TERM_PROGRAM:-noop}" = "vscode" ]; then if [ "${TERM_PROGRAM:-noop}" = "vscode" ]; then
export EDITOR='code' if [[ "$TERM_PROGRAM_VERSION" =~ -insider$ ]] && command -v code-insiders &> /dev/null; then
export TAG_CMD_FMT_STRING="code --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}" export EDITOR='code-insiders'
alias code=code-insiders
else
export EDITOR='code'
fi
export TAG_CMD_FMT_STRING="${EDITOR} --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}"
fi fi
export VISUAL="${EDITOR}" export VISUAL="${EDITOR}"