oh-my-fish/plugins/jump/mark.fish

17 lines
449 B
Fish
Raw Normal View History

2013-12-11 01:55:51 +00:00
function mark
if test (count $argv) -eq 1
command ln -s (pwd) $MARKPATH/$argv[1]
else if test (count $argv) -eq 2
if test -d $argv[2]
2013-12-13 02:18:16 +00:00
set -l current_dir (pwd)
2013-12-11 01:55:51 +00:00
cd $argv[2]
command ln -s (pwd) $MARKPATH/$argv[1]
2013-12-13 02:18:16 +00:00
cd $current_dir
2013-12-11 01:55:51 +00:00
else
echo "$argv[2] is not a valid directory."
end
else
echo "Usage: mark <MARK_NAME> [DIRECTORY]"
end
end