mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2023-02-13 20:55:19 -05:00
Make bang-bang compatible with vi mode
This commit is contained in:
parent
8fbacc6392
commit
670a42afed
1 changed files with 7 additions and 4 deletions
|
@ -182,8 +182,6 @@ function commits
|
|||
end
|
||||
|
||||
# Functions needed for !! and !$
|
||||
# Will only work in default (emacs) mode.
|
||||
# Will NOT work in vi mode.
|
||||
function __history_previous_command
|
||||
switch (commandline -t)
|
||||
case "!"
|
||||
|
@ -203,8 +201,13 @@ function __history_previous_command_arguments
|
|||
end
|
||||
end
|
||||
# The bindings for !! and !$
|
||||
bind ! __history_previous_command
|
||||
bind '$' __history_previous_command_arguments
|
||||
if [ $fish_key_bindings = fish_vi_key_bindings ];
|
||||
bind -Minsert ! __history_previous_command
|
||||
bind -Minsert '$' __history_previous_command_arguments
|
||||
else
|
||||
bind ! __history_previous_command
|
||||
bind '$' __history_previous_command_arguments
|
||||
end
|
||||
|
||||
# Function for creating a backup file
|
||||
# ex: backup file.txt
|
||||
|
|
Loading…
Reference in a new issue