Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions share/functions/fish_vi_key_bindings.fish
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,16 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
bind -s --preset , repeat-jump-reverse

# in emacs yank means paste
bind -s --preset p yank
bind -s --preset P backward-char yank
# in vim p means paste *after* current character, so go forward a char before pasting
# also in vim, P means paste *at* current position (like at '|' with cursor = line),
# \ so there's no need to go back a char, just paste it without moving
bind -s --preset p forward-char yank
bind -s --preset P yank
bind -s --preset gp yank-pop

bind -s --preset '"*p' "commandline -i ( xsel -p; echo )[1]"
bind -s --preset '"*P' backward-char "commandline -i ( xsel -p; echo )[1]"
# same vim 'pasting' note as upper
bind -s --preset '"*p' forward-char "commandline -i ( xsel -p; echo )[1]"
bind -s --preset '"*P' "commandline -i ( xsel -p; echo )[1]"

#
# Lowercase r, enters replace_one mode
Expand Down