Add frequent-directory function

`frequent-directory` exports and environment variable and creates a hash
directory with the given argument of the form `<name>=<path>`.
This commit is contained in:
Kenneth Benzie 2020-07-30 11:23:30 +01:00
parent 01fcdc1863
commit a67649e844

7
zshrc
View File

@ -173,6 +173,10 @@ if [[ ! -z "$cursor_block" && ! -z "$cursor_line" ]]; then
zle -N zle-line-finish zle -N zle-line-finish
fi fi
# Frequntly used directories
function frequent-directory() { export $1; hash -d $1 }
frequent-directory Projects="$HOME/Projects"
# Load work related config # Load work related config
[ -f ~/.config/work/zshrc ] && source ~/.config/work/zshrc [ -f ~/.config/work/zshrc ] && source ~/.config/work/zshrc
@ -205,6 +209,3 @@ case `uname` in
alias debug='lldb --' alias debug='lldb --'
;; ;;
esac esac
# Hashed Directories
hash -d Projects="$HOME/Projects"