broot
Tree view file manager with fuzzy search.
Official WebsiteFeatures
Installation
brew install brootpacman -S brootcargo install brootWhy use broot?
Smart Tree Display
Display directory structure in collapsible tree. Navigate huge directories efficiently, easily understand structure.
Fuzzy Search
Real-time filtering as you type. Search not just filenames but also file contents.
Git Integration
Display Git changes in tree. Easily identify modified files and hide .gitignore files.
Custom Verbs
Define any command as verbs. Freely customize file operations, Git actions, and external tool integration.
Installation
# Homebrew (macOS/Linux)
brew install broot
# Cargo (Rust)
cargo install broot
# Pacman (Arch Linux)
sudo pacman -S broot
# APT (Debian/Ubuntu) - install via snap
sudo snap install broot
# Install shell integration on first launch
broot --installRun broot --install on first launch to install shell integration. This enables the br command.
Screen Layout
broot uses hierarchical tree display. Filter and run commands from the input field at the bottom.
┌─ broot ~/projects/terminal-guide ──────────────────────────────┐ │ │ │ /Users/user/projects/terminal-guide │ │ ├── .git/ [git] │ │ ├── node_modules/ hidden │ │ ├── public/ │ │ ├── src/ │ │ │ ├── app/ │ │ │ ├── components/ │ │ │ │ ├── content/ │ │ │ │ ├── layout/ │ │ │ │ └── ui/ │ │ │ └── lib/ │ │ ├── package.json 15KB 2024-01-20 14:30 │ │ ├── tsconfig.json 2KB 2024-01-15 09:00 │ │ └── README.md 8KB 2024-01-18 16:45 │ │ │ ├────────────────────────────────────────────────────────────────┤ │ /f Filter /c:Content search :cd Change dir │ │ > _ │ └────────────────────────────────────────────────────────────────┘
Basic Operations
| Key | Action |
|---|---|
↑ / ↓ | Move selection up/down |
← / → | Collapse/expand tree |
Enter | Enter directory / Open file |
Alt+Enter | cd to selected directory and exit |
Tab | Open/switch second panel |
Esc | Clear filter / Exit |
Ctrl+Q | Quit |
? | Show help |
Search & Filtering
broot's greatest feature is powerful search and filtering. Just type in the input field to filter instantly.
| Pattern | Description |
|---|---|
foo | Fuzzy search paths containing "foo" |
/foo | Search with regex |
c/pattern | Search file content |
ext:js | Filter by extension |
size>1M | Filter by size (1MB or larger) |
date>2024-01 | Filter by date |
File Operations
File operations are executed by typing : followed by a command (verb).
| Command | Action |
|---|---|
:e or :edit | Open in editor |
:cd | Change to selected directory and exit |
:cp | Copy (when using 2 panels) |
:mv | Move (when using 2 panels) |
:rm | Delete |
:mkdir name | Create directory |
:create name | Create file |
:print_path | Print path and exit |
Configuration & Customization
Configuration file is ~/.config/broot/conf.hjson (or conf.toml).
# ~/.config/broot/conf.hjson or ~/.config/broot/conf.toml
{
# Default flags (show hidden files, show Git info, etc.)
default_flags: "gh"
# Mode settings
modal: false
# Date format
date_time_format: "%Y/%m/%d %H:%M"
# Special path settings
special_paths: {
"~/.config": { show: true }
"node_modules": { show: never }
".git": { show: never }
}
# File size display
show_selection_mark: true
show_matching_characters_on_path_searches: true
# Color settings
syntax_theme: "MochaDark"
}
# Keybindings (verbs)
[[verbs]]
invocation = "edit"
shortcut = "e"
key = "enter"
apply_to = "file"
execution = "$EDITOR {file}"
[[verbs]]
invocation = "create {subpath}"
shortcut = "c"
execution = "touch {directory}/{subpath}"
[[verbs]]
invocation = "mkdir {subpath}"
shortcut = "md"
execution = "mkdir -p {directory}/{subpath}"Defining Custom Verbs
Define custom commands (verbs) to extend functionality.
# ~/.config/broot/conf.hjson - Custom verbs
[[verbs]]
# Show git diff
invocation = "gd"
execution = "git diff {file}"
leave_broot = false
[[verbs]]
# Search with ripgrep
invocation = "rg {args}"
execution = "rg {args}"
[[verbs]]
# Copy (to other panel)
invocation = "cp"
key = "ctrl-c"
execution = "cp -r {file} {other-panel-directory}"
[[verbs]]
# Move (to other panel)
invocation = "mv"
key = "ctrl-x"
execution = "mv {file} {other-panel-directory}"
[[verbs]]
# Move to trash
invocation = "trash"
key = "ctrl-d"
execution = "trash {file}"
leave_broot = falseShell Integration
Using the br command preserves the directory when exiting.
# ~/.bashrc or ~/.zshrc
# broot shell integration (auto-generated by broot --install)
source ~/.config/broot/launcher/bash/br
# When launching broot with the br command,
# the directory is preserved on exit
# Custom alias
alias tree='br -sdp' # Use as directory treeDisplay Flags
Press Space to toggle display options.
Common Flags
g- Show Git infoh- Show hidden filesi- Apply .gitignored- Show dates- Show sizep- Show permissions
Startup Flags
Use br -gh to launch with Git info and hidden files displayed. Change defaults with the default_flags setting.
Tips
Two-Panel Mode
Press Tab to open a second panel for intuitive file copy/move. Use Ctrl+Left/Right to move files between panels.
Disk Usage Check
Use :total_size to calculate directory total size. Use :sort_by_size to sort by size.
Staging (Multiple Selection)
Press Ctrl+G to add files to the stage. Stage multiple files for batch operations.
Preview
Press Ctrl+P to open the preview panel. View text file contents on the spot.