Merge branch 'master' into 'master'

Make bang-bang compatible with vi mode

See merge request dwt1/dotfiles!14
This commit is contained in:
Derek Taylor
2020-11-07 20:02:54 +00:00

View File

@@ -182,8 +182,6 @@ function commits
end end
# Functions needed for !! and !$ # Functions needed for !! and !$
# Will only work in default (emacs) mode.
# Will NOT work in vi mode.
function __history_previous_command function __history_previous_command
switch (commandline -t) switch (commandline -t)
case "!" case "!"
@@ -203,8 +201,13 @@ function __history_previous_command_arguments
end end
end end
# The bindings for !! and !$ # The bindings for !! and !$
bind ! __history_previous_command if [ $fish_key_bindings = fish_vi_key_bindings ];
bind '$' __history_previous_command_arguments 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 # Function for creating a backup file
# ex: backup file.txt # ex: backup file.txt