Crates.io | jumb |
lib.rs | jumb |
version | 0.1.3 |
source | src |
created_at | 2024-06-22 05:33:47.206546 |
updated_at | 2024-06-22 10:27:58.34102 |
description | A lightning-fast CLI tool for directory navigation. Create custom shortcuts to instantly jump between frequently used paths, eliminating the need for lengthy cd commands. |
homepage | https://github.com/chetanXpro/jump |
repository | https://github.com/ChetanXpro/jump |
max_upload_size | |
id | 1280186 |
size | 30,378 |
How many times do you run the cd
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 lengthy cd
commands, saving time and streamlining workflow.
cd
Usage: Minimize the need to use lengthy cd
commands by setting up shortcuts to your most used 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 from the 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 wrapper
function jnav() {
unalias jumb 2>/dev/null
unset -f jumb 2>/dev/null
# Find the path to the 'jumb' executable dynamically
local jumb_path=$(which jumb)
if [[ -z "$jumb_path" ]]; then
echo "The 'jumb' command is not installed or not in PATH."
return 1 # Exit the function with an error status
fi
# Check if the command is 'view' without additional arguments
if [[ "$1" == "view" ]] && [[ $# -eq 1 ]]; then
# This should only list the directories, not change to any directory
$jumb_path view
elif [[ $# -eq 1 ]]; then
# Assuming any single argument not prefixed by 'view' is a path name
local dir=$($jumb_path "$1")
if [[ -d "$dir" ]]; then
cd "$dir"
else
echo "Directory not found: $dir"
fi
else
# Handle other commands or multiple arguments normally
$jumb_path "$@"
fi
}
jnav
Instead of jumb
?The jnav
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:
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 .
jnav shortcut_name
jnav remove shortcut_name
jnav view
jnav view <Shortcut_name>
Contributions are encouraged. Feel free to fork the project and submit pull requests.