interactive shell navigation and history
- Rust 81.9%
- Shell 18.1%
|
|
||
|---|---|---|
| .woodpecker | ||
| db | ||
| docs | ||
| shell | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
magnolia 
Interactive shell navigation and history based on fzf and sqlite.
Motivation
My workflow resembles a squirrel trying to hide a hazelnut so I have declared bankruptcy on my mind and making this made sense.
Usage
Installation
# Install dependencies
sudo pacman -Sy fd fzf rustup sqlite3 --needed
# If you use Homebrew
brew install fd fzf rustup sqlite3
# Install Rust toolchain
rustup install stable
# Set default toolchain to stable
rustup default stable
# Build
cargo build --release
# Initialize database
./db/init
# Source shell integration
source ./shell/magnolia
Usage
magnolia [--db-path <path>] [--no-color] <command> [limit]
Commands
recent-dirs [500]- Recent directory visitsrecent-files [500]- Recent file openschange-to-dir [1000]- Interactive recent file openschange-to-file [1000]- Interactive recent file opensfrequent-dirs [500]- Most visited directoriessearch <query>- Search history
Shell Functions
d- Fuzzy navigate to directoryf- Fuzzy open filecd- Navigate to directoryrd- Interactive recent directoriesrf- Interactive recent filesdg- Recent directories in fzffg- Recent files in fzf, open in vim
File Handling
The f() function opens files based on extension:
- audio
mpv - video
mpv - other
vim
Examples
# Navigate to directory
d
# Open recent file
f
# Interactively navigate to recent directory
dg
# Interactively open recent file (if you frequently use `fg`, consider a different function name)
fg
# Show frequently visited directories
magnolia frequent-dirs 10
# Search for rust files
magnolia search rust
# Interactively change to dir
magnolia change-to-dir
# Interactively change to file
magnolia change-to-file
Database
SQLite database with two tables:
directory_history- path, timestampfile_history- path, file_type, action, timestamp
Default location: ~/.magnolia.db (configurable with --db-path)