From 1f558c9f95088a640d3a38639a8b1ab6640b1718 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 25 Aug 2025 16:37:13 +0100 Subject: [PATCH] fix(shell/vscode): make alt+left/right work in VSCode terminal --- zsh/vscode.zsh | 11 +++++++++++ zshrc | 1 + 2 files changed, 12 insertions(+) create mode 100644 zsh/vscode.zsh diff --git a/zsh/vscode.zsh b/zsh/vscode.zsh new file mode 100644 index 0000000..ee09611 --- /dev/null +++ b/zsh/vscode.zsh @@ -0,0 +1,11 @@ +# +# VSCode environment setup. +# + +if [[ $TERM_PROGRAM == "vscode" ]]; then + bindkey -e + + # Fix alt+left/right inserting `;3D` and `;3C` instead of word navigation. + bindkey '\e[1;3D' backward-word # Alt+Left + bindkey '\e[1;3C' forward-word # Alt+Right +fi diff --git a/zshrc b/zshrc index c97e535..831d155 100644 --- a/zshrc +++ b/zshrc @@ -304,6 +304,7 @@ source "$DOTZSH/nix.zsh" source "$DOTZSH/restish.zsh" source "$DOTZSH/tldr.zsh" source "$DOTZSH/tmux.zsh" +source "$DOTZSH/vscode.zsh" source "$DOTZSH/zoxide.zsh" # Development