- Notifications
You must be signed in to change notification settings - Fork0
A CLI tool to manage and navigate directories quickly.
License
ChetanXpro/jumb
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
How many times do you run thecd
command in a day? If you're like many developers, it's probably more than you'd like to count.
Jumb is a command-line tool that simplifies directory navigation by allowing users to create shortcuts for frequently accessed directories. This reduces the need for lengthycd
commands, saving time and streamlining workflow.
- Reduce
cd
Usage: Minimize the need to use lengthycd
commands by setting up shortcuts to your most used directories. - Save Time: Dramatically reduce the time spent navigating between different parts of your file system, enhancing productivity, especially for developers and system administrators.
- Streamline Workflow: Improve your workflow efficiency by quickly switching contexts between projects and directories.
Before installing Jumb, ensure you have the following installed on your system:
- Git: Required to clone the repository if not installing via Cargo.
- Rust and Cargo: Jumb is built with Rust, so you'll need Rust and Cargo installed to compile and install it directly from the source or via Cargo. Install them fromthe official Rust site.
Install Jumb directly from Cargo:
cargo install jumb
NOTE: After installing Jumb with Cargo, it's essential to wrap it with a shell script to make the tool work properly.
Integrate Jumb with your shell by adding a shell wrapper to your .zshrc or .bashrc file. This wrapper ensures that using Jumb feels like a natural extension of your shell commands.
# Jumb tool wrapperfunctionjnav() {unalias jumb2>/dev/nullunset -f jumb2>/dev/null# Find the path to the 'jumb' executable dynamicallylocal jumb_path=$(which jumb)if [[-z"$jumb_path" ]];thenecho"The 'jumb' command is not installed or not in PATH."return 1# Exit the function with an error statusfi# Check if the command is 'view' without additional argumentsif [["$1"=="view" ]]&& [[$#-eq 1 ]];then# This should only list the directories, not change to any directory$jumb_path viewelif [[$#-eq 1 ]];then# Assuming any single argument not prefixed by 'view' is a path namelocal dir=$($jumb_path"$1")if [[-d"$dir" ]];thencd"$dir"elseecho"Directory not found:$dir"fielse# Handle other commands or multiple arguments normally$jumb_path"$@"fi}
Thejnav
function is used instead of directly invoking jumb to avoid any potential conflicts with the binary name. This function ensures that the shell correctly handles the custom functionality provided by Jumb, such as managing and navigating to directory shortcuts.
If you prefer a different name for the function, replace jnav with your chosen name to prevent potential conflicts with the Jumb binary.
Set up and manage your directory shortcuts easily:
- Add a Shortcut
jnav add shortcut_name absolute/path/to/directory
For example, if you want to add the current directory path, then you can run the command with a full stop to add the current dir.
jnav add project.
- Navigate quickly using:
jnav shortcut_name
- Remove a Shortcut
jnav remove shortcut_name
- View All Shortcuts
jnav view
- View particular shortcut path
jnav view<Shortcut_name>
Contributions are encouraged. Feel free to fork the project and submit pull requests.