GitHub - psqlmaster/jump: 🦘→📂 jump is a lightweight, zero-dependency module for managing directory aliases. It allows you to bookmark your current directory instantly, jump between projects, and keep your alias list clean and organized.

🦘→📂 jump is a lightweight, zero-dependency module for managing directory aliases. It allows you to bookmark your current directory instantly, jump between projects, and keep your alias list clean and organized.

Features

  • Fast Jump: Create aliases like jname to jump to a directory instantly.
  • Auto-Cleaning: The check command removes duplicates and invalid paths (directories that no longer exist).
  • Smart Search: Typing j a shows all aliases starting with ja.
  • Smart Fallback: If you type jar and the alias doesn't exist, it automatically searches for aliases starting with ar.
  • Visual Highlighting: Search terms are highlighted in green in both alias names and paths when showing similar items.
  • Persistence: Aliases are saved to ~/.jump_aliases and loaded automatically.

Installation

1. Install the script

git clone --depth 1 https://github.com/psqlmaster/jump.git && \
cd jump && sudo cp jump /usr/local/bin && sudo chmod +x /usr/local/bin/jump

2. Configure Shell (Safe Append)

Execute the script to add source /usr/local/bin/jump to the end of the .bashrc or .zshrc file:

(
  # Determine which config file to use (prefer .zshrc, fallback to .bashrc)
  RC_FILE="$HOME/.zshrc"
  if [[ ! -f "$RC_FILE" ]]; then
    RC_FILE="$HOME/.bashrc"
  fi
  # Check if the config file actually exists
  if [[ -f "$RC_FILE" ]]; then
    # Check if the line is already present to avoid duplicates
    if ! grep -q "source /usr/local/bin/jump" "$RC_FILE"; then
      echo "" >> "$RC_FILE"
      echo "# jump directory navigation" >> "$RC_FILE"
      echo "source /usr/local/bin/jump" >> "$RC_FILE"
      echo "Success! Added jump to $RC_FILE"
    else
      echo "jump is already installed in $RC_FILE"
    fi
  else
    echo "Error: Could not find .zshrc or .bashrc"
  fi
)

Usage

The main command is j.

Basic Commands

Command Description
j <name> Jump: Instantly switch to the directory associated with j<name>.
j . Where am I?: Shows the alias assigned to the current directory (if it exists).
j a | add <name> Add: Bookmarks the current directory as j<name>.
j r | rm | d | del <name> Remove: Deletes the alias j<name> from the list.
j <text> Search: Searches for aliases that match the specified text.
j l | list List: Shows all saved j aliases in alphabetical order.
j c | check Clean: Removes duplicates and deletes aliases pointing to non-existent folders.
j h | -h Help: Displays the help menu and usage examples.

Navigation & Search

Direct Jump

Once an alias is created (e.g., j a work), simply type the alias name to jump:

Smart Search

If you don't remember the exact name, type j followed by a search term:

# Lists all aliases starting with "wo" (jwork, jworld, etc.)
j wo

Auto-Discovery with Visual Highlighting

If you try to run an alias that doesn't exist, jump will try to find similar ones and highlight the search term in green in both the alias name and path:

# If 'jab' doesn't exist, this will list aliases containing 'ab'
❯ jab
Alias 'jab' not found.
similar items found:
jtab='cd /home/user/repository/arenadata/adb/tables'
  ^^                          ^^   ^^
  (highlighted in green)

The highlighting makes it easy to see why each alias matched your search!

Examples

# 1. Navigate to a project
cd /var/www/html/my-project

# 2. Bookmark it as 'proj'
j a proj
# Output: Added: jproj -> /var/www/html/my-project

# 3. Go somewhere else
cd ~

# 4. Jump back instantly
jproj

# 5. Search for aliases containing "my"
j my
# Output: Matches found (jmy*):
# jmyproject='cd /var/www/html/my-project'
# jmysql='cd /var/lib/mysql'

# 6. Try non-existent alias with auto-discovery
jmissing
# Output: Alias 'jmissing' not found.
# similar items found:
# jmissingfile='cd /tmp/missing'
#    ^^^^^^                        ^^^^^^
#    (search term highlighted in green)

# 7. Clean up old aliases (e.g., after deleting project folders)
j c
# Output: Path not found: /tmp/old_test (removing jtest)
# Output: No errors found. File cleaned.

Tips

  • Use short, memorable alias names for frequently accessed directories
  • Run j c periodically to clean up aliases for deleted directories
  • Use j . to quickly check if you've already created an alias for your current location
  • The search is case-sensitive and matches substrings in both alias names and paths