added directory bookmarking
This commit is contained in:
parent
f01cf24c94
commit
7b08c09a22
11
bashrc.d/009-cdbookmark.sh
Normal file
11
bashrc.d/009-cdbookmark.sh
Normal file
@ -0,0 +1,11 @@
|
||||
# boosted from https://threkk.medium.com/how-to-use-bookmarks-in-bash-zsh-6b8074e40774 and adapted using mattn_jp's bash changes: https://twitter.com/mattn_jp/status/1434192554036137995?s=20
|
||||
if [ -d "$HOME/.local/cdbookmarks" ]; then
|
||||
export CDPATH=".:$HOME/.local/cdbookmarks:/"
|
||||
alias goto="cd -P"
|
||||
_goto()
|
||||
{
|
||||
local IFS=$'\n'
|
||||
COMPREPLY=( $( compgen -W "$(/bin/ls $HOME/.local/cdbookmarks)" -- ${COMP_WORDS[COMP_CWORD]}))
|
||||
} && complete -F _goto goto
|
||||
|
||||
fi
|
Loading…
Reference in New Issue
Block a user