Install Shell Buddy
Pick whichever route fits your setup. The binary is called sb.
Cargofrom crates.io
$cargo install shell-buddy
HomebrewmacOS and Linux
$brew install hjelev/tap/sb
Prebuilt binaryno Rust toolchain needed
Download a binary or use the installer script from GitHub Releases.
From source
$git clone https://github.com/hjelev/sb.git
$cd sb
$cargo install --path .
Stay in the folder you left
Add this function to ~/.bashrc or ~/.zshrc. When you quit sb, your shell changes to the directory you were last in.
sb() {
"$HOME/.cargo/bin/sb" "$@"
sb_last_path="${XDG_RUNTIME_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}}/sb/last_path"
if [ -f "$sb_last_path" ]
then
cd "$(cat "$sb_last_path")"
rm -i -f "$sb_last_path"
fi
}
Then reload your shell with source ~/.zshrc (or ~/.bashrc).
Optional tools, detected automatically
sb only needs less and an $EDITOR. Everything else is picked up when it's on your PATH, and features that need a missing tool are simply skipped. Press I in sb to see what's installed.
Required
- less
- $EDITOR
Previews and viewers
- bat
- glow
- mmdflux
- jnv
- csvlens
- hexyl
- chafa
- viu
- sox
- pdftotext
- asciinema
- links
Git and editing
- git
- delta
- hexedit
- vidir
Archives and encryption
- zip / unzip
- tar
- 7z
- rar / unrar
- fuse-zip
- archivemount
- age
Search and remotes
- rg
- fzf
- sshfs
- rclone
Terminal and clipboard
- tmux
- zellij
- xclip / wl-copy