mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Add clipboard helper functions and bind them
\cy copies, \cv pastes.
This commit is contained in:
parent
1bad956633
commit
7d1f45e25f
3 changed files with 16 additions and 1 deletions
7
share/functions/fish_clipboard_copy.fish
Normal file
7
share/functions/fish_clipboard_copy.fish
Normal 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
|
7
share/functions/fish_clipboard_paste.fish
Normal file
7
share/functions/fish_clipboard_paste.fish
Normal 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
|
|
@ -18,7 +18,8 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
|
||||||
bind $argv \r execute
|
bind $argv \r execute
|
||||||
|
|
||||||
bind $argv \ck kill-line
|
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 \t complete
|
||||||
|
|
||||||
bind $argv \e\n "commandline -i \n"
|
bind $argv \e\n "commandline -i \n"
|
||||||
|
|
Loading…
Reference in a new issue