Daily Shaarli

All links of one day in a single page.

September 13, 2021

How to use bookmarks in bash/zsh. | by threkk | Medium
thumbnail

Shell Bookmarks in .bashrc

if [ -d "$HOME/.bookmarks" ]; then
export CDPATH=".:$HOME/.bookmarks:/"
alias goto="cd -P"
_goto()
{
local IFS=$'\n'
COMPREPLY=( $( compgen -W "$(/bin/ls ~/.bookmarks)" -- ${COMP_WORDS[COMP_CWORD]} ) )
} && complete -F _goto goto
fi