mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 21:18:53 +00:00
parent
68bbe13d23
commit
2109af0987
4 changed files with 20 additions and 0 deletions
|
@ -9,6 +9,9 @@ function fish_mode_prompt --description "Displays the current mode"
|
|||
case insert
|
||||
set_color --bold --background green white
|
||||
echo '[I]'
|
||||
case replace-one
|
||||
set_color --bold --background green white
|
||||
echo '[R]'
|
||||
case visual
|
||||
set_color --bold --background magenta white
|
||||
echo '[V]'
|
||||
|
|
|
@ -198,7 +198,13 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
|||
|
||||
bind -M insert \ef forward-word
|
||||
|
||||
#
|
||||
# Lowercase r, enters replace-one mode
|
||||
#
|
||||
|
||||
bind -m replace-one r force-repaint
|
||||
bind -M replace-one -m default '' delete-char self-insert backward-char force-repaint
|
||||
bind -M replace-one -m default \e cancel force-repaint
|
||||
|
||||
#
|
||||
# visual mode
|
||||
|
|
|
@ -27,6 +27,16 @@ expect_prompt -re {\r\nsuccess\r\n} {
|
|||
puts stderr "Couldn't find expected output 'success'"
|
||||
}
|
||||
|
||||
# Test lowercase-r replace
|
||||
send_line "\033ddiecho TEXT\033hhrAi"
|
||||
expect_prompt -re {\r\nTAXT\r\n} {
|
||||
puts "replace success"
|
||||
} -nounmatched -re {\r\nfail} {
|
||||
puts stderr "replace fail"
|
||||
} unmatched {
|
||||
puts stderr "Couldn't find expected output 'TAXT'"
|
||||
}
|
||||
|
||||
# still in insert mode, switch back to regular key bindings
|
||||
send_line "set -g fish_key_bindings fish_default_key_bindings"
|
||||
expect_prompt
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
success
|
||||
success
|
||||
replace success
|
||||
success
|
||||
|
|
Loading…
Reference in a new issue