diff options
author | Julian Aron Prenner <julian@linux4you.it> | 2013-12-31 14:53:29 +0100 |
---|---|---|
committer | Julian Aron Prenner <julian@linux4you.it> | 2013-12-31 14:53:29 +0100 |
commit | 2587649ca28ac9a161c51430c630a34fc09f8dc5 (patch) | |
tree | c14c1193de7f4b97567ed3387f1f68780c744d17 /share/functions/fish_vi_key_bindings.fish | |
parent | d1faac58dd7e22c959c8d8d2bb626842b88bff5c (diff) |
Allow restricting earsing and listing of bindings to specific mode;
implement force repaint and multi-char bindings;
Diffstat (limited to 'share/functions/fish_vi_key_bindings.fish')
-rw-r--r-- | share/functions/fish_vi_key_bindings.fish | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index 245e2cc4..cec66ea0 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -1,6 +1,3 @@ -function nothing -end - function fish_vi_key_bindings -d "vi-like key bindings for fish" bind --erase --all @@ -19,7 +16,7 @@ function fish_vi_key_bindings -d "vi-like key bindings for fish" bind -k right forward-char bind -k left backward-char bind \n execute - bind -m insert i nothing + bind -m insert i force-repaint bind -m insert a forward-char bind \x24 end-of-line @@ -27,6 +24,15 @@ function fish_vi_key_bindings -d "vi-like key bindings for fish" bind \e\[H beginning-of-line bind \e\[F end-of-line + # NOTE: history-search-backward and history-search-forward + # must both be bound for `commandline -f ...' to work, and thus for up-or-search + # and down-or-search to work, since those are actually + # simple shell functions that use `commandline -f ...'. + # Generally, commandline -f can only invoke functions that have been bound previously + + bind u history-search-backward + bind \cr history-search-forward + bind k up-or-search bind j down-or-search bind \e\[A up-or-search @@ -39,6 +45,8 @@ function fish_vi_key_bindings -d "vi-like key bindings for fish" bind w forward-word bind W backward-word + bind dd kill-line + bind y yank bind p yank-pop @@ -51,6 +59,17 @@ function fish_vi_key_bindings -d "vi-like key bindings for fish" bind -M insert -k dc delete-char bind -M insert -k backspace backward-delete-char - bind -M insert -m default \e nothing + bind -M insert -m default \e force-repaint + bind -M insert -m default q force-repaint bind -M insert \t complete + + bind -M insert \e\[A up-or-search + bind -M insert \e\[B down-or-search + bind -M insert -k down down-or-search + bind -M insert -k up up-or-search + + bind -M insert \e\[C forward-char + bind -M insert \e\[D backward-char + bind -M insert -k right forward-char + bind -M insert -k left backward-char end |