3 ms·
Here is one additional bookmark solution [1]: export CDPATH=.:~/.marks/ function mark { ln -sr "$(pwd)" ~/.marks/"$1" } mark @name
by kkoncevicius 6y ago
Here is one additional bookmark solution [1]:
export CDPATH=.:~/.marks/
function mark {
ln -sr "$(pwd)" ~/.marks/"$1"
}
mark @name # create a bookmark
cd @name # jump to bookmark
cd @<tab> # list bookmarks
cd @n<tab> # auto-complete
cd @name/<tab> # can access sub-directories within bookmarks
Works best when bookmarks are prefixed by "@" or other special symbol. Additional advantage is that you can use the same function `cd` to navigate both bookmarked and regular directories.
[1]: http://karolis.koncevicius.lt/posts/fast_navigation_in_the_command_line/ http://karolis.koncevicius.lt/posts/fast_navigation_in_the_c...
- sandreas 6y agoThis is AWESOME. Thank you.
- aasasd 6y agoPretty sure this would change into the symlinks, not the linked directories. I.e. the $PWD would be under `~/.marks/`.
- kkoncevicius 6y agoPersonally - never noticed a problem, but should be easy to solve just in case: alias cd="cd -P"
- _def 6y agoI have seen many solutions like this but this one is by far the most lightweighted. Thank you for sharing.
- m3ta4a 6y agoMight be worth pointing out the author of the post you linked settled in the end on `cd` and `ls` in a different style of organization over bookmarks or `z` or any other tool.
- deleted 6y ago[deleted]