aboutsummaryrefslogtreecommitdiff
path: root/user/zsh
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-10-26 09:53:34 +0100
committerMartin Fischer <martin@push-f.com>2026-10-31 08:43:09 +0100
commit86c74b15fb2bc42aef41ae7651bd97a2afea1c53 (patch)
tree20d6580dbf4caf318ea48fb11b07b617463ad67c /user/zsh
parenta4a6624d8c8ea86582f3f963f4100435c2ada64d (diff)
tweak(user): remap vi navigation for Colemak-DH
Oof, this feels good. Should've done this sooner.
Diffstat (limited to 'user/zsh')
-rw-r--r--user/zsh/.zshrc19
1 files changed, 19 insertions, 0 deletions
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