Skip to content

lezhou8/nav

Repository files navigation

nav

About

Minimal terminal file manager/navigator

Features

screenshot filter yank

Minimalism

Nav does not perform operations such as deleting files (rm), previewing files (cat), etc and does not provide an emulator for a command-line interface. These operations are better left for the user's existing command-line to handle. These operations can be done quickly with the copy selections to environmental variable or clipboard feature.

select_demo

Nav does, however, allow copying and pasting/moving around files because that would be inconvenient using the above method.

For multiple selections you may have to do this:

echo $N | xargs cat # replace cat with program of your choice

Installation

go install github.com/lezhou8/nav@latest

Key binds

Key Description
hjkl or arrow keys Basic navigation
g, G Go to top or bottom
~ Go to home directory
. Toggle hidden files
/ Filter search
esc Exit filter search
enter Accept filter search
space Select
y Copy/yank
d Cut
p Paste
q Quit

cd on exit and copy file selections to environmental variable

Zsh/Bash

# Call this function whatever you like
# Add to .zshrc, .bashrc, or equivalent

navcd() {
	nav "$@"
	cd "$(cat "${XDG_CACHE_HOME:=${HOME}/.cache}/nav/.nav_d")" # this line allows cd on exit
	export N="$(cat "${XDG_CACHE_HOME:=${HOME}/.cache}/nav/.nav_env")" # this line saves file selection to $N
}
# You can bind it to a key

bindkey -s "^n" "navcd\n"

Built with

Dependencies

Acknowledgement