6 .Nd The unorthodox terminal file manager.
9 .Op Ar -aAcCdDeEfgHJKnQrRSuUVxh
22 is a performance-optimized, feature-packed fork of noice
23 .Em http://git.2f30.org/noice/
24 with seamless desktop integration, simplified navigation,
26 mode with dir auto-enter, disk usage analyzer mode, bookmarks,
27 contexts, application launcher, familiar navigation shortcuts,
28 subshell spawning and much more. It remains a simple and
29 efficient file manager that stays out of your way.
32 opens the current working directory by default if
41 to see the list of keybinds.
45 supports the following options:
48 auto-setup temporary NNN_FIFO (described in ENVIRONMENT section)
51 disable directory auto-enter on unique filter match
54 specify bookmark key to open
57 indicates that the opener is a cli-only opener (overrides -e)
60 8-color scheme - color directories by context, disable file colors
66 show directories in context color with \fBNNN_FCOLORS\fR set
69 open text files in $VISUAL (else $EDITOR, fallback vi) [preferably CLI]
72 use $EDITOR for internal undetached edits
75 use readline history file
78 fifo notification mode
79 0: notify as previewer, 1: notify as explorer
82 use regex filters instead of substring match
88 show current file information in info bar (may be slow)
91 disable auto-advance on selection
92 (eg. selecting an entry will no longer move cursor to the next entry)
95 test for keybind collision
98 number of lines to move per mouse wheel scroll
101 start in type-to-nav mode
104 open files only on Enter key
107 copy (or \fIpick\fR) selection to file, or stdout if file='-'
110 specify plugin key to run
113 disable confirmation on quit with multiple contexts active
117 (Linux-only, needs \fIadvcpmv\fR; '^T' shows the progress on BSD/macOS)
120 disable rollover at edges (eg. pressing \fIdown\fR while on the last
121 entry will no longer move cursor to the first entry and vice\-versa)
124 load a session by name
130 idle timeout in seconds to lock terminal
134 keys: 'a'u / 'd'u / 'e'xtension / 'r'everse / 's'ize / 't'ime / 'v'ersion
135 capitalize to reverse (except 'r')
138 use selection if available, don't prompt to choose between selection and hovered entry
141 show user and group names in status bar
144 show version and exit
147 show notifications on selection cp, mv, rm completion (requires \fI.ntfy\fR plugin)
148 copy path to system clipboard on selection (requires \fI.cbcp\fR plugin)
149 show xterm title (if non-picker mode)
152 show program help and exit
154 There is no configuration file. Associated files are at
156 .Pa ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
158 Configuration is done using a few optional (set if you need) environment
159 variables. See ENVIRONMENT section.
162 uses \fIxdg-open\fR (on Linux), \fIopen(1)\fR (on macOS), \fIcygstart\fR on
163 (Cygwin) and \fIopen\fR on (Haiku) as the desktop opener. It's also possible
164 to specify a custom opener. See ENVIRONMENT section.
166 Open multiple locations with 4 contexts. The status is shown in the top left
169 - the current context is in reverse video
171 - other active contexts are underlined
175 A new context copies the state of the previous context. Each context can have
176 its own color. See ENVIRONMENT section.
178 Sessions are a way to save and restore states of work. A session stores the
179 settings and contexts. Sessions can be loaded at runtime or with a program
182 - When a session is loaded at runtime, the last working state is saved
183 automatically to a dedicated "auto session" session file. Session option
184 \fIrestore\fR would restore the "auto session".
186 - The persistent session option is global. If it is used, the last active session
187 will be updated with the final state at program quit.
189 - The "auto session" is used in persistent session mode if no session is active.
191 - Listing input stream and opening a bookmark by key have a higher priority to
192 session options (-s/-S).
194 All the session files are located by session name in the directory
196 \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR
198 "@" is the "auto session" file.
200 Filters are strings (or regex patterns) to find matching entries in the current
201 directory instantly (\fIsearch-as-you-type\fR). Matches are case-insensitive by
202 default. The last filter in each context is persisted at runtime or in saved
205 When there's a unique match and it's a directory,
207 auto enters the directory. Use the relevant program option to disable this.
209 Special keys at filter prompt:
211 -------- + ---------------------------------------
213 -------- + ---------------------------------------
214 ^char | Usual keybind functionality
215 Esc | Exit filter prompt but skip dir refresh
216 Alt+Esc | Exit filter prompt and refresh dir
217 -------- + ---------------------------------------
220 Special keys at \fBempty filter prompt\fR:
222 ------ + ---------------------------------------
224 ------ + ---------------------------------------
225 ? | Show help and config screen
226 / | Toggle between string and regex
227 : | Toggle case-sensitivity
228 ^L | Clear filter (\fIif prompt is non-empty\fR)
229 | OR apply last filter
230 Bksp | Stay at filter prompt and refresh dir
231 Del | Stay at filter prompt and refresh dir
232 ------ + ---------------------------------------
235 Common regex use cases:
237 (1) To list all matches starting with the filter expression,
238 start the expression with a '^' (caret) symbol.
240 (2) Type '\\.mkv' to list all MKV files.
242 (3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
244 (4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
246 In the \fBtype-to-nav\fR mode directories are opened in filter
247 mode, allowing continuous navigation.
249 Additional special keys at \fBempty filter prompt\fR
250 in \fBtype-to-nav\fR mode:
252 ------ + ------------------------
254 ------ + ------------------------
255 ' | Go to first non-dir file
256 + | Toggle file selection
258 - | Go to last visited dir
259 . | Show hidden files
260 ; | Run a plugin by its key
261 = | Launch a GUI application
264 ] | Show command prompt
267 ------ + ------------------------
271 allows file selection across directories and contexts!
273 There are 3 groups of keybinds to add files to selection:
275 (1) hovered file selection toggle
276 - deselects if '+' is visible before the entry, else adds to selection
278 (2) add a range of files to selection
279 - repeat the range key on the same entry twice to clear selection completely
281 (3) add all files in the current directory to selection
283 A selection can be edited, copied, moved, removed, archived or linked.
285 Absolute paths of the selected files are copied to \fB.selection\fR file in
286 the config directory. The selection file is shared between multiple program
287 instances. Selection from multiple instances are not merged. The last instance
288 writing to the file overwrites earlier contents. If you have 2 instances of
290 \fIopen\fR in 2 panes of a terminal multiplexer, you can select in one pane and
291 use the selection in the other pane. The selection gets cleared in the
293 instance where the selection was made on mv/rm (but not on cp).
296 clears the selection after a successful operation with the selection. Plugins
297 are allowed to define the behaviour individually.
299 To edit the selection use the _edit selection_ key. Editing doesn't end the
300 selection mode. You can add more files to the selection and edit the list
301 again. If no file is selected in the current session, this option attempts
302 to list the selection file.
304 There are two ways to search and list:
306 - feed a list of file paths as input
308 - search using a plugin (e.g. \fIfinder\fR) and list the results
310 File paths must be NUL-separated ('\\0'). Paths and can be relative to the
311 current directory or absolute. Invalid paths in the input are ignored. Input
312 limit is 65,536 paths or 256 MiB of data.
314 To list the input stream, start
316 by writing to its standard input. E.g., to list files in current
317 directory larger than
320 find -maxdepth 1 -size +1M -print0 | nnn
323 or redirect a list from a file:
328 Handy bash/zsh shell function to list files by mime-type in current directory:
330 # to show video files, run: list video
334 find . -maxdepth 1 | file -if- | grep "$1" | awk -F: '{printf "%s\0", $1}' | nnn
338 A temporary directory will be created containing symlinks to the given
339 paths. Any action performed on these symlinks will be performed only on their
340 targets, after which they might become invalid.
342 Right arrow or 'l' on a symlink in the listing dir takes to the target
343 file. Press '-' to return to the listing dir. Press 'Enter' to open the symlink.
345 Listing input stream can be scripted. It can be extended to pick (option -p)
346 selected entries from the listed results.
348 There are 2 ways (can be used together) to manage bookmarks.
350 (1) Bookmark keys: See \fINNN_BMS\fR under \fIENVIORNMENT\fR section on how to set
353 The select bookmark key \fIb\fR lists all the bookmark keys set in \fINNN_BMS\fR
354 in the bookmarks prompt.
356 (2) Symlinked bookmarks: A symlinked bookmark to the current directory can
357 be created with the \fIB\fR key (or manually under ~/.config/nnn/bookmarks).
359 Pressing 'Enter' at the bookmarks prompt takes to this directory.
360 If \fINNN_BMS\fR is not set, the select bookmark key directly opens it.
362 On entering a bookmark, the directory where the select bookmark key was
363 pressed is set as the previous directory. Press '-' to return to it.
366 The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y
367 (powers of 1024), same as the default units in \fIls\fR.
369 The SHELL, VISUAL (else EDITOR) and PAGER environment variables are
370 used. A single combination of arguments is supported for SHELL and PAGER.
372 \fBNNN_OPTS:\fR binary options to
375 export NNN_OPTS="cEnrx"
378 \fBNNN_OPENER:\fR specify a custom file opener.
380 export NNN_OPENER=nuke
382 NOTE: 'nuke' is a file opener available in the plugin repository.
385 \fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs
386 separated by \fI;\fR:
388 export NNN_BMS="d:$HOME/Docs;u:/home/user/Cam Uploads;D:$HOME/Downloads/"
391 These bookmarks are listed in the help and config screen (key ?).
393 \fBNNN_PLUG:\fR directly executable plugins as \fIkey_char:plugin\fR pairs
394 separated by \fI;\fR:
396 export NNN_PLUG='f:finder;o:fzopen;p:mocplay;d:diffs;t:nmount;v:imgview'
399 1. To run a plugin directly, press \fI;\fR followed by the key.
400 2. Alternatively, combine with \fIAlt\fR (i.e. \fIAlt+key\fR).
401 3. To skip directory refresh after running a plugin, prefix with \fB-\fR.
403 export NNN_PLUG='p:-plugin'
406 To assign keys to arbitrary non-background cli commands and invoke like
407 plugins, add \fI!\fR before the command.
409 export NNN_PLUG='x:!chmod +x $nnn;g:!git log;s:!smplayer $nnn'
411 To pick and run an unassigned plugin, press \fBEnter\fR at the plugin prompt.
412 To run a plugin at startup, use the option `-P` followed by the plugin key.
415 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
416 2. $nnn must be the last argument (if used) to run a \fIcommand as plugin\fR
417 3. (Again) add \fB!\fR before the command
418 4. To disable directory refresh after running a \fIcommand as plugin\fR,
420 5. To skip user confirmation after command execution, suffix with \fB*\fR
421 Note: Do not use \fB*\fR with programs those run and exit e.g. cat
423 export NNN_PLUG='y:-!sync*'
425 6. To run a \fIGUI app as plugin\fR, add a \fB&\fR after \fB!\fR
426 Note: \fI$nnn\fR must be the last argument in this case.
428 export NNN_PLUG='m:-!&mousepad $nnn'
430 7. To show the output of run-and-exit commands which do not need user input,
431 add \fB|\fR (pipe) after \fB!\fR
432 Note: This option is incompatible with \fB&\fR (terminal output is masked
433 for GUI programs) and ignores \fB*\fR (output is already paged for user)
435 export NNN_PLUG='m:-!|mediainfo $nnn;t:-!|tree -ps;l:-!|ls -lah --group-directories-first'
438 ------------------------------------ + -------------------------------------------------
439 Key:Command | Description
440 ------------------------------------ + -------------------------------------------------
441 c:!convert $nnn png:- | xclip -sel \ | Copy image to clipboard
442 clipboard -t image/png* |
443 e:-!sudo -E vim $nnn* | Edit file as root in vim
444 g:-!git diff | Show git diff
445 h:-!hx $nnn* | Open hovered file in hx hex editor
446 k:-!fuser -kiv $nnn* | Interactively kill process(es) using hovered file
447 l:-!git log | Show git log
448 n:-!vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
449 p:-!less -iR $nnn* | Page through hovered file in less
450 s:-!&smplayer -minigui $nnn | Play hovered media file, even unfinished download
451 x:!chmod +x $nnn | Make the hovered file executable
452 y:-!sync* | Flush cached writes
453 ------------------------------------ + -------------------------------------------------
455 Online docs: https://github.com/jarun/nnn/tree/master/plugins
458 \fBNNN_ORDER:\fR directory-specific sort key.
460 export NNN_ORDER='t:/home/user/Downloads;S:/tmp'
462 NOTE: Sort keys can be a/d/e/r/s/t/v (see program option -T).
463 Capitalize to reverse (except 'r').
464 Path must be absolute.
466 Timestamps for entries modified/created within 5 minutes are shown in reverse.
469 \fBNNN_COLORS:\fR string of color numbers for each context, e.g.:
472 # 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
473 export NNN_COLORS='1234'
475 # xterm 256 color numbers (converted to hex, 2 symbols per context):
476 # see https://user-images.githubusercontent.com/1482942/93023823-46a6ba80-f5e1-11ea-9ea3-6a3c757704f4.png
477 export NNN_COLORS='#0a1b2c3d'
479 # both (256 followed by 8 as fallback, separated by ';')
480 export NNN_COLORS='#0a1b2c3d;1234'
482 NOTE: If only 256 colors are specified and the terminal doesn't support, default is used.
485 \fBNNN_FCOLORS:\fR specify file-type specific colors:
487 export NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
489 Specify file-specific colors in xterm 256 color hex numbers (2 symbols per color).
490 Order is strict, use 00 to omit/use default terminal color. Defaults:
492 ------------------------- + --- + -------------
494 ------------------------- + --- + -------------
495 Block device | c1 | DarkSeaGreen1
496 Char device | e2 | Yellow1
497 Directory | 27 | DeepSkyBlue1
498 Executable | 2e | Green1
499 Regular | 00 | Normal
500 Hard link | 60 | Plum4
501 Symbolic link | 33 | Cyan1
502 Missing OR file details | f7 | Grey62
503 Orphaned symbolic link | c6 | DeepPink1
505 Socket | ab | MediumOrchid1
506 Unknown OR 0B regular/exe | c4 | Red1
507 ------------------------- + --- + -------------
509 If the terminal supports xterm 256 colors or more, file-specific colors will be rendered.
510 To force the 8-color scheme use option -C.
511 If xterm 256 colors aren't supported, 8-color scheme will be used.
514 \fBNNN_ARCHIVE:\fR archive extensions to be handled silently (default: bzip2, (g)zip, tar).
516 export NNN_ARCHIVE="\\\\.(7z|bz2|gz|tar|tgz|zip)$"
518 NOTE: Non-default formats may require a third-party utility.
521 \fBNNN_SSHFS:\fR specify custom sshfs command with options:
523 export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
525 NOTE: The options must be comma-separated without any space between them.
528 \fBNNN_RCLONE:\fR pass additional options to rclone command:
530 export NNN_RCLONE='rclone mount --read-only --no-checksum'
532 NOTE: The options must be preceded by "rclone" and max 5 flags are supported.
535 \fBNNN_TRASH:\fR trash (instead of \fIrm -rf\fR) files to desktop Trash.
538 # n=1: trash-cli, n=2: gio trash
541 \fBNNN_SEL:\fR absolute path to custom selection file.
543 \fBNNN_FIFO:\fR path of a named pipe to write the hovered file path:
545 export NNN_FIFO='/tmp/nnn.fifo'
548 1. Overridden by a temporary path with -a option.
549 2. If the FIFO file doesn't exist it will be created,
550 but not removed (unless it is generated by -a option).
552 Online docs: https://github.com/jarun/nnn/wiki/Live-previews
555 \fBNNN_LOCKER:\fR terminal locker program.
557 export NNN_LOCKER='bmon -p wlp1s0'
558 export NNN_LOCKER='cmatrix'
561 \fBNNN_TMPFILE:\fR \fIalways\fR cd on quit and write the command in the file specified.
563 export NNN_TMPFILE='/tmp/.lastd'
566 \fBNNN_HELP:\fR run a program and show the output on top of the program help page.
568 export NNN_HELP='fortune'
571 \fBNNN_MCLICK:\fR key emulated by a middle mouse click.
573 export NNN_MCLICK='^R'
575 NOTE: Only the first character is considered if not a \fICtrl+key\fR combo.
578 \fBnnn:\fR this is a special variable.
580 Set to the hovered file name before starting the command prompt or spawning a shell.
583 \fBNO_COLOR:\fR disable ANSI color output (overridden by \fBNNN_COLORS\fR).
585 .An Arun Prakash Jana Aq Mt engineerarun@gmail.com ,
586 .An Lazaros Koromilas Aq Mt lostd@2f30.org ,
587 .An Dimitris Papastamos Aq Mt sin@2f30.org .
589 .Em https://github.com/jarun/nnn