summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Jäger <gitcommit@henk.geekmail.org>2023-01-10 23:02:44 +0100
committerHendrik Jäger <gitcommit@henk.geekmail.org>2023-01-10 23:02:44 +0100
commit9bf149bcfa8a2b41739c9064a461a2f22781e548 (patch)
tree83f755ca6bca5ca39edc091b8be7fc43dd46976e
parent03d0877d4c836dfa333ba06e219fbe9b9a4ef055 (diff)
fix: better keybindings and word selection
-rw-r--r--.zshrc17
1 files changed, 16 insertions, 1 deletions
diff --git a/.zshrc b/.zshrc
index f6d1c55..82279d4 100644
--- a/.zshrc
+++ b/.zshrc
@@ -15,7 +15,9 @@ REPORTTIME=10
## define word characters (for stuff like backward-word, forward-word, backward-kill-word,..)
## these are NOT separators but chars considered part of a word
-#WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default
+## these are NOT respected by e.g. vi-backward-kill-word, it seems
+# WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default
+## see below how to solve this with select-word-style module
# where zsh looks for functions
@@ -176,6 +178,19 @@ done
# keybindings might have been changed by plugins, etc.
# so they go more to the bottom
+# the vi bindings for these do not respect WORDCHARS and are not replaced by the select-word-style functions
+bindkey -M vicmd 'w' forward-word
+bindkey -M vicmd 'b' backward-word
+bindkey -M viins '^W' backward-kill-word
+
+
+# better word matching
+autoload -U select-word-style
+select-word-style normal
+zstyle ':zle:*' word-style normal
+# these characters do _not_ separate words but are part of words
+zstyle ':zle:*' word-chars '*?[]~;!#$%^(){}<>'
+
# should probably be closer to the bottom than the top?
zgenom load 'https://github.com/nojhan/liquidprompt'