A bit like mfaerevaag/wd, warp to directories.
Move, link or copy wd.py
to ~/bin/wd.py
.
Edit ~.bashrc/.zshrc
:
wd() {
cd $(~/bin/wd.py $1)
}
wdl() {
cat ~/.wdrc
}
A pathfile (~/.wdrc
) consists of key=value
pairs of aliast=path
strings.
For example, projc1 is the alias and /src/projects/projectOne is the destination.
proj1=~/src/projects/projectOne
proj2=~/src/projects/projectTwo
The pathfile alias is used to move to the destination:
$ wd proj1
$ pwd
/src/projects/projectOne
echo "alias=$(pwd)" >> ~/.wdrc
# ~/.bashrc||.zshrc
wadd(){
echo "$1=$(pwd)" >> ~/.wdrc
}
# ~/.bashrc||.zshrc
wlink(){
echo "$1=realpath($2)" >> ~.wdrc
}