From 86c74b15fb2bc42aef41ae7651bd97a2afea1c53 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 26 Oct 2026 09:53:34 +0100 Subject: tweak(user): remap vi navigation for Colemak-DH Oof, this feels good. Should've done this sooner. --- user/zsh/.zshrc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'user/zsh') diff --git a/user/zsh/.zshrc b/user/zsh/.zshrc index 06f4fb4..7fbcc6b 100644 --- a/user/zsh/.zshrc +++ b/user/zsh/.zshrc @@ -4,6 +4,25 @@ ## Key bindings # vi mode bindkey -v +# Put vi's directional keys on the Colemak-DH home-row positions. +# As in Neovim, `o` enters insert mode and `l` opens a line below. +bindkey -M vicmd 'k' vi-backward-char +bindkey -M vicmd 'n' down-line-or-history +bindkey -M vicmd 'e' up-line-or-history +bindkey -M vicmd 'i' vi-forward-char +bindkey -M vicmd 'h' vi-forward-word-end +bindkey -M vicmd 'H' vi-forward-blank-word-end +bindkey -M vicmd 'o' vi-insert +bindkey -M vicmd 'O' vi-insert-bol +bindkey -M vicmd 'l' vi-open-line-below +bindkey -M vicmd 'L' vi-open-line-above + +# Navigate search results. +bindkey -M vicmd ' ' vi-repeat-search +bindkey -M vicmd '^?' vi-rev-repeat-search + +# Move to the previous end of a word. +bindkey -M vicmd 'gh' vi-backward-word-end # default in Bash bindkey "^R" history-incremental-search-backward -- cgit v1.3.1