From 4f062c3706aa7051dd380fac6cd57d89c1dae2eb Mon Sep 17 00:00:00 2001 From: Tony Blyler Date: Tue, 23 May 2023 20:44:11 -0400 Subject: [PATCH] Update vscode section in ~/.zshenv to support insider edition for just the "code" command in its shell --- chezmoi/dot_zshenv | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chezmoi/dot_zshenv b/chezmoi/dot_zshenv index fa5787c..bdcf402 100644 --- a/chezmoi/dot_zshenv +++ b/chezmoi/dot_zshenv @@ -11,8 +11,14 @@ done # if we're in vs code's terminal, set the editor to vs code if [ "${TERM_PROGRAM:-noop}" = "vscode" ]; then - export EDITOR='code' - export TAG_CMD_FMT_STRING="code --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}" + if [[ "$TERM_PROGRAM_VERSION" =~ -insider$ ]] && command -v code-insiders &> /dev/null; then + export EDITOR='code-insiders' + alias code=code-insiders + else + export EDITOR='code' + fi + + export TAG_CMD_FMT_STRING="${EDITOR} --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}" fi export VISUAL="${EDITOR}"