Access any previously visited directory typing cd <part_of_path>
After using the cd command several times, you will have a set of directories that you can easily access like bookmarks. For example:
You accessed the /home/user/Downloads/ once. Next time you want to visit the /Downloads directory you can just type cd Downloads anywhere, or even cd Dow, for instance.
When you access any directory using the cd command, the full path is stored into the ~/.autoleap.history file.
When you type any string after the cd command, the script will try to change to the directory you've specified. If the directory does not exist, the script will search the history file for that string and change to the path if it is found in the history file.
If there are multiple exact matches for your search pattern, Autoleap will use fzf (if available) to display an interactive selection menu that allows you to choose which directory to navigate to.
All of this is possible because the script declares a cd function that wraps the built-in cd command.
- Be sure you use the bash shell, since this script was written for it.
- Download the script
autoleap.shanywhere, for example, to/usr/local/bin/. sourcethe script on your.bashrc(add the linesource /usr/local/bin/autoleap.shto the end of your.bashrc)- Reopen the terminal (or source
.bashrc) - For interactive directory selection, install
fzfby following the instructions at https://github.com/junegunn/fzf/
This project was inspired by wting/autojump.
