Set fish_vi_key_bindings to start in insert mode by default

Add optional argument for fish_vi_key_bindings to set desired initial
mode:
> fish_vi_key_bindings default
This commit is contained in:
Maxim Gonchar 2014-04-09 20:59:58 +04:00 committed by ridiculousfish
parent 023af5585f
commit 2872a98b2b

View file

@ -1,5 +1,10 @@
function fish_vi_key_bindings -d "vi-like key bindings for fish"
function fish_vi_key_bindings --description 'vi-like key bindings for fish'
bind --erase --all
set -l init_mode insert
if set -q argv[1]
set init_mode $argv[1]
end
##
## command mode
@ -214,4 +219,5 @@ function fish_vi_key_bindings -d "vi-like key bindings for fish"
bind -M visual -m default \cc end-selection force-repaint
bind -M visual -m default \e end-selection force-repaint
set fish_bind_mode $init_mode
end