Use Fuzzy cd, using shell's history instead
Every cd is bookmarked and assigned a weight so you can later on jump to it quickly
-
Install fzf
-
XDG setup:
In
/etc/zsh/zshenv
,/etc/zshenv
or~/.zshenv
:# XDG configuration home if [[ -z $XDG_CONFIG_HOME ]] then export XDG_CONFIG_HOME=$HOME/.config fi # XDG data home if [[ -z $XDG_DATA_HOME ]] then export XDG_DATA_HOME=$HOME/.local/share fi
-
Bookmarks database:
mkdir -p $XDG_DATA_HOME/marks sqlite3 $XDG_DATA_HOME/marks/marks.sqlite << 'INIT' CREATE TABLE marks ( dir VARCHAR(200) UNIQUE, weight INTEGER ); CREATE INDEX _dir ON marks (dir); INIT
-
Autoload functions (ZSH Functions):
-
PWD hook function:
chpwd_functions+=(update_marks)
in~/.zshrc
c # choose where to cd from all bookmarks
c pattern ... # cd to a matching path
c -s # statistics
ccleanup