Just stick this in your ~/.bashrc
declare -A bookmarks bookmarks["myproject"]="/home/user/projects/folder/myproject" bookmarks["tmp"]="/tmp" keys=${!bookmarks[@]} function bm { if [ -z $1 ];then return; fi local directory=${bookmarks[$1]} if [ -n "$directory" ];then cd $directory else echo "Directory does not exist" fi } complete -W '$keys' bm
Image may be NSFW.
Clik here to view.

Clik here to view.
