6 .Nd The unorthodox terminal file manager.
9 .Op Ar -aAcCdDeEfFgHJKlnQrRSuUVwxh
20 is a performance-optimized, feature-packed fork of noice
21 .Em http://git.2f30.org/noice/
22 with seamless desktop integration, simplified navigation,
24 mode with auto select, disk usage analyzer mode, bookmarks,
25 contexts, application launcher, familiar navigation shortcuts,
26 subshell spawning and much more. It remains a simple and
27 efficient file manager that stays out of your way.
30 opens the current working directory by default if
39 to see the list of keybinds.
43 supports the following options:
46 auto-setup temporary NNN_FIFO (described in ENVIRONMENT section)
49 disable directory auto-select in type-to-nav mode
52 specify bookmark key to open
55 indicates that the opener is a cli-only opener (overrides -e)
58 8-color scheme - color directories by context, disable file colors
64 show directories in context color with \fBNNN_FCOLORS\fR set
67 open text files in $VISUAL (else $EDITOR, fallback vi) [preferably CLI]
70 use $EDITOR for internal undetached edits
73 use readline history file
76 show fortune in help and settings screen
79 use regex filters instead of substring match
85 disable auto-proceed on select
88 test for keybind collision
91 number of lines to move per mouse wheel scroll
94 start in type-to-nav mode
97 open files only on Enter key
100 copy (or \fIpick\fR) selection to file, or stdout if file='-'
103 specify plugin key to run
106 disable confirmation on quit with multiple contexts active
110 (Linux-only, needs advcpmv; '^T' shows the progress on BSD/macOS)
113 disable rollover at edges
116 load a session by name
122 idle timeout in seconds to lock terminal
126 keys: 'a'u / 'd'u / 'e'xtension / 'r'everse / 's'ize / 't'ime / 'v'ersion
129 use selection if available, don't prompt to choose between selection and hovered entry
132 show user and group names in status bar
135 show version and exit
138 place hardware cursor on hovered entry
141 show notis on selection cp, mv, rm completion
142 copy path to system clipboard on select
143 show xterm title (if non-picker mode)
146 show program help and exit
148 There is no configuration file. Associated files are at
150 .Pa ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
152 Configuration is done using a few optional (set if you need) environment
153 variables. See ENVIRONMENT section.
156 uses \fIxdg-open\fR (on Linux), \fIopen(1)\fR (on macOS), \fIcygstart\fR on
157 (Cygwin) and \fIopen\fR on (Haiku) as the desktop opener. It's also possible
158 to specify a custom opener. See ENVIRONMENT section.
160 Open multiple locations with 4 contexts. The status is shown in the top left
163 - the current context is in reverse video
165 - other active contexts are underlined
169 A new context copies the state of the previous context. Each context can have
170 its own color. See ENVIRONMENT section.
172 Sessions are a way to save and restore states of work. A session stores the
173 settings and contexts. Sessions can be loaded at runtime or with a program
176 - When a session is loaded at runtime, the last working state is saved
177 automatically to a dedicated "auto session" session file. Session option
178 \fIrestore\fR would restore the "auto session".
180 - The persistent session option is global. If it is used, the last active session
181 will be updated with the final state at program quit.
183 - The "auto session" is used in persistent session mode if no session is active.
185 - Listing input stream and opening a bookmark by key have a higher priority to
186 session options (-s/-S).
188 All the session files are located by session name in the directory
190 \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR
192 "@" is the "auto session" file.
194 Filters are strings (or regex patterns) to find matching entries in the current
195 directory instantly (\fIsearch-as-you-type\fR). Matches are case-insensitive by
196 default. The last filter in each context is persisted at runtime or in saved
199 Special keys at filter prompt:
201 -------- + ---------------------------------------
203 -------- + ---------------------------------------
204 ^char | Usual keybind functionality
205 Esc | Exit filter prompt but skip dir refresh
206 Alt+Esc | Exit filter prompt and refresh dir
207 -------- + ---------------------------------------
210 Special keys at \fBempty filter prompt\fR:
212 ------ + ---------------------------------------
214 ------ + ---------------------------------------
215 ? | Show help and config screen
216 / | Toggle between string and regex
217 : | Toggle case-sensitivity
218 ^L | Clear filter (\fIif prompt is non-empty\fR)
219 | OR apply last filter
220 Bksp | Stay at filter prompt and refresh dir
221 Del | Stay at filter prompt and refresh dir
222 ------ + ---------------------------------------
225 Additional special keys at \fBempty filter prompt\fR
226 in \fBtype-to-nav\fR mode:
228 ------ + ------------------------
230 ------ + ------------------------
231 ' | Go to first non-dir file
232 + | Toggle auto-advance
234 - | Go to last visited dir
235 . | Show hidden files
236 ; | Run a plugin by its key
237 = | Launch a GUI application
240 ] | Show command prompt
243 ------ + ------------------------
246 Common regex use cases:
248 (1) To list all matches starting with the filter expression,
249 start the expression with a '^' (caret) symbol.
251 (2) Type '\\.mkv' to list all MKV files.
253 (3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
255 (4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
257 In the \fItype-to-nav\fR mode directories are opened in filter
258 mode, allowing continuous navigation.
260 When there's a unique match and it's a directory,
262 auto selects the directory and enters it in this mode. Use the relevant
263 program option to disable this behaviour.
266 allows file selection across directories and contexts!
268 There are 3 groups of keybinds to add files to selection:
270 (1) hovered file selection toggle
271 - deselects if '+' is visible before the entry, else adds to selection
273 (2) add a range of files to selection
274 - repeat the range key on the same entry twice to clear selection completely
276 (3) add all files in the current directory to selection
278 A selection can be edited, copied, moved, removed, archived or linked.
280 Absolute paths of the selected files are copied to \fB.selection\fR file in
281 the config directory. The selection file is shared between multiple program
282 instances. Selection from multiple instances are not merged. The last instance
283 writing to the file overwrites earlier contents. If you have 2 instances of
285 \fIopen\fR in 2 panes of a terminal multiplexer, you can select in one pane and
286 use the selection in the other pane.
289 clears the selection after an operation with the selection. Plugins are allowed
290 to define the behaviour individually.
293 doesn't match directory entries for selected files after a redraw or after the
294 user navigates away from the directory. An attempt to do so will increase
295 memory consumption and processing significantly as
297 allows selection across directories. So the selection marks are cleared. The
298 selection can still be edited in the same instance.
300 To edit the selection use the _edit selection_ key. Use this key to remove a
301 file from selection after you navigate away from its directory or to remove
302 duplicates. Editing doesn't end the selection mode. You can add more files to
303 the selection and edit the list again. If no file is selected in the current
304 session, this option attempts to list the selection file.
306 There are two ways to search and list:
308 - feed a list of file paths as input
310 - search using a plugin (e.g. \fIfinder\fR) and list the results
312 File paths must be NUL-separated ('\\0'). Paths and can be relative to the
313 current directory or absolute. Invalid paths in the input are ignored. Input
314 limit is 65,536 paths or 256 MiB of data.
316 To list the input stream, start
318 by writing to its standard input. E.g., to list files in current
319 directory larger than
322 find -maxdepth 1 -size +1M -print0 | nnn
325 or redirect a list from a file:
330 Handy bash/zsh shell function to list files by mime-type in current directory:
332 # to show video files, run: list video
336 find . -maxdepth 1 | file -if- | grep "$1" | awk -F: '{printf "%s\0", $1}' | nnn
340 A temporary directory will be created containing symlinks to the given
341 paths. Any action performed on these symlinks will be performed only on their
342 targets, after which they might become invalid.
344 Right arrow or 'l' on a symlink in the listing dir takes to the target
345 file. Press '-' to return to the listing dir. Press 'Enter' to open the symlink.
347 Listing input stream can be scripted. It can be extended to pick (option -p)
348 selected entries from the listed results.
350 The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y
351 (powers of 1024), same as the default units in \fIls\fR.
353 The SHELL, VISUAL (else EDITOR) and PAGER environment variables are
354 used. A single combination of arguments is supported for SHELL and PAGER.
356 \fBNNN_OPTS:\fR binary options to
359 export NNN_OPTS="cEnrx"
362 \fBNNN_OPENER:\fR specify a custom file opener.
364 export NNN_OPENER=nuke
366 NOTE: 'nuke' is a file opener available in the plugin repository.
369 \fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs
370 separated by \fI;\fR:
372 export NNN_BMS="d:$HOME/Documents;u:/home/user/Cam Uploads;D:$HOME/Downloads/"
375 \fBNNN_PLUG:\fR directly executable plugins as \fIkey_char:plugin\fR pairs
376 separated by \fI;\fR:
378 export NNN_PLUG='f:finder;o:fzopen;p:mocplay;d:diffs;t:nmount;v:imgview'
381 1. To run a plugin directly, press \fI;\fR followed by the key.
382 2. Alternatively, combine with \fIAlt\fR (i.e. \fIAlt+key\fR).
383 3. To skip directory refresh after running a plugin, prefix with \fB-\fR.
385 export NNN_PLUG='m:-mediainf'
388 To assign keys to arbitrary non-background non-shell-interpreted cli
389 commands and invoke like plugins, add \fI_\fR (underscore) before the
392 export NNN_PLUG='x:_chmod +x $nnn;g:_git log;s:_smplayer $nnn'
394 To pick and run an unassigned plugin, press \fBEnter\fR at the plugin prompt.
395 To run a plugin at startup, use the option `-P` followed by the plugin key.
398 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
399 2. $nnn should be the last argument (IF used)
400 3. (Again) add \fB_\fR before the command
401 4. To disable directory refresh after running a \fIcommand as plugin\fR,
403 5. To skip user confirmation after command execution, suffix with \fB*\fR
404 Note: Do not use \fB*\fR with programs those run and exit e.g. cat
406 export NNN_PLUG='y:-_sync*'
408 6. To run a \fIGUI app as plugin\fR, add a \fB|\fR after \fB_\fR
410 export NNN_PLUG='m:-_|mousepad $nnn'
413 ----------------------------------- + -------------------------------------------------
414 Key:Command | Description
415 ----------------------------------- + -------------------------------------------------
416 g:-_git diff | Show git diff
417 k:-_fuser -kiv $nnn* | Interactively kill process(es) using hovered file
418 l:-_git log | Show git log
419 n:-_vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
420 p:-_less -iR $nnn* | Page through hovered file in less
421 s:-_|smplayer -minigui $nnn | Play hovered media file, even unfinished download
422 x:_chmod +x $nnn | Make the hovered file executable
423 y:-_sync* | Flush cached writes
424 ----------------------------------- + -------------------------------------------------
426 Online docs: https://github.com/jarun/nnn/tree/master/plugins
429 \fBNNN_COLORS:\fR string of color numbers for each context, e.g.:
432 # 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
433 export NNN_COLORS='1234'
435 # xterm 256 color numbers (converted to hex, 2 symbols per context):
436 # see https://user-images.githubusercontent.com/1482942/93023823-46a6ba80-f5e1-11ea-9ea3-6a3c757704f4.png
437 export NNN_COLORS='#0a1b2c3d'
439 # both (256 followed by 8 as fallback, separated by ';')
440 export NNN_COLORS='#0a1b2c3d;1234'
442 NOTE: If only 256 colors are specified and the terminal doesn't support, default is used.
445 \fBNNN_FCOLORS:\fR specify file-type specific colors:
447 export NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
449 Specify file-specific colors in xterm 256 color hex numbers (2 symbols per color).
450 Order is strict, use 00 to omit/use default terminal color. Defaults:
452 ------------------------- + --- + -------------
454 ------------------------- + --- + -------------
455 Block device | c1 | DarkSeaGreen1
456 Char device | e2 | Yellow1
457 Directory | 27 | DeepSkyBlue1
458 Executable | 2e | Green1
459 Regular | 00 | Normal
460 Hard link | 60 | Plum4
461 Symbolic link | 33 | Cyan1
462 Missing OR file details | f7 | Grey62
463 Orphaned symbolic link | c6 | DeepPink1
465 Socket | ab | MediumOrchid1
466 Unknown OR 0B regular/exe | c4 | Red1
467 ------------------------- + --- + -------------
469 If the terminal supports xterm 256 colors or more, file-specific colors will be rendered.
470 To force the 8-color scheme use option -C.
471 If xterm 256 colors aren't supported, 8-color scheme will be used.
474 \fBNNN_ARCHIVE:\fR archive extensions to be handled silently (default: bzip2, (g)zip, tar).
476 export NNN_ARCHIVE="\\\\.(7z|bz2|gz|tar|tgz|zip)$"
478 NOTE: Non-default formats may require a third-party utility.
481 \fBNNN_SSHFS:\fR specify custom sshfs command with options:
483 export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
485 NOTE: The options must be comma-separated without any space between them.
488 \fBNNN_RCLONE:\fR pass additional options to rclone command:
490 export NNN_RCLONE='rclone mount --read-only --no-checksum'
492 NOTE: The options must be preceded by "rclone" and max 5 flags are supported.
495 \fBNNN_TRASH:\fR trash (instead of \fIrm -rf\fR) files to desktop Trash.
498 # n=1: trash-cli, n=2: gio trash
501 \fBNNN_SEL:\fR absolute path to custom selection file.
503 \fBNNN_FIFO:\fR path of a named pipe to write the hovered file path:
505 export NNN_FIFO='/tmp/nnn.fifo'
508 1. Overridden by a temporary path with -a option.
509 2. If the FIFO file doesn't exist it will be created,
510 but not removed (unless it is generated by -a option).
512 Online docs: https://github.com/jarun/nnn/wiki/Live-previews
515 \fBNNN_LOCKER:\fR terminal locker program.
517 export NNN_LOCKER='bmon -p wlp1s0'
518 export NNN_LOCKER='cmatrix'
521 \fBNNN_MCLICK:\fR key emulated by a middle mouse click.
523 export NNN_MCLICK='^R'
525 NOTE: Only the first character is considered if not a \fICtrl+key\fR combo.
528 \fBnnn:\fR this is a special variable.
530 Set to the hovered file name before starting the command prompt or spawning a shell.
533 \fBNO_COLOR:\fR disable ANSI color output (overridden by \fBNNN_COLORS\fR).
535 .An Arun Prakash Jana Aq Mt engineerarun@gmail.com ,
536 .An Lazaros Koromilas Aq Mt lostd@2f30.org ,
537 .An Dimitris Papastamos Aq Mt sin@2f30.org .
539 .Em https://github.com/jarun/nnn