DEV Community

Mikko Matilainen
Mikko Matilainen

Posted on

VSCode terminal & meta key

I had the same issue as described here: https://superuser.com/questions/1549993/how-to-map-option-shift-digit-keys-in-zsh-using-bindkey

I went with the same solution that disables terminal.integrated.macOptionIsMeta and uses bindkey to map the traditional readline meta key commands. I added insert-last-word and had to modify the bound characters to some extent. Still need to figure out how to best handle dead keys (option-t and option-u for example)...

bindkey '' accept-and-hold # option-a
bindkey 'ƒ' forward-word # option-b
bindkey 'ç' fzf-cd-widget # option-c
bindkey 'ð' delete-word # option-d
bindkey '›' backward-word # option-f
bindkey '¸' get-line # option-g
bindkey '˛' run-help # option-h
bindkey 'fi' down-case-word # option-l
bindkey '‘' history-search-forward # option-n
bindkey 'π' history-search-backward # option-p
bindkey '•' push-line # option-q
bindkey 'ß' spell-word # option-s
bindkey '†' transpose-words # option-t
bindkey 'ˀ' up-case-word # option-u
bindkey 'Ω' copy-region-as-kill # option-w
bindkey '≈' execute-named-cmd # option-x
bindkey 'µ' yank-pop # option-y
bindkey '…' insert-last-word # option-.
Enter fullscreen mode Exit fullscreen mode

Would be nice if VSCode supported choosing just the left option key as meta, same as iTerm does.

Top comments (0)