Skip to content

PhateValleyman/bm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

bm - Bash Bookmark Manager

A universal, colorful bookmark manager for your terminal. Quickly save and navigate to your favorite directories.

Features

  • 🔖 Save current directory as a bookmark
  • 🗑️ Remove bookmarks
  • 📋 List all bookmarks with current directory highlighting
  • 🚀 Quick navigation to bookmarked directories
  • 🎨 Colorful output
  • 💾 Persistent storage in ~/.config/bm/list
  • ⌨️ Tab completion for bookmark names

Installation

  1. Download the script:
curl -o ~/.bm.sh https://github.com/PhateValleyman/bm/raw/refs/heads/master/bm.sh
  1. Add to your ~/.bashrc:
source ~/.bm.sh
  1. Reload your shell:
source ~/.bashrc

Usage

Add a bookmark

Save the current directory as a bookmark:

bm -a myproject
# Output: [bm] Added myproject → /home/user/projects/myproject

List all bookmarks

Display all saved bookmarks (current directory is highlighted with 📌):

bm -l
# Output:
# === Saved bookmarks ===
# myproject            /home/user/projects/myproject  📌
# downloads            /home/user/Downloads
# documents            /home/user/Documents

Navigate to a bookmark

Go to a bookmarked directory:

bm -g myproject
# or simply:
bm myproject
# Output: Opening: /home/user/projects/myproject

Remove a bookmark

Delete a bookmark:

bm -r myproject
# Output: [bm] Removed bookmark myproject

Show version

Display version information:

bm -v
# Output:
# bm v1.5
# by PhateValleyman
# Jonas.Ned@outlook.com

Show help

Display help message:

bm -h
# or simply:
bm

Commands

Command Alias Description
bm -a <name> bm --add <name> Add current directory as bookmark
bm -r <name> bm --remove <name> Remove bookmark
bm -l bm --list List all bookmarks
bm -g <name> bm --go <name> Go to bookmark
bm -v bm --version Show version information
bm -h bm --help Show help message
bm <name> - Shortcut to go to bookmark

Examples

Basic workflow

# Navigate to a project directory
cd ~/projects/my-awesome-app

# Save it as a bookmark
bm -a awesome
# [bm] Added awesome → /home/user/projects/my-awesome-app

# Go anywhere else
cd /tmp

# Return to your bookmarked directory
bm awesome
# Opening: /home/user/projects/my-awesome-app

# List all bookmarks
bm -l
# === Saved bookmarks ===
# awesome              /home/user/projects/my-awesome-app  📌

Managing multiple bookmarks

# Add multiple bookmarks
cd ~/Downloads && bm -a dl
cd ~/Documents && bm -a docs
cd ~/projects/website && bm -a web
cd ~/.config && bm -a config

# List them all
bm -l
# === Saved bookmarks ===
# config               /home/user/.config  📌
# dl                   /home/user/Downloads
# docs                 /home/user/Documents
# web                  /home/user/projects/website

# Navigate quickly
bm web
bm docs
bm dl

Cleaning up

# Remove a bookmark you no longer need
bm -r oldproject
# [bm] Removed bookmark oldproject

Tab Completion

The script includes bash completion for bookmark names. Just type bm and press Tab to see available options and bookmark names:

bm <Tab><Tab>
# Shows: -a --add -r --remove -l --list -g --go -v --version -h --help awesome dl docs web config

bm -g <Tab><Tab>
# Shows only bookmark names: awesome dl docs web config

Storage

Bookmarks are stored in:

~/.config/bm/list

The file uses bash associative array syntax and can be manually edited if needed.

Requirements

  • Bash 4.0 or higher (for associative arrays)
  • Standard Unix utilities (mkdir, printf, cd)

Author

PhateValleyman

Version

Current version: 1.5


About

Universal, colorful bookmark manager for your terminal.

Resources

Stars

Watchers

Forks

Contributors