Add support for named (read: hashed) directories

Added support for named directories to my zsh config.
This is a way to access directories under shortened names
conveniently.
This commit is contained in:
c47 2024-02-19 06:55:50 +01:00
parent 2325604f1c
commit 402cb0caf4
3 changed files with 29 additions and 0 deletions

View file

@ -64,3 +64,6 @@ fi
if [[ ! -L ${HOME}/.zshrc ]]; then
ln -s ${WORKING_DIR}/zsh/zshrc .zsh/.zshrc 2>/dev/null
fi
if [[ ! -L ${HOME}/.zsh/.zdirhashes ]]; then
ln -s ${WORKING_DIR}/zsh/zdirhashes .zsh/.zdirhashes 2>/dev/null

22
zsh/zdirhashes Normal file
View file

@ -0,0 +1,22 @@
hash -d c=~/.config
hash -d ca=~c/awesome
hash -d cg=~c/git
hash -d cx=~c/xmonad
hash -d d=/data
hash -d db=~d/books
hash -d dd=~d/dokumentumok
hash -d dm=~d/music
hash -d g=~/gits
hash -d gp=~g/priv
hash -d gpd=~g/priv/dotfiles
hash -d gpw=~g/priv/www.nixre.net-sources
hash -d l=~/.local
hash -d lb=~l/bin
hash -d ll=~l/lib
hash -d lsc=~l/scripts
hash -d lss=~l/share
hash -d z=~/.zsh

View file

@ -29,3 +29,7 @@ export SSH_AUTH_SOCK=/var/run/user/$(echo $UID)/ssh-agent.sock
if [[ ! $(pidof ssh-agent) ]]; then
eval $(ssh-agent -a ${SSH_AUTH_SOCK})
fi
if [[ -f ${ZDOTDIR}/.zdirhashes ]]; then
source ${ZDOTDIR}/.zdirhashes
fi