4 ms·
setopt pushd_to_home # pushd with no arguments goes to ~ I would personally dislike that, because without that option set, calling pushd (at least in Zsh)
by nuclear_eclipse 18y ago
setopt pushd_to_home # pushd with no arguments goes to ~
I would personally dislike that, because without that option set, calling pushd (at least in Zsh) with no argument will actually rotate the top two elements on the directory stack, which can be extremely handy for switching between two places, rather than needing to constantly call `pushd +1` or `pushd -1`.
e.g.:
$ pu ~
/home/user
$ pu workspace/project
/home/user/workspace/project /home/user
$ pu /tmp/data
/tmp/data /home/user/workspace/project /home/user
$ pu
/home/user/workspace/project /tmp/data /home/user
$ po
/tmp/data /home/user
$ po
/home/user
note that I alias pu="pushd" and po="popd" for easier shell usage...