bmrk 0.4.0

A fast TUI for directory navigation and bookmark management
# Features

Complete overview of all bmrk features.

## Compact Inline Mode

bmrk runs inline in the terminal stream — it does not take over the screen.

**No alternate screen**: Your scroll history is preserved and the terminal returns
to its exact pre-launch state on exit, with no artifacts.

**8 rows**: One header row and up to 7 tree rows. The header shows the currently selected
item's full path by default (configurable via `show_cursor_path`), plus key hints — and briefly
shows feedback after a "copy path" action or a navigation error.

**Shell wrapper**: The `bm` wrapper captures the selected path from stdout and calls
`cd` on your behalf — the same approach used by `fzf`, `zoxide`, and `autojump`.

## Interactive Tree Navigation

Visual directory tree with vim-style navigation.

**Key bindings**: `j`/`k` (up/down), `l` (expand), `h` (collapse/parent), `Enter` (change root), `u` (parent), `Backspace` (go back), `c` (copy selected path to clipboard)

**Features**:
- Lazy loading of directory contents (loaded only when expanded)
- Inaccessible directories shown with `` icon in `error_color` (detected eagerly when parent expands, not only after trying to enter)
- Configurable hidden file visibility (`show_hidden` in config)
- Symlink support with cycle detection (`follow_symlinks` in config)
- Navigation history with undo (`u`) — up to 50 entries
- Header shows the selected item's full path by default (`show_cursor_path` in config)

## Quick Jump

Type-ahead jump to any folder under the current root — no results list, just type and land.

**Key binding**: `Tab` (activate, only when no search results panel is open), type a folder
name, `Shift+Tab` (cycle to the next match), `Esc` (cancel — restores the tree exactly to its
pre-`Tab` state), `Tab`/`Enter`/an arrow key (confirm — keeps the selection and any
auto-expanded folders)

**Matching**: case-insensitive **prefix** match on folder name, shallowest match wins the
initial jump — every match found (up to 20) is kept for `Shift+Tab` cycling.

**Source**: already-loaded folders (instant) → the background directory index (instant) → a
live background disk scan, in that order — the first source to find a match wins, and results
from all three are merged so a deep match from the index is never hidden by a shallower one
that happens to already be loaded in memory.

**Narrowing scope**: press `/` once a folder is matched to lock the search to that folder's
subtree and physically expand it — e.g. type `src`, press `/`, type `compon` to reach
`src/components` without risking a match from elsewhere in the tree. The buffer keeps growing
into a path breadcrumb (`src` → `src/` → `src/compon`) instead of clearing. `Backspace` right at
a `/` boundary undoes the segment — pops back to the previous scope and re-collapses the folder,
unless it was already expanded before `Tab` was pressed. `Esc` still cancels the entire session
regardless of how many times `/` was pressed.

## Search Functionality

Fast, asynchronous search across the entire directory tree.

**Key binding**: `/` (enter search), `Enter` (execute), `Tab` (focus toggle), `q` (exit+cd)

**Search scope**: Folder **and file** names — not full paths, not content. The tree itself stays
directory-only, so selecting a file result jumps to its containing folder instead.

**Features**:
- Two-phase search: quick (already-loaded nodes, instant) + deep (background thread, full tree) —
  plus a synchronous pass over the background directory index for directory matches, between the
  two
- Normal mode: case-insensitive substring matching
- Fuzzy mode: intelligent matching with scoring (activate by starting query with `/`)
- Non-blocking UI during background search
- Live progress: "Scanned: N directories"
- Directory and file results capped independently (500 / 200) so a broad query's file matches
  can't crowd out directory matches

**Results navigation**: `j`/`k` to navigate, `Enter` to jump to result in tree, `q` to exit and cd there.

## Background Directory Index

A background-built, persisted index of directory paths that both `Tab` (quick jump) and `/`
(search) consult as a fast synchronous lookup, before falling back to a live disk scan.

**Features**:
- Directories only, rooted at the user's home directory by default (`index.roots` in config)
- Built once per app launch if the on-disk cache (`~/.config/bmrk/dir_index.txt`) is missing or
  older than `index.refresh_hours` (default 24) — runs fully in the background, never blocks the UI
- Skips configured directory names entirely while building (`index.ignore_dirs` — defaults include
  `node_modules`, `.git`, `target`, `.cache`, `.cargo`, `.rustup`, and more)
- Never regresses a case that worked before — anywhere the index doesn't cover, `Tab`/`/` fall
  back to exactly the same live scan behavior as if the index didn't exist
- A pure performance cache, not user data — delete `dir_index.txt` to force an immediate rebuild,
  or set `index.enabled = false` to disable it entirely

## Bookmarks System

Save favorite directories and jump to them instantly.

**Key bindings**: `m` (create), `'` (select menu), `bm myproject` (CLI jump)

**Features**:
- Multi-character names (e.g., `webapp-backend`)
- Interactive creation with existing bookmarks list shown while typing
- Dual-mode selection (navigation + filter — `Tab` to switch)
- CLI management: `bm -l`, `bm -a <name>`, `bm -d <name>`
- Direct navigation from command line — no TUI required
- Persistent storage in JSON
- Safe two-phase deletion (press `d` twice to confirm)
- `q` exits bmrk and cds to the selected bookmark

## Disk/Drive Selection

Browse and switch between all available drives and mount points.

**Key binding**: `d` (open panel)

**Features**:
- Lists all drives (Windows: `C:\`, `D:\`) and mount points (Linux/macOS: `/`, `/home`, `/mnt/usb`)
- Shows filesystem type, free space, and total capacity
- Pre-selects the disk containing the current root path
- Navigate with `j`/`k`, `Enter` to switch to selected disk root, `q` to exit and cd there, `Esc` to close

**Note**: `d` is context-sensitive — in tree mode it opens the disk panel; inside bookmark selection it marks the selected bookmark for deletion.

## Mouse Support

Mouse works in all interactive panels — tree, bookmark selection, and disk selection.

**Features**:
- Click to select the item under the cursor
- Double-click to expand/collapse directories (tree), navigate to bookmark, or navigate to disk root
- Scroll wheel to navigate the active list
- **Minimal scroll**: the view only shifts when the selection leaves the visible area, so a
  single click followed by a double-click always lands on the same row

## Configuration System

TOML configuration file, auto-created on first run.

**File location**:
- Linux/macOS: `~/.config/bmrk/config.toml`
- Windows: `%APPDATA%\bmrk\config.toml`

**Sections**:
- `[appearance]` — theme, colors, icon style, max name length, header cursor path display
- `[behavior]` — show hidden files, follow symlinks, mouse timing
- `[keybindings]` — customize keyboard shortcuts, including `copy_path` (clipboard)
- `[index]` — background directory index (roots, ignore list, refresh interval)

See [Configuration](./configuration.md) for the full reference.

## Shell Integration

**Features**:
- `bm` wrapper function for automatic `cd`
- Direct navigation: `bm /path` or `bm bookmark`
- Return to previous directory: `bm -`
- Bookmark management from CLI: `bm -l`, `bm -a`, `bm -d`
- Clean separation of TUI output (stderr) and path output (stdout)

See [Installation](./installation.md) for wrapper setup instructions.