1NNN(1) BSD General Commands Manual NNN(1)
2
4 nnn — the missing terminal file manager for X
5
7 nnn [-a] [-b key] [-c] [-d] [-e name] [-E] [-f] [-H] [-i] [-K] [-n]
8 [-p file] [-r] [-R] [-s] [-S] [-v] [-h] [PATH]
9
11 nnn (Nnn's Not Noice) is a performance-optimized, feature-packed fork of
12 noice (http://git.2f30.org/noice/) with seamless desktop integration,
13 simplified navigation, navigate-as-you-type mode with auto select, disk
14 usage analyzer mode, bookmarks, contexts, application launcher, familiar
15 navigation shortcuts, subshell spawning and much more. It remains a sim‐
16 ple and efficient file manager that stays out of your way.
17
18 nnn opens the current working directory by default if PATH is not speci‐
19 fied.
20
22 Press ? in nnn to see the list of keybinds.
23
25 nnn supports the following options:
26
27 -a
28 use access time for all operations (default: modification time)
29
30 -b key
31 specify bookmark key to open
32
33 -c
34 opener opens files in cli utilities only
35
36 -d
37 detail mode
38
39 -e name
40 load a session by name
41
42 -E
43 use $EDITOR for internal undetached edits
44
45 -f
46 run filter as command when the prompt key is pressed
47
48 -H
49 show hidden files
50
51 -i
52 start in navigate-as-you-type mode
53
54 -K
55 test for keybind collision
56
57 -n
58 use case-insensitive version compare to sort files
59
60 -o
61 open files only on Enter key
62
63 -p file
64 copy (or pick) selection to file, or stdout if file='-'
65
66 -r
67 show cp, mv progress (Linux-only, needs advcpmv; '^T' shows the
68 progress on BSD/macOS)
69
70 -R
71 disable rollover at edges
72
73 -s
74 use substring match for filters instead of regex
75
76 -S
77 start in disk usage analyzer mode
78
79 -t
80 disable directory auto-select in navigate-as-you-type mode
81
82 -v
83 show version and exit
84
85 -h
86 show program help and exit
87
89 nnn uses xdg-open (on Linux) and open(1) (on macOS) as the desktop
90 opener.
91
92 There is no configuration file. Associated files are stored in ${XDG_CON‐
93 FIG_HOME:-$HOME/.config}/nnn/. Settings work on environment variables.
94 See ENVIRONMENT section below.
95
97 Contexts serve the purpose of exploring multiple directories simultane‐
98 ously. 4 contexts are available. The status of the contexts are shown in
99 the top left corner:
100
101 - the current context is in reverse video
102 - other active contexts are underlined
103 - rest are inactive
104
105 On context creation, the state of the previous context is copied. Each
106 context remembers its last visited directory.
107
108 Each context can have its own directory color specified. See ENVIRONMENT
109 section below.
110
112 Sessions are a way to save and restore states of work. A session stores
113 the settings and contexts.
114
115 Sessions can be loaded dynamically from within a running nnn instance, or
116 with a program option.
117
118 When a session is loaded dynamically, the last working session is saved
119 automatically to a dedicated -- "last session" -- session file.
120
121 All the session files are located in the ${XDG_CONFIG_HOME:-$HOME/.con‐
122 fig}/nnn/sessions directory by the session name. "@" is the "last ses‐
123 sion" file.
124
126 Filters support regexes (default) to instantly (search-as-you-type) list
127 the matching entries in the current directory.
128
129 Common use cases:
130
131 (1) To list all matches starting with the filter expression, start the
132 expression with a '^' (caret) symbol.
133 (2) Type '\.mkv' to list all MKV files.
134 (3) Use '.*' to match any character (sort of fuzzy search).
135
136 There is a program option to filter entries by substring match instead of
137 regex.
138
139 There is a program option to execute the current filter as a command when
140 the prompt key is pressed.
141
142 In the navigate-as-you-type mode directories are opened in filter mode,
143 allowing continuous navigation. Works best with the arrow keys.
144 When there's a unique match and it's a directory, nnn auto selects the
145 directory and enters it in this mode.
146
148 There are 3 groups of shortcuts to add files to selection:
149
150 (1) hovered file selection toggle (deselects if '+' is visible before the
151 entry, else adds to selection)
152 (2) add a range of files to selection
153 (3) add all files in the current directory to selection
154
155 The selection can now be listed, copied, moved, removed, archived or
156 linked.
157
158 Absolute paths of the selected files are copied to the temporary file
159 .selection in the config directory. The path is shown in the help and
160 configuration screen. If $NNN_COPIER is set (see ENVIRONMENT section
161 below) the file paths are also copied to the system clipboard.
162
163 To flush the selection without running any operation use the _edit, flush
164 selection_ key. The list is flushed even if unchanged. Use this key to
165 remove a file from selection after you navigate away from its directory.
166 Flushing doesn't end the selection mode. You can add more files to the
167 selection and edit/flush the list again. Flushing doesn't end the selec‐
168 tion mode. You can add more files to the selection and edit/flush the
169 list again.
170
171 Repeat range selection on the same entry twice to clear selection com‐
172 pletely.
173
175 The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z,
176 Y (powers of 1024), same as the default units in ls.
177
179 The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables
180 take precedence when dealing with the !, e and p commands respectively. A
181 single combination to arguments is supported for SHELL and PAGER.
182
183 NNN_BMS: bookmark string as key_char:location pairs (max 10) separated by
184 ;:
185
186 export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
187
188 NOTE: To go to a bookmark, press the Lead key followed by the bookmark key.
189
190 NNN_PLUG: directly executable plugins as key_char:location pairs (max 10)
191 separated by ;:
192
193 export NNN_PLUG='o:fzopen;p:mocplay;d:diffs;m:nmount;t:imgthumb;i:mediainf'
194
195 NOTE: To run a plugin directly, press : followed by the plugin key.
196
197 To assign keys to arbitrary non-background non-shell-interpreted cli
198 commands and invoke like plugins, add _ (underscore) before the com‐
199 mand.
200
201 export NNN_PLUG='x:_chmod +x $nnn;g:_git log;s:_smplayer $nnn;o:fzopen;m:nmount'
202
203 NOTES:
204 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
205 2. $nnn should be the last argument (IF you want to pass the hovered file name)
206 3. (Again) add _ before the command
207
208 NNN_USE_EDITOR: use VISUAL (else EDITOR, preferably CLI, fallback vi) to
209 handle text files.
210
211 export NNN_USE_EDITOR=1
212
213 NNN_CONTEXT_COLORS: string of color codes for each context, e.g.:
214
215 export NNN_CONTEXT_COLORS='1234'
216
217 codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
218
219 NNN_SSHFS_OPTS: pass additional options to sshfs command:
220
221 export NNN_SSHFS_OPTS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
222
223 NOTE: The options must be preceded by `sshfs` and comma-separated without any space between them.
224
225 NNN_RCLONE_OPTS: pass additional options to rclone command:
226
227 export NNN_RCLONE_OPTS='rclone mount --read-only --no-checksum'
228
229 NOTE: The options must be preceded by `rclone` and max 5 flags are supported.
230
231 NNN_OPENER: specify a custom file opener.
232
233 export NNN_OPENER=mimeopen
234
235 NNN_IDLE_TIMEOUT: set idle timeout (in seconds) to invoke terminal locker
236 (default: disabled).
237
238 NNN_COPIER: system clipboard copier script. The project page has some
239 sample copier scripts.
240
241 NNN_TRASH: trash (instead of delete) files to desktop Trash.
242
243 export NNN_TRASH=1
244
245 NNN: this is a special variable set to the current entry before executing
246 a command from the command prompt or spawning a shell.
247
249 nnn may not handle keypresses correctly when used with tmux (see issue
250 #104 for more details). Set TERM=xterm-256color to address it.
251
253 Arun Prakash Jana <engineerarun@gmail.com>,
254 Lazaros Koromilas <lostd@2f30.org>,
255 Dimitris Papastamos <sin@2f30.org>.
256
258 https://github.com/jarun/nnn
259
260BSD Dec 05, 2019 BSD