mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 19:41:14 -03:00
Add clipboard helper functions and bind them
\cy copies, \cv pastes.
This commit is contained in:
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user