Not maintained anymore. I use zoxide now.
Easily jump to recently used directories with oh-my-zsh's 'd'-like directory history that still saved after exiting the terminal.
-
Show the list of 10 most recent used directories with
d
. -
Jump to any directory in the list by typing the number of the directory in the list.
-
A directory path will be put to the top of the list every time you visit a directory.
- Home or
~/
is never added to the history (we can just typecd
). - Shows the last time a path was popped out from the history. This information may help you adjust the history size to better suit your need. To change the history size, refer to this section
You can modify the code to suit your needs. If you follow the installation guide, the script is located in ~/.config/dirjump/dirjump
.
You can change the main command from d
to another by modifying the code below:
dirjump_command="d"
By default, you can also jump with <main command> <directory number>
:
d 8
If you already used any number as aliases, just delete or comment out the code from line 17 to 22.
There you go.
-
Download the script.
curl --create-dirs -o ~/.config/dirjump/dirjump https://raw.githubusercontent.com/imambungo/dirjump/master/dirjump
-
Source the script to your shell. Don't forget to restart your terminal afterward.
echo 'source ~/.config/dirjump/dirjump' >> ~/.bashrc
If you use Zsh:
echo 'source ~/.config/dirjump/dirjump' >> ~/.zshrc
-
Delete the script and the directory history file.
rm -rf ~/.config/dirjump
-
Unsource the script from your shell.
grep -Fxv "source ~/.config/dirjump/dirjump" ~/.bashrc > temp; mv temp ~/.bashrc
If you use Zsh:
grep -Fxv "source ~/.config/dirjump/dirjump" ~/.zshrc > temp; mv temp ~/.zshrc #####
If you found bugs, typos, wrong grammar, or have any suggestion or question, feel free to create a new issue.