2020-08-09 22:59:14 +00:00
|
|
|
function editcb -a ft -d 'Opens your editor to the cliboard\'s current contents.'
|
2020-08-15 23:20:08 +00:00
|
|
|
set uname (uname)
|
|
|
|
set file "._temp.$ft"
|
2020-08-09 22:59:14 +00:00
|
|
|
|
2020-08-15 23:20:08 +00:00
|
|
|
touch $file
|
2020-08-09 22:59:14 +00:00
|
|
|
|
2020-08-15 23:20:08 +00:00
|
|
|
switch "$uname"
|
|
|
|
case 'Linux'
|
2020-10-31 22:13:25 +00:00
|
|
|
xclip -out -selection clipboard >$file
|
2020-08-15 23:20:08 +00:00
|
|
|
case 'Darwin'
|
2020-10-31 22:13:25 +00:00
|
|
|
pbpaste >$file
|
2020-08-15 23:20:08 +00:00
|
|
|
end
|
2020-08-09 22:59:14 +00:00
|
|
|
|
2020-08-15 23:20:08 +00:00
|
|
|
$EDITOR $file
|
2020-08-09 22:59:14 +00:00
|
|
|
|
2020-08-15 23:20:08 +00:00
|
|
|
switch "$uname"
|
|
|
|
case 'Linux'
|
2020-10-31 22:13:25 +00:00
|
|
|
xclip -in -selection clipboard <$file
|
2020-08-15 23:20:08 +00:00
|
|
|
case 'Darwin'
|
2020-10-31 22:13:25 +00:00
|
|
|
pbcopy <$file
|
2020-08-15 23:20:08 +00:00
|
|
|
end
|
2020-08-09 22:59:14 +00:00
|
|
|
|
2020-08-15 23:20:08 +00:00
|
|
|
rm $file
|
2020-08-09 22:59:14 +00:00
|
|
|
end
|