interactive shell navigation and history

Files
README.md

magdalena #

builds.sr.ht status

A command-line tool for interactive shell navigation and history.

Features #

  • jump back to recent directories and files
  • pick from favourite paths set in your config
  • fuzzy find files and directories under the current directory
  • search file contents and open a match at its line
  • pick a changed file from git status, with a diff preview
  • pick from any list piped to it
  • cache directory walks in memcached, if it is running

Dependencies #

  • Zig 0.17.0
  • memcached (optional)

Building #

zig build -Doptimize=safe

Usage #

magdalena recent-directories
magdalena recent-files
magdalena favorites
magdalena goto-directory
magdalena goto-file
magdalena log-directory <path>
magdalena log-file <path> [type] [action]
magdalena search <query>
magdalena look-file [--depth <n>]
magdalena look-directory [--depth <n>]
magdalena grep [query]
magdalena git-status
magdalena select

Options #

  • -c, --clean: remove duplicate and missing entries from history
  • -h, --help: show this help
  • --choose-file <path>: write the selection to a file instead of opening it

Picker keys #

  • Enter: pick the highlighted item
  • Up or Ctrl+P: move up
  • Down or Ctrl+N: move down
  • Esc, Ctrl+C, Ctrl+D or Ctrl+G: quit without picking
  • Page Down or Page Up: scroll the git-status preview by a page
  • Alt+J or Alt+K: scroll the git-status preview down or up by 3 lines

Examples #

# Show recent directories
magdalena recent-directories

# Search history
magdalena search "myquery"

# Pick a directory up to 3 levels deep
magdalena look-directory --depth 3

# Pick a changed file from git status
magdalena git-status

# Grep with a starting query filled in
magdalena grep "todo"

# Fuzzy pick from any piped list
git ls-files | magdalena select

# Write the pick to a file instead of opening it, for use inside an editor
magdalena --choose-file /tmp/pick look-file