Skip to content

hooneun/highjump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Highjump

🇰🇷 한국어로 보기

Highjump is a fast and intuitive CLI tool for bookmarking directories and navigating between them seamlessly. It provides an interactive fuzzy search interface to jump to your frequently used paths.

Features

  • Bookmark current directory: Easily save your current working directory.
  • Interactive fuzzy search: Find and jump to saved directories using keyboard arrows, typing path names, or selecting index numbers.
  • Persistent storage: Paths are securely saved in ~/.highjump_paths.json.

Installation

1. Build the Rust CLI

First, clone the repository and build the project using Cargo:

git clone https://github.com/hooneun/highjump
cd highjump
cargo build --release

Move the compiled binary to a directory included in your system's PATH:

cp target/release/highjump ~/.cargo/bin/highjump

(Make sure ~/.cargo/bin or your chosen directory is in your $PATH.)

2. Configure Shell Wrapper

Due to the fundamental design of UNIX-like operating systems, a child process (the Rust CLI) cannot change the current working directory of its parent process (the Shell).

To enable the cd functionality, you must add a shell function. Add the following code to your ~/.zshrc or ~/.bashrc:

# Highjump shell wrapper
function hj() {
  if [[ "$1" == -* ]]; then
    highjump "$@"
  else
    local TARGET_DIR=$(highjump "$@")

    if [ -n "$TARGET_DIR" ] && [ -d "$TARGET_DIR" ]; then
      cd "$TARGET_DIR" || return
    fi
  fi
}

~/.config/fish/functions/hj.fish

function hj
    if string match -q -- "-*" $argv[1]
        highjump $argv
    else
        set -l TARGET_DIR (highjump $argv)
  
        if test -n "$TARGET_DIR"; and test -d "$TARGET_DIR"
            cd "$TARGET_DIR"; or return
        end
    end
end

Reload your shell configuration:

source ~/.zshrc  # or source ~/.bashrc

Usage

Use the hj command for all operations.

Save the current directory:

hj --save
# or
hj -s

Jump to a saved directory:

hj

This will open an interactive prompt. You can:

  • Use Up/Down arrow keys to navigate.
  • Type the index number to filter by number.
  • Type part of the directory path to fuzzy search.
  • Press Enter to jump.

View Help:

hj --help

About

Highjump is a fast and intuitive CLI tool for bookmarking directories and navigating between them seamlessly.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages