NNN(1)

NAME
nnn - the missing terminal file manager for X

SYNOPSIS
nnn [-a] [-b key] [-c] [-d] [-e name] [-E] [-f] [-H] [-i] [-K] [-n] [-p file] [-r] [-R] [-s] [-S] [-v] [-h] [PATH]

DESCRIPTION
nnn (Nnn's Not Noice) is a performance-optimized, feature-packed fork of noice (http://git.2f30.org/noice/) with seamless desktop integration, simplified navigation, navigate-as-you-type mode with auto select, disk usage analyzer mode, bookmarks, contexts, application launcher, familiar navigation shortcuts, subshell spawning and much more. It remains a simple and efficient file manager that stays out of your way.

nnn opens the current working directory by default if PATH is not specified.

KEYBINDS

Press ? in nnn to see the list of keybinds.

OPTIONS

nnn supports the following options:

-a use access time for all operations (default: modification time)

-b key specify bookmark key to open

-c opener opens files in cli utilities only

-d detail mode

-e name load a session by name

-E use $EDITOR for internal undetached edits

-f run filter as command when the prompt key is pressed

-H show hidden files

-i start in navigate-as-you-type mode

-K test for keybind collision

-n use case-insensitive version compare to sort files

-o open files only on Enter key

-p file copy (or pick) selection to file, or stdout if file='-'

-r show cp, mv progress (Linux-only, needs advcpmv; '^T' shows the progress on BSD/macOS)

-R disable rollover at edges

-s use substring match for filters instead of regex

-S start in disk usage analyzer mode

-t disable directory auto-select in navigate-as-you-type mode

-v show version and exit

-h show program help and exit

CONFIGURATION
nnn uses xdg-open (on Linux) and open(1) (on macOS) as the desktop opener.

There is no configuration file. Associated files are stored in ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/. Settings work on environment variables. See ENVIRONMENT section below.

CONTEXTS
Contexts serve the purpose of exploring multiple directories simultaneously. 4 contexts are available. The status of the contexts are shown in the top left corner:

- the current context is in reverse video
- other active contexts are underlined
- rest are inactive

On context creation, the state of the previous context is copied. Each context remembers its last visited directory.

Each context can have its own directory color specified. See ENVIRONMENT section below.

SESSIONS
Sessions are a way to save and restore states of work. A session stores the settings and contexts.

Sessions can be loaded dynamically from within a running nnn instance, or with a program option.

When a session is loaded dynamically, the last working session is saved automatically to a dedicated -- "last session" -- session file.

All the session files are located in the ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions directory by the session name. "@" is the "last session" file.

FILTERS
Filters support regexes (default) to instantly (search-as-you-type) list the matching entries in the current directory.

Common use cases:

(1) To list all matches starting with the filter expression, start the expression with a '^' (caret) symbol.
(2) Type '\.mkv' to list all MKV files.
(3) Use '.*' to match any character (sort of fuzzy search).

There is a program option to filter entries by substring match instead of regex.

There is a program option to execute the current filter as a command when the prompt key is pressed.

In the navigate-as-you-type mode directories are opened in filter mode, allowing continuous navigation. Works best with the arrow keys.
When there's a unique match and it's a directory, nnn auto selects the directory and enters it in this mode.

SELECTION
There are 3 groups of shortcuts to add files to selection:

(1) hovered file selection toggle (deselects if '+' is visible before the entry, else adds to selection)
(2) add a range of files to selection
(3) add all files in the current directory to selection

The selection can now be listed, copied, moved, removed, archived or linked.

Absolute paths of the selected files are copied to the temporary file .selection in the config directory. The path is shown in the help and configuration screen. If $NNN_COPIER is set (see ENVIRONMENT section below) the file paths are also copied to the system clipboard.

To flush the selection without running any operation use the _edit, flush selection_ key. The list is flushed even if unchanged. Use this key to remove a file from selection after you navigate away from its directory. Flushing doesn't end the selection mode. You can add more files to the selection and edit/flush the list again. Flushing doesn't end the selection mode. You can add more files to the selection and edit/flush the list again.

Repeat range selection on the same entry twice to clear selection completely.

FILE SIZE
The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y (powers of 1024), same as the default units in ls.

ENVIRONMENT
The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables take precedence when dealing with the !, e and p commands respectively. A single combination to arguments is supported for SHELL and PAGER.

NNN_BMS: bookmark string as key_char:location pairs (max 10) separated by ;:

        export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
        NOTE: To go to a bookmark, press the Lead key followed by the bookmark key.

NNN_PLUG: directly executable plugins as key_char:location pairs (max 10) separated by ;:

        export NNN_PLUG='o:fzopen;p:mocplay;d:diffs;m:nmount;t:imgthumb;i:mediainf'
        NOTE: To run a plugin directly, press : followed by the plugin key.

To assign keys to arbitrary non-background non-shell-interpreted cli commands and invoke like plugins, add _ (underscore) before the command.

        export NNN_PLUG='x:_chmod +x $nnn;g:_git log;s:_smplayer $nnn;o:fzopen;m:nmount'
        NOTES:
        1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
        2. $nnn should be the last argument (IF you want to pass the hovered file name)
        3. (Again) add _ before the command

NNN_USE_EDITOR: use VISUAL (else EDITOR, preferably CLI, fallback vi) to handle text files.

        export NNN_USE_EDITOR=1

NNN_CONTEXT_COLORS: string of color codes for each context, e.g.:

        export NNN_CONTEXT_COLORS='1234'
        codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white

NNN_SSHFS_OPTS: pass additional options to sshfs command:

        export NNN_SSHFS_OPTS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
        NOTE: The options must be preceded by `sshfs` and comma-separated without any space between them.

NNN_RCLONE_OPTS: pass additional options to rclone command:

        export NNN_RCLONE_OPTS='rclone mount --read-only --no-checksum'
        NOTE: The options must be preceded by `rclone` and max 5 flags are supported.

NNN_OPENER: specify a custom file opener.

        export NNN_OPENER=mimeopen

NNN_IDLE_TIMEOUT: set idle timeout (in seconds) to invoke terminal locker (default: disabled).

NNN_COPIER: system clipboard copier script. The project page has some sample copier scripts.

NNN_TRASH: trash (instead of delete) files to desktop Trash.

        export NNN_TRASH=1

NNN: this is a special variable set to the current entry before executing a command from the command prompt or spawning a shell.

KNOWN ISSUES
nnn may not handle keypresses correctly when used with tmux (see issue #104 for more details). Set TERM=xterm-256color to address it.

AUTHORS
Arun Prakash Jana <engineerarun@gmail.com>, Lazaros Koromilas <lostd@2f30.org>, Dimitris Papastamos <sin@2f30.org>.

HOME
https://github.com/jarun/nnn