feat(fish): add some plugins, update functions
This commit is contained in:
9
.config/fish/functions/_puffer_fish_expand_bang.fish
Normal file
9
.config/fish/functions/_puffer_fish_expand_bang.fish
Normal file
@@ -0,0 +1,9 @@
|
||||
function _puffer_fish_expand_bang
|
||||
switch (commandline -t)
|
||||
case '!'
|
||||
commandline -t $history[1]
|
||||
case '*'
|
||||
commandline -i '!'
|
||||
end
|
||||
end
|
||||
|
||||
9
.config/fish/functions/_puffer_fish_expand_dots.fish
Normal file
9
.config/fish/functions/_puffer_fish_expand_dots.fish
Normal file
@@ -0,0 +1,9 @@
|
||||
function _puffer_fish_expand_dots -d 'expand ... to ../.. etc'
|
||||
set -l cmd (commandline --cut-at-cursor)
|
||||
set -l split (string split -- ' ' $cmd)
|
||||
if string match --quiet --regex -- '^(\.\./)*\.\.$' $split[-1]
|
||||
commandline --insert '/..'
|
||||
else
|
||||
commandline --insert '.'
|
||||
end
|
||||
end
|
||||
9
.config/fish/functions/_puffer_fish_expand_lastarg.fish
Normal file
9
.config/fish/functions/_puffer_fish_expand_lastarg.fish
Normal file
@@ -0,0 +1,9 @@
|
||||
function _puffer_fish_expand_lastarg
|
||||
switch (commandline -t)
|
||||
case '!'
|
||||
commandline -t ""
|
||||
commandline -f history-token-search-backward
|
||||
case '*'
|
||||
commandline -i '$'
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
function restart --argument x
|
||||
|
||||
pkill $x && $x &>/dev/null& && jobs | disown
|
||||
pkill $x && $x &>/dev/null& && sleep 0.2 && jobs | disown
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user