6 .Nd The unorthodox terminal file manager.
9 .Op Ar -aAcCdDeEfgHJKnQrRSuUVwxh
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 auto select, 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-select in type-to-nav mode
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 disable auto-proceed on select
91 test for keybind collision
94 number of lines to move per mouse wheel scroll
97 start in type-to-nav mode
100 open files only on Enter key
103 copy (or \fIpick\fR) selection to file, or stdout if file='-'
106 specify plugin key to run
109 disable confirmation on quit with multiple contexts active
113 (Linux-only, needs advcpmv; '^T' shows the progress on BSD/macOS)
116 disable rollover at edges
119 load a session by name
125 idle timeout in seconds to lock terminal
129 keys: 'a'u / 'd'u / 'e'xtension / 'r'everse / 's'ize / 't'ime / 'v'ersion
132 use selection if available, don't prompt to choose between selection and hovered entry
135 show user and group names in status bar
138 show version and exit
141 place hardware cursor on hovered entry
144 show notis on selection cp, mv, rm completion
145 copy path to system clipboard on select
146 show xterm title (if non-picker mode)
149 show program help and exit
151 There is no configuration file. Associated files are at
153 .Pa ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
155 Configuration is done using a few optional (set if you need) environment
156 variables. See ENVIRONMENT section.
159 uses \fIxdg-open\fR (on Linux), \fIopen(1)\fR (on macOS), \fIcygstart\fR on
160 (Cygwin) and \fIopen\fR on (Haiku) as the desktop opener. It's also possible
161 to specify a custom opener. See ENVIRONMENT section.
163 Open multiple locations with 4 contexts. The status is shown in the top left
166 - the current context is in reverse video
168 - other active contexts are underlined
172 A new context copies the state of the previous context. Each context can have
173 its own color. See ENVIRONMENT section.
175 Sessions are a way to save and restore states of work. A session stores the
176 settings and contexts. Sessions can be loaded at runtime or with a program
179 - When a session is loaded at runtime, the last working state is saved
180 automatically to a dedicated "auto session" session file. Session option
181 \fIrestore\fR would restore the "auto session".
183 - The persistent session option is global. If it is used, the last active session
184 will be updated with the final state at program quit.
186 - The "auto session" is used in persistent session mode if no session is active.
188 - Listing input stream and opening a bookmark by key have a higher priority to
189 session options (-s/-S).
191 All the session files are located by session name in the directory
193 \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR
195 "@" is the "auto session" file.
197 Filters are strings (or regex patterns) to find matching entries in the current
198 directory instantly (\fIsearch-as-you-type\fR). Matches are case-insensitive by
199 default. The last filter in each context is persisted at runtime or in saved
202 Special keys at filter prompt:
204 -------- + ---------------------------------------
206 -------- + ---------------------------------------
207 ^char | Usual keybind functionality
208 Esc | Exit filter prompt but skip dir refresh
209 Alt+Esc | Exit filter prompt and refresh dir
210 -------- + ---------------------------------------
213 Special keys at \fBempty filter prompt\fR:
215 ------ + ---------------------------------------
217 ------ + ---------------------------------------
218 ? | Show help and config screen
219 / | Toggle between string and regex
220 : | Toggle case-sensitivity
221 ^L | Clear filter (\fIif prompt is non-empty\fR)
222 | OR apply last filter
223 Bksp | Stay at filter prompt and refresh dir
224 Del | Stay at filter prompt and refresh dir
225 ------ + ---------------------------------------
228 Additional special keys at \fBempty filter prompt\fR
229 in \fBtype-to-nav\fR mode:
231 ------ + ------------------------
233 ------ + ------------------------
234 ' | Go to first non-dir file
235 + | Toggle auto-advance
237 - | Go to last visited dir
238 . | Show hidden files
239 ; | Run a plugin by its key
240 = | Launch a GUI application
243 ] | Show command prompt
246 ------ + ------------------------
249 Common regex use cases:
251 (1) To list all matches starting with the filter expression,
252 start the expression with a '^' (caret) symbol.
254 (2) Type '\\.mkv' to list all MKV files.
256 (3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
258 (4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
260 In the \fItype-to-nav\fR mode directories are opened in filter
261 mode, allowing continuous navigation.
263 When there's a unique match and it's a directory,
265 auto selects the directory and enters it in this mode. Use the relevant
266 program option to disable this behaviour.
269 allows file selection across directories and contexts!
271 There are 3 groups of keybinds to add files to selection:
273 (1) hovered file selection toggle
274 - deselects if '+' is visible before the entry, else adds to selection
276 (2) add a range of files to selection
277 - repeat the range key on the same entry twice to clear selection completely
279 (3) add all files in the current directory to selection
281 A selection can be edited, copied, moved, removed, archived or linked.
283 Absolute paths of the selected files are copied to \fB.selection\fR file in
284 the config directory. The selection file is shared between multiple program
285 instances. Selection from multiple instances are not merged. The last instance
286 writing to the file overwrites earlier contents. If you have 2 instances of
288 \fIopen\fR in 2 panes of a terminal multiplexer, you can select in one pane and
289 use the selection in the other pane.
292 clears the selection after a successful operation with the selection. Plugins
293 are allowed to define the behaviour individually.
295 To edit the selection use the _edit selection_ key. Editing doesn't end the
296 selection mode. You can add more files to the selection and edit the list
297 again. If no file is selected in the current session, this option attempts
298 to list the selection file.
300 There are two ways to search and list:
302 - feed a list of file paths as input
304 - search using a plugin (e.g. \fIfinder\fR) and list the results
306 File paths must be NUL-separated ('\\0'). Paths and can be relative to the
307 current directory or absolute. Invalid paths in the input are ignored. Input
308 limit is 65,536 paths or 256 MiB of data.
310 To list the input stream, start
312 by writing to its standard input. E.g., to list files in current
313 directory larger than
316 find -maxdepth 1 -size +1M -print0 | nnn
319 or redirect a list from a file:
324 Handy bash/zsh shell function to list files by mime-type in current directory:
326 # to show video files, run: list video
330 find . -maxdepth 1 | file -if- | grep "$1" | awk -F: '{printf "%s\0", $1}' | nnn
334 A temporary directory will be created containing symlinks to the given
335 paths. Any action performed on these symlinks will be performed only on their
336 targets, after which they might become invalid.
338 Right arrow or 'l' on a symlink in the listing dir takes to the target
339 file. Press '-' to return to the listing dir. Press 'Enter' to open the symlink.
341 Listing input stream can be scripted. It can be extended to pick (option -p)
342 selected entries from the listed results.
344 The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y
345 (powers of 1024), same as the default units in \fIls\fR.
347 The SHELL, VISUAL (else EDITOR) and PAGER environment variables are
348 used. A single combination of arguments is supported for SHELL and PAGER.
350 \fBNNN_OPTS:\fR binary options to
353 export NNN_OPTS="cEnrx"
356 \fBNNN_OPENER:\fR specify a custom file opener.
358 export NNN_OPENER=nuke
360 NOTE: 'nuke' is a file opener available in the plugin repository.
363 \fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs
364 separated by \fI;\fR:
366 export NNN_BMS="d:$HOME/Docs;u:/home/user/Cam Uploads;D:$HOME/Downloads/"
369 \fBNNN_PLUG:\fR directly executable plugins as \fIkey_char:plugin\fR pairs
370 separated by \fI;\fR:
372 export NNN_PLUG='f:finder;o:fzopen;p:mocplay;d:diffs;t:nmount;v:imgview'
375 1. To run a plugin directly, press \fI;\fR followed by the key.
376 2. Alternatively, combine with \fIAlt\fR (i.e. \fIAlt+key\fR).
377 3. To skip directory refresh after running a plugin, prefix with \fB-\fR.
379 export NNN_PLUG='p:-plugin'
382 To assign keys to arbitrary non-background non-shell-interpreted cli
383 commands and invoke like plugins, add \fI!\fR (underscore) before the
386 export NNN_PLUG='x:!chmod +x $nnn;g:!git log;s:!smplayer $nnn'
388 To pick and run an unassigned plugin, press \fBEnter\fR at the plugin prompt.
389 To run a plugin at startup, use the option `-P` followed by the plugin key.
392 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
393 2. $nnn should be the last argument (IF used)
394 3. (Again) add \fB!\fR before the command
395 4. To disable directory refresh after running a \fIcommand as plugin\fR,
397 5. To skip user confirmation after command execution, suffix with \fB*\fR
398 Note: Do not use \fB*\fR with programs those run and exit e.g. cat
400 export NNN_PLUG='y:-!sync*'
402 6. To run a \fIGUI app as plugin\fR, add a \fB&\fR after \fB!\fR
404 export NNN_PLUG='m:-!&mousepad $nnn'
406 7. To show the output of run-and-exit commands which do not need user input,
407 add \fB|\fR (pipe) after \fB!\fR
408 Note: This option is incompatible with \fB&\fR (terminal output is masked
409 for GUI programs) and ignores \fB*\fR (output is already paged for user)
411 export NNN_PLUG='m:-!|mediainfo $nnn;t:-!|tree -ps;l:-!|ls -lah --group-directories-first'
414 ----------------------------------- + -------------------------------------------------
415 Key:Command | Description
416 ----------------------------------- + -------------------------------------------------
417 e:-!sudo -E vim $nnn* | Edit file as root in vim
418 g:-!git diff | Show git diff
419 h:-!hx $nnn* | Open hovered file in hx hex editor
420 k:-!fuser -kiv $nnn* | Interactively kill process(es) using hovered file
421 l:-!git log | Show git log
422 n:-!vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
423 p:-!less -iR $nnn* | Page through hovered file in less
424 s:-!&smplayer -minigui $nnn | Play hovered media file, even unfinished download
425 x:!chmod +x $nnn | Make the hovered file executable
426 y:-!sync* | Flush cached writes
427 ----------------------------------- + -------------------------------------------------
429 Online docs: https://github.com/jarun/nnn/tree/master/plugins
432 \fBNNN_COLORS:\fR string of color numbers for each context, e.g.:
435 # 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
436 export NNN_COLORS='1234'
438 # xterm 256 color numbers (converted to hex, 2 symbols per context):
439 # see https://user-images.githubusercontent.com/1482942/93023823-46a6ba80-f5e1-11ea-9ea3-6a3c757704f4.png
440 export NNN_COLORS='#0a1b2c3d'
442 # both (256 followed by 8 as fallback, separated by ';')
443 export NNN_COLORS='#0a1b2c3d;1234'
445 NOTE: If only 256 colors are specified and the terminal doesn't support, default is used.
448 \fBNNN_FCOLORS:\fR specify file-type specific colors:
450 export NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
452 Specify file-specific colors in xterm 256 color hex numbers (2 symbols per color).
453 Order is strict, use 00 to omit/use default terminal color. Defaults:
455 ------------------------- + --- + -------------
457 ------------------------- + --- + -------------
458 Block device | c1 | DarkSeaGreen1
459 Char device | e2 | Yellow1
460 Directory | 27 | DeepSkyBlue1
461 Executable | 2e | Green1
462 Regular | 00 | Normal
463 Hard link | 60 | Plum4
464 Symbolic link | 33 | Cyan1
465 Missing OR file details | f7 | Grey62
466 Orphaned symbolic link | c6 | DeepPink1
468 Socket | ab | MediumOrchid1
469 Unknown OR 0B regular/exe | c4 | Red1
470 ------------------------- + --- + -------------
472 If the terminal supports xterm 256 colors or more, file-specific colors will be rendered.
473 To force the 8-color scheme use option -C.
474 If xterm 256 colors aren't supported, 8-color scheme will be used.
477 \fBNNN_ARCHIVE:\fR archive extensions to be handled silently (default: bzip2, (g)zip, tar).
479 export NNN_ARCHIVE="\\\\.(7z|bz2|gz|tar|tgz|zip)$"
481 NOTE: Non-default formats may require a third-party utility.
484 \fBNNN_SSHFS:\fR specify custom sshfs command with options:
486 export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
488 NOTE: The options must be comma-separated without any space between them.
491 \fBNNN_RCLONE:\fR pass additional options to rclone command:
493 export NNN_RCLONE='rclone mount --read-only --no-checksum'
495 NOTE: The options must be preceded by "rclone" and max 5 flags are supported.
498 \fBNNN_TRASH:\fR trash (instead of \fIrm -rf\fR) files to desktop Trash.
501 # n=1: trash-cli, n=2: gio trash
504 \fBNNN_SEL:\fR absolute path to custom selection file.
506 \fBNNN_FIFO:\fR path of a named pipe to write the hovered file path:
508 export NNN_FIFO='/tmp/nnn.fifo'
511 1. Overridden by a temporary path with -a option.
512 2. If the FIFO file doesn't exist it will be created,
513 but not removed (unless it is generated by -a option).
515 Online docs: https://github.com/jarun/nnn/wiki/Live-previews
518 \fBNNN_LOCKER:\fR terminal locker program.
520 export NNN_LOCKER='bmon -p wlp1s0'
521 export NNN_LOCKER='cmatrix'
524 \fBNNN_HELP:\fR run a program and show the output on top of the program help page.
526 export NNN_HELP='fortune'
529 \fBNNN_MCLICK:\fR key emulated by a middle mouse click.
531 export NNN_MCLICK='^R'
533 NOTE: Only the first character is considered if not a \fICtrl+key\fR combo.
536 \fBnnn:\fR this is a special variable.
538 Set to the hovered file name before starting the command prompt or spawning a shell.
541 \fBNO_COLOR:\fR disable ANSI color output (overridden by \fBNNN_COLORS\fR).
543 .An Arun Prakash Jana Aq Mt engineerarun@gmail.com ,
544 .An Lazaros Koromilas Aq Mt lostd@2f30.org ,
545 .An Dimitris Papastamos Aq Mt sin@2f30.org .
547 .Em https://github.com/jarun/nnn