aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home
diff options
context:
space:
mode:
authorLibravatar sommerfeld <[email protected]>2026-04-17 10:53:31 +0100
committerLibravatar sommerfeld <[email protected]>2026-04-17 10:53:31 +0100
commitd2b67f5b2f6bf51aadb33e87f167ff998f034d78 (patch)
treec75588adcaa0fcb93316ddf0d735dc1679dc1ede /home
parent6a60acf2b71004a830fe3c70df6d03fee28d3af7 (diff)
downloaddotfiles-d2b67f5b2f6bf51aadb33e87f167ff998f034d78.tar.gz
dotfiles-d2b67f5b2f6bf51aadb33e87f167ff998f034d78.tar.bz2
dotfiles-d2b67f5b2f6bf51aadb33e87f167ff998f034d78.zip
feat: add modern word-navigation keybindings
Ctrl-Right/Left and Alt-Right/Left for word-by-word navigation. Ctrl-Backspace/Delete for word-by-word deletion. The key insight: Ctrl-Right (forward-word) with zsh-autosuggestions installed automatically accepts the next word of the suggestion, giving fish's killer partial-accept feature for free.
Diffstat (limited to 'home')
-rw-r--r--home/.config/zsh/.zshrc8
1 files changed, 8 insertions, 0 deletions
diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc
index b20a085..a692de0 100644
--- a/home/.config/zsh/.zshrc
+++ b/home/.config/zsh/.zshrc
@@ -95,6 +95,14 @@ fi
# ── Custom keybindings ────────────────────────────────────────────────────────
bindkey \^U backward-kill-line
+# Word navigation (Ctrl-Right also accepts autosuggestion word-by-word — fish-like)
+bindkey '^[[1;5C' forward-word # Ctrl-Right
+bindkey '^[[1;5D' backward-word # Ctrl-Left
+bindkey '^[[1;3C' forward-word # Alt-Right
+bindkey '^[[1;3D' backward-word # Alt-Left
+bindkey '^H' backward-kill-word # Ctrl-Backspace
+bindkey '^[[3;5~' kill-word # Ctrl-Delete
+
# Ctrl-D exits even on non-empty line
exit_zsh() { exit }
zle -N exit_zsh