Home

Awesome

seedee

Navigate interactively through directories / history of visited directories using arrow keys from command line.
Compatibility : bash / ksh / zsh
(compatible macos / debian / centos / solaris / alpine ...)

for a complete next-gen shell experience, see also these projects:

demo

<div align="center">
LeftUp/DownRight
previous dir in history
<img width="50px" src="https://github.com/joknarf/cdhist/assets/10117818/10ac2573-49fc-4ed5-8a6e-cce931c55ae2">
<img width="50px" src="https://github.com/joknarf/cdhist/assets/10117818/015131c5-8d8d-4c0d-8d44-a876fa6f2fb5"><img width="50px" src="https://github.com/joknarf/cdhist/assets/10117818/fe034fdc-dea5-49fa-be30-8f0bd9341208"><img width="50px" src="https://github.com/joknarf/cdhist/assets/10117818/1d254f15-050e-4ff9-9f5d-002e9ff4802f">
parent dir (..)dir history browserdir browser

directory pattern can be put on command line before hitting shortcut to filter result
putting on command line : work and hitting <kbd>Shift</kbd>+<kbd></kbd> will bring you to last visited directory containing work

keyaction
<kbd>Shift</kbd>+<kbd></kbd>cd history menu
<kbd>Shift</kbd>+<kbd></kbd>return to last directory in history matching pattern
<kbd>Shift</kbd>+<kbd></kbd>navigate from current directory
<kbd>Shift</kbd>+<kbd></kbd>go to parent dir (cd ..)
<kbd>Ctrl</kbd>+<kbd>Shift</kbd><kbd></kbd>search directories matching pattern in locate db
</div>

keys when in menu

keyaction
<kbd></kbd>select next item
<kbd></kbd>select prev item
<kbd>End</kbd>select last item
<kbd>Home</kbd>select first item
<kbd></kbd>browse selected directory
<kbd></kbd>browse parent directory
<kbd>Shift</kbd>+<kbd></kbd>browse selected directory with subdirectories depth 4
<kbd>Shift</kbd>+<kbd></kbd>back to only show subdirectories depth 1
<kbd>Shift</kdb>+<kbd></kbd>/<kbd>PgUp</kbd>/<kbd>Ctl</kbd>+<kbd>F</kbd>next page
<kbd>Shift</kdb>+<kbd></kbd>/<kbd>PgDn</kbd>/<kbd>Ctl</kbd>+<kbd>B</kbd>previous page
<kbd>Del</kbd>/<kbd>F8</kbd>delete directory entry in history
<kbd>Esc</kbd>exit
<kbd>Ctrl</kbd>+<kbd>A</kbd>use all screen to display menu
<kbd>Enter</kbd>/<kbd>Tab</kbd>go to directory

usage

$ . ./seedee
$ cd <dir>
=> change to <dir> and add <dir> to $CDHISTFILE
$ cd --
=> display current history / choose dir to change
$ cd -- <pat>...
=> search pattern <pat> in current history, change to dir if unique, display / chose dir either
$ cd - <pat>...
=> search pattern <pat> in cd history, change to dir first matched
$ cd + [<pat>]...
=> display immediate subdirectories of cwd, search / choose dir to change (except dot dirs, like .git/*)
$ cd ++ [<pat>]...
=> display subdirectories until depth 4, search / choose dir to change (except dot dirs, like .git/*)
$ cdl <pat>...
=> use locate -r and get list of directories to switch

cd - <opts> cd -- <opts> cd + <opts> cd ++ <opts> are aliases to cd- cd-- cd+ cd++

environment variables

VariableDescription
CDHISTFILEpath to history file (default to ~/.cd_history)
CDNBDIRSNumber of directories in history to display (default 10)
CDINITDIRSDirectory list (\n separated) to initialize CDHISTFILE if empty
CDPOWERLINEset to "n" to disable powerline symbol usage
CDHISTBINDbind key to cdhist
CDDOTBINDbind key to navigate from current dir
CDLBINDbind key to cdlocate
CDUPINDbind key to cd ..
CDLASTBINDbind key to cdhist last dir matching text