I couldn't do without a 'bookmarks' feature that I implemented for my terminal. It's triggered with `Alt+b`:
1. Scan an eternal history file for `cd` with absolute path except for /tmp/*
2. Sort and filter out duplicates
3. Call fzf and let user pick the desired result
4. Upon selection don't enter the directory but instead type `cd <selection>` into the prompt so that the user can navigate further using <Tab>.
What's nice about this approach is that it automatically builds your bookmarks, but only from `cd` commands where you deliberately used an absolute path.
Here's the code. It has some prerequisites (fzf[0] and ~/.eternal_bash_history[1]) and probably only works with my terminal (Xfce Terminal); it took a bit of tinkering to get it to work.
1. Scan an eternal history file for `cd` with absolute path except for /tmp/*
2. Sort and filter out duplicates
3. Call fzf and let user pick the desired result
4. Upon selection don't enter the directory but instead type `cd <selection>` into the prompt so that the user can navigate further using <Tab>.
What's nice about this approach is that it automatically builds your bookmarks, but only from `cd` commands where you deliberately used an absolute path.
Here's the code. It has some prerequisites (fzf[0] and ~/.eternal_bash_history[1]) and probably only works with my terminal (Xfce Terminal); it took a bit of tinkering to get it to work.
[0]: https://github.com/junegunn/fzf[1]: https://stackoverflow.com/a/19533853