random scripts I use
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
719 B

#!/usr/bin/env fish
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