fish: add quicklink commands
parent
89d60a6090
commit
f97304d44f
|
@ -22,10 +22,41 @@ function rebuild
|
|||
$HOME/src/scripts/rebuild.rkt
|
||||
end
|
||||
|
||||
function cheat.sh
|
||||
curl cheat.sh/$argv
|
||||
function cheat.sh -d 'Grabs a sheet from cheat.sh' -a arg
|
||||
curl cheat.sh/$arg
|
||||
end
|
||||
|
||||
complete -c cheat.sh -xa '(curl -s cheat.sh/:list)'
|
||||
|
||||
function ql -d 'Changes directory to a quicklink' -a name
|
||||
if not set -q quicklink_$name name
|
||||
echo (set_color red)"error: no quicklink named $name"(set_color normal)
|
||||
return
|
||||
end
|
||||
|
||||
set name quicklink_$name
|
||||
|
||||
cd $$name
|
||||
end
|
||||
|
||||
function ql-r -w ql -d 'Removes a quicklink' -a name
|
||||
if not set -q name
|
||||
echo (set_color red)"error: not enough arguments"(set_color normal)
|
||||
return
|
||||
end
|
||||
|
||||
set -Ue quicklink_$name
|
||||
end
|
||||
|
||||
function ql-s -d 'Saves the working directory as a quicklink' -a name
|
||||
if not set -q name
|
||||
echo (set_color red)"error: not enough arguments"(set_color normal)
|
||||
return
|
||||
end
|
||||
|
||||
set -U quicklink_$name $PWD
|
||||
end
|
||||
|
||||
complete -c ql -xa '(set -U | rg -or \'$1\' \'^quicklink_(.+) \')'
|
||||
|
||||
## EOF
|
||||
|
|
Loading…
Reference in New Issue