Skip to content

Commit

Permalink
feat(key_bindings): add hybrid key bindings for fish shell
Browse files Browse the repository at this point in the history
This commit introduces a new function `fish_hybrid_key_bindings` that
provides Vi-style bindings that inherit emacs-style bindings in all
modes. These bindings are not enabled in vim/neovim terminal. The
`fish_key_bindings` global variable is set to use these hybrid bindings.
  • Loading branch information
ryoppippi committed May 21, 2024
1 parent 7134eaf commit a7ebd2e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions fish/config/key_bindings.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function fish_hybrid_key_bindings --description \
"Vi-style bindings that inherit emacs-style bindings in all modes & not enabled in vim/neovim terminal"
for mode in default insert visual
fish_default_key_bindings -M $mode
end
if set -q NVIM
or set -q VIM_TERMINAL
fish_default_key_bindings
else
fish_vi_key_bindings --no-erase
end
end

set -g fish_key_bindings fish_hybrid_key_bindings

0 comments on commit a7ebd2e

Please sign in to comment.