mirror of
https://github.com/mitchell/dotfiles.git
synced 2025-12-17 12:27:22 +00:00
Refactor config.fish to use functions moved to functions folder
This commit is contained in:
parent
b5e93105d6
commit
47a88f93d1
10 changed files with 125 additions and 121 deletions
24
.config/fish/functions/editcb.fish
Normal file
24
.config/fish/functions/editcb.fish
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
function editcb -a ft -d 'Opens your editor to the cliboard\'s current contents.'
|
||||
set uname (uname)
|
||||
set file "._temp.$ft"
|
||||
|
||||
touch $file
|
||||
|
||||
switch "$uname"
|
||||
case 'Linux'
|
||||
xclip -out -selection clipboard > $file
|
||||
case 'Darwin'
|
||||
pbpaste > $file
|
||||
end
|
||||
|
||||
$EDITOR $file
|
||||
|
||||
switch "$uname"
|
||||
case 'Linux'
|
||||
xclip -in -selection clipboard < $file
|
||||
case 'Darwin'
|
||||
pbcopy < $file
|
||||
end
|
||||
|
||||
rm $file
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue