Effortlessly manage and navigate your folders with cd++
. This bash script allows you to create custom labels for your directories, enabling you to switch between them using simple label-based commands.
Whether you're juggling multiple projects simultaneously, dealing with a complex folder structure, or any other scenario that requires frequent directory navigation, cd++
offers a solution. With it, you can label your frequently visited folders and later access them with a straightforward command, go label-name
.
Consider the following folder structure:
WORKS
├── apple
├── banana
└── strawberry
To navigate this structure with ease:
- First, label the directories of interest. You can even assign multiple labels to a single directory:
/tmp$ cd WORKS
/tmp/WORKS$ mark works
/tmp/WORKS$ cd apple
/tmp/WORKS/apple$ mark apple
/tmp/WORKS/apple$ cd ../banana
/tmp/WORKS/banana$ mark banana
/tmp/WORKS/banana$ cd ../strawberry/
/tmp/WORKS/strawberry$ mark strawberry # Multiple labels
/tmp/WORKS/strawberry$ mark strwbry # for the same directory
/tmp/WORKS/strawberry$ mark berry # are supported
- Use the go command to navigate seamlessly:
/tmp$ go banana
/tmp/WORKS/banana$
/tmp/WORKS/banana$ go work
Error: Label not found.
/tmp/WORKS/banana$ go works
/tmp/WORKS$
/tmp/WORKS$ mark work # add new labels any time you want
/tmp/WORKS$
/tmp/WORKS$ go berry
/tmp/WORKS/strawberry$ go work
/tmp/WORKS$ go apple
/tmp/WORKS/apple$
With cd++, your directory navigation becomes efficient and intuitive.
- Ensure you have the necessary permissions to copy files to /usr/local/bin and to modify your shell's configuration file (like .bashrc, .zshrc, etc.).
-
Clone the Repository:
git clone https://github.com/vitalij555/cd_plus_plus.git cd cd-plus-plus
-
Run the Installation Script:
chmod +x install.sh ./install.sh
During the installation, you will be prompted:
Do you want to install the command extensions as well? (yes/NO):
If you wish to also install the command extensions, type
yes
and pressEnter
. Otherwise, simply pressEnter
to continue without installing them. -
Restart your Shell:
This ensures that the changes are applied. Alternatively, you can manually source your shell configuration file:
-
For Bash:
. ~/.bashrc
-
For Zsh:
. ~/.zshrc
-
For Fish:
source ~/.config/fish/config.fish
-
...and so on for other shells.
-
After installation, you can test the functionality:
-
For the main script:
mark test
This should save the current directory with the label "test".
-
If you installed the command extensions:
ls #test
This should list the contents of the directory you just saved under the label "test".
This project is licensed under the MIT License.