Add clipboard helper functions and bind them

\cy copies, \cv pastes.
This commit is contained in:
Fabian Homborg 2016-05-24 13:17:03 +02:00
parent 1bad956633
commit 7d1f45e25f
3 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,7 @@
function fish_clipboard_copy
if type -q pbcopy
commandline | pbcopy
else if type -q xsel
commandline | xsel --clipboard
end
end

View file

@ -0,0 +1,7 @@
function fish_clipboard_paste
if type -q pbpaste
commandline -i (pbpaste)
else if type -q xsel
commandline -i (xsel --clipboard)
end
end

View file

@ -18,7 +18,8 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind $argv \r execute
bind $argv \ck kill-line
bind $argv \cy yank
bind $argv \cy fish_clipboard_copy
bind $argv \cv fish_clipboard_paste
bind $argv \t complete
bind $argv \e\n "commandline -i \n"