Skip to content
/ nav Public

Terminal navigator for interactive ls workflows.

License

Notifications You must be signed in to change notification settings

dkaslovsky/nav

Repository files navigation

nav

Terminal navigator for interactive ls workflows.

alt text


Overview

nav is a terminal filesystem explorer built for interactive ls workflows. It can be used as a standalone TUI or in bash/zsh functions such as

# interactive ls + cd
function nv {
	cd "$(nav --pipe "$@")"
}
# interactive ls + clipboard
function nvcp {
	nav --pipe "$@" | pbcopy
}
# interactive ls + multi cat
function nvcat {
	nav --pipe "$@" | xargs cat
}

nav is intended to be an interactive replacement for ls and currently supports some of the most common ls options:

long list with full details

ls -l

nav --list / nav -l

show hidden files

ls -a

nav --hidden / nav -a

follow symlinks

nav --follow / nav -f

These options are available as interactive toggles and can also be invoked on start with the appropriate command line flag (see below).

Human readable file sizes (ls -lh), color output (ls --color), and a custom sort order are on by default and cannot currently be configured.

In the future, nav might support a wider range of ls options and configuration.


Full list of commands

Arrow keys are used to move the cursor.
Vim navigation is available using "h" (left), "j" (down) "k" (up), and "l" (right).

"enter":       navigates into the directory or returns the
               path to the entry under the cursor
"backspace":   navigates back to the previous directory

"ctrl+x":      returns the path(s) to the current entry or all marked entries
"ctrl+d":      returns the path to the current directory

"i":           enters search mode (insert into the path)
"d":           enters debug mode  (view error details)
"H":           enters help mode
"esc":         switches back to normal mode or clears search filter in normal mode

"ctrl+v":      (un)marks an entry for multiselect return
"ctrl+a":      (un)marks all entries for multiselect return

"a":           toggles showing hidden files (ls -a)
"L":           toggles listing full file information (ls -l)
"f":           toggles following symlinks

"e":           dismisses errors
"ctrl+c":      quits the application with no return value

Command line flags

--help, -h, -H:           display help
--version, -v:            display version

--search, -s:             start in search mode

--pipe:                   return output suitable for pipe and subshell usage

--follow, -f:             toggle on following symlinks at startup
--hidden, -a:             toggle on showing hidden files at startup
--list, -l:               toggle on list mode at startup

--no-color:               toggle off color output
--no-status-bar:          toggle off bottom status bar menu
--no-trailing:            toggle off trailing annotators

--remap-esc:              remap the escape key to the following value, using
                          repeated values to require multiple presses

Installation

The recommended installation method is downloading the latest released binary. Download the appropriate binary for your operating system and architecture from this repository's releases page or via curl:

macOS / amd64

curl -o nav -L https://github.com/dkaslovsky/nav/releases/latest/download/nav_darwin_amd64

macOS / arm64

curl -o nav -L https://github.com/dkaslovsky/nav/releases/latest/download/nav_darwin_arm64

Linux / amd64

curl -o nav -L https://github.com/dkaslovsky/nav/releases/latest/download/nav_linux_amd64

Linux / arm64

curl -o nav -L https://github.com/dkaslovsky/nav/releases/latest/download/nav_linux_arm64

Windows

curl.exe -o nav.exe -L https://github.com/dkaslovsky/nav/releases/latest/download/nav_windows_amd64.exe

License

nav is released under the MIT License. Dependency licenses are available in this repository's CREDITS file.


Acknowledgements

nav was originally inspired by the excellent https://github.com/antonmedv/walk tool but has deviated significantly and has been written from the ground up to support the current feature set.