feat(fish): add some plugins, update functions

This commit is contained in:
fbachus
2025-01-10 02:01:36 +01:00
parent 77cb47e4b5
commit 32f6b882a5
7 changed files with 58 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
function _puffer_fish_expand_bang
switch (commandline -t)
case '!'
commandline -t $history[1]
case '*'
commandline -i '!'
end
end

View 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

View 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

View File

@@ -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