app-misc/wcd is a utility program that should make changing directories on the command line more efficient. It was written by Erwin Waterlander in 1996 for HP-UX and was ported to many different operating systems, like DOS, Windows (95 to 10), MacOSX and, of course, Linux.
Because wcd indexes the filesystem on first run, and therefore can find the directories very fast. But what I also like is that this is coming from a time where mouse support was not really a big thing, so it has keyboard centric usage and is therefore very past to use.
When you type something like wcd org you get a list of files:
a /home/pascal/.emacs.d/.local/cache/org
b /home/pascal/.emacs.d/.local/straight/build-28.1/evil-collection/modes/org
c /home/pascal/.emacs.d/.local/straight/build-28.1/org
d /home/pascal/.emacs.d/.local/straight/repos/evil-collection/modes/org
e /home/pascal/.emacs.d/.local/straight/repos/org
f /home/pascal/.emacs.d/modules/lang/org
g /home/pascal/.emacs.old/.local/cache/org
h /home/pascal/.emacs.old/.local/straight/build-28.1/evil-collection/modes/org
i /home/pascal/.emacs.old/.local/straight/build-28.1/org
j /home/pascal/.emacs.old/.local/straight/repos/evil-collection/modes/org
k /home/pascal/.emacs.old/.local/straight/repos/org
l /home/pascal/.emacs.old/modules/lang/org
m /home/pascal/nextcloud/Uni/Theoretische Informatik/JFLAP7.1/org
n /home/pascal/nextcloud/org
o /home/pascal/org
w=up x=down ?=help Page 1/1
Perfect match for 15 directories.
Please choose one (<Enter> to abort):
Typing a letter now will change the working directory to the given path.
On top of that wcd offers a very nice file browser for the terminal. I used to use lf
for that (and only that, I know lf can do much more, but for I all the
file operations I just stick to the normal shell commands), which is
also a good program, but the default vim-like behaviour make things in
wcd even a tad better for me. You activate the file browser with wcd -g and something like this will come up:
ββ org2blog ββ¬β<htmlize>βββ .git ββ¬β hooks
β β ββ info
β β ββ logs βββ refs ββ¬β heads
β β β ββ remotes βββ origin
β β ββ objects ββ¬β info
β β β ββ pack
β β ββ refs ββ¬β heads
β β ββ remotes βββ origin
β β ββ tags
β ββ hydra ββ¬β .git ββ¬β hooks
β β β ββ info
β β β ββ logs βββ refs ββ¬β heads
β β β β ββ remotes βββ origin
β β β ββ objects ββ¬β info
β β β β ββ pack
β β β ββ refs ββ¬β heads
β β β ββ remotes βββ origin
β β β ββ tags
β β ββ .github
β β ββ doc
β β ββ targets
β ββ metaweblog ββ¬β .git ββ¬β hooks
β β β ββ info
β β β ββ logs βββ refs ββ¬β heads
β β β β ββ remotes βββ origin
β β β ββ objects ββ¬β info
β β β β ββ pack
β β β ββ refs ββ¬β heads
β β β ββ remotes βββ origin
β β β ββ tags
β β ββ .github βββ ISSUE_TEMPLATE
β β ββ ci βββ vale βββ styles βββ Vocab βββ Base
β β ββ docs
β β ββ images
β β ββ svg
β β ββ tests
β ββ org2blog ββ¬β .git ββ¬β hooks
β β β ββ info
β β β ββ logs βββ refs ββ¬β heads
β β β β ββ remotes βββ origin
Now, you can go around the directory tree with arrow keys or HJKL. Additionally you can search similar to vim by typing /.
To go to the next occurence of the searched term, type CTRL-n. Pressing
enter will exit the tree view and change the working dir of the shell
to the highlighted directory.