My build of nnn with minor changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nnn.1 14 KiB

10 years ago
10 years ago
5 years ago
5 years ago
10 years ago
10 years ago
4 years ago
5 years ago
5 years ago
10 years ago
4 years ago
5 years ago
5 years ago
4 years ago
10 years ago
4 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
10 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. .Dd May 26, 2020
  2. .Dt NNN 1
  3. .Os
  4. .Sh NAME
  5. .Nm nnn
  6. .Nd the missing terminal file manager for X
  7. .Sh SYNOPSIS
  8. .Nm
  9. .Op Ar -a
  10. .Op Ar -A
  11. .Op Ar -b key
  12. .Op Ar -c
  13. .Op Ar -d
  14. .Op Ar -e
  15. .Op Ar -E
  16. .Op Ar -f
  17. .Op Ar -F
  18. .Op Ar -g
  19. .Op Ar -H
  20. .Op Ar -K
  21. .Op Ar -l
  22. .Op Ar -n
  23. .Op Ar -p file
  24. .Op Ar -P key
  25. .Op Ar -Q
  26. .Op Ar -r
  27. .Op Ar -R
  28. .Op Ar -s name
  29. .Op Ar -S
  30. .Op Ar -t secs
  31. .Op Ar -T key
  32. .Op Ar -V
  33. .Op Ar -x
  34. .Op Ar -h
  35. .Op Ar PATH
  36. .Sh DESCRIPTION
  37. .Nm
  38. (Nnn's Not Noice) is a performance-optimized, feature-packed fork of
  39. noice (http://git.2f30.org/noice/) with seamless desktop
  40. integration, simplified navigation, \fItype-to-nav\fR mode with
  41. auto select, disk usage analyzer mode, bookmarks, contexts, application
  42. launcher, familiar navigation shortcuts, subshell spawning and much
  43. more.It remains a simple and efficient file manager that stays out of your way.
  44. .Pp
  45. .Nm
  46. opens the current working directory by default if
  47. .Ar PATH
  48. is not specified.
  49. .Sh KEYBINDS
  50. .Pp
  51. Press \fB?\fR in
  52. .Nm
  53. to see the list of keybinds.
  54. .Sh OPTIONS
  55. .Pp
  56. .Nm
  57. supports the following options:
  58. .Pp
  59. .Fl a
  60. auto-setup temporary NNN_FIFO (described in ENVIRONMENT section)
  61. .Pp
  62. .Fl A
  63. disable directory auto-select in type-to-nav mode
  64. .Pp
  65. .Fl "b key"
  66. specify bookmark key to open
  67. .Pp
  68. .Fl c
  69. indicates that the opener is a cli-only opener (overrides -e)
  70. .Pp
  71. .Fl d
  72. detail mode
  73. .Pp
  74. .Fl e
  75. open text files in $VISUAL (else $EDITOR, fallback vi) [preferably CLI]
  76. .Pp
  77. .Fl E
  78. use $EDITOR for internal undetached edits
  79. .Pp
  80. .Fl f
  81. use readline history file
  82. .Pp
  83. .Fl F
  84. show fortune in help and settings screen
  85. .Pp
  86. .Fl g
  87. use regex filters instead of substring match
  88. .Pp
  89. .Fl H
  90. show hidden files
  91. .Pp
  92. .Fl K
  93. test for keybind collision
  94. .Pp
  95. .Fl "l val"
  96. number of lines to move per mouse wheel scroll
  97. .Pp
  98. .Fl n
  99. start in type-to-nav mode
  100. .Pp
  101. .Fl o
  102. open files only on Enter key
  103. .Pp
  104. .Fl "p file"
  105. copy (or \fIpick\fR) selection to file, or stdout if file='-'
  106. .Pp
  107. .Fl "P key"
  108. specify plugin key to run
  109. .Pp
  110. .Fl Q
  111. disable confirmation on quit with multiple contexts active
  112. .Pp
  113. .Fl r
  114. show cp, mv progress
  115. (Linux-only, needs advcpmv; '^T' shows the progress on BSD/macOS)
  116. .Pp
  117. .Fl R
  118. disable rollover at edges
  119. .Pp
  120. .Fl "s name"
  121. load a session by name
  122. .Pp
  123. .Fl S
  124. persistent session
  125. .Pp
  126. .Fl "t secs"
  127. idle timeout in seconds to lock terminal
  128. .Pp
  129. .Fl "T key"
  130. sort order
  131. keys: 'a'u / 'd'u / 'e'xtension / 'r'everse / 's'ize / 't'ime / 'v'ersion
  132. .Pp
  133. .Fl V
  134. show version and exit
  135. .Pp
  136. .Fl x
  137. show notis on selection cp, mv, rm completion
  138. copy path to system clipboard on select
  139. .Pp
  140. .Fl h
  141. show program help and exit
  142. .Sh CONFIGURATION
  143. There is no configuration file. Associated files are at
  144. .Pp
  145. \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/\fR
  146. .Pp
  147. Configuration is done using a few optional (set if you need) environment
  148. variables. See ENVIRONMENT section.
  149. .Pp
  150. .Nm
  151. uses \fIxdg-open\fR (on Linux), \fIopen(1)\fR (on macOS), \fIcygstart\fR on
  152. (Cygwin) and \fIopen\fR on (Haiku) as the desktop opener. It's also possible
  153. to specify a custom opener. See ENVIRONMENT section.
  154. .Sh CONTEXTS
  155. Explore multiple directories simultaneously with 4 contexts. The status is
  156. shown in the top left corner:
  157. .Pp
  158. - the current context is in reverse video
  159. .br
  160. - other active contexts are underlined
  161. .br
  162. - rest are inactive
  163. .Pp
  164. A new context copies the state of the previous context. Each context can have
  165. its own color. See ENVIRONMENT section.
  166. .Sh SESSIONS
  167. Sessions are a way to save and restore states of work. A session stores the
  168. settings and contexts.
  169. .Pp
  170. Sessions can be loaded dynamically from within a running
  171. .Nm
  172. instance, or with a program option.
  173. .Pp
  174. When a session is loaded dynamically, the last working session is saved
  175. automatically to a dedicated -- "last session" -- session file. The "last
  176. session" is also used in persistent session mode.
  177. .Pp
  178. All the session files are located by session name in the directory
  179. .Pp
  180. \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR
  181. .Pp
  182. "@" is the "last session" file.
  183. .Sh FILTERS
  184. Filters are strings (or regex patterns) to find matching entries in the current
  185. directory instantly (\fIsearch-as-you-type\fR). Matches are case-insensitive by
  186. default. The last filter in each context is persisted at runtime or in saved
  187. sessions.
  188. .Pp
  189. Special keys at filter prompt:
  190. .Bd -literal
  191. ------ + ---------------------------------------
  192. Key | Function
  193. ------ + ---------------------------------------
  194. ^char | Usual keybind functionality
  195. Esc | Exit filter prompt but skip dir refresh
  196. F5 | Exit filter prompt and refresh dir
  197. ------ + ---------------------------------------
  198. .Ed
  199. .Pp
  200. Special keys at \fBempty filter prompt\fR:
  201. .Bd -literal
  202. ------ + ---------------------------------------
  203. Key | Function
  204. ------ + ---------------------------------------
  205. ? | Show help and config screen
  206. / | Toggle between string and regex
  207. : | Toggle case-sensitivity
  208. ^L | Clear filter (\fIif prompt is non-empty\fR)
  209. | OR apply last filter
  210. ------ + ---------------------------------------
  211. .Ed
  212. .Pp
  213. Additional special keys at \fBempty filter prompt\fR
  214. in \fBtype-to-nav\fR mode:
  215. .Bd -literal
  216. ------ + ------------------------
  217. Key | Function
  218. ------ + ------------------------
  219. ' | Go to first non-dir file
  220. + | Toggle auto-advance
  221. , | Pin CWD
  222. - | Go to last visited dir
  223. . | Show hidden files
  224. ; | Run a plugin by its key
  225. = | Launch a GUI application
  226. > | Export file list
  227. @ | Visit start dir
  228. ] | Show command prompt
  229. ` | Visit /
  230. ~ | Go HOME
  231. ------ + ------------------------
  232. .Ed
  233. .Pp
  234. Common regex use cases:
  235. .Pp
  236. (1) To list all matches starting with the filter expression,
  237. start the expression with a '^' (caret) symbol.
  238. .br
  239. (2) Type '\\.mkv' to list all MKV files.
  240. .br
  241. (3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
  242. .br
  243. (4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
  244. .Pp
  245. In the \fItype-to-nav\fR mode directories are opened in filter
  246. mode, allowing continuous navigation.
  247. .br
  248. When there's a unique match and it's a directory,
  249. .Nm
  250. auto selects the directory and enters it in this mode. Use the relevant
  251. program option to disable this behaviour.
  252. .Sh SELECTION
  253. .Nm
  254. allows file selection across directories and contexts!
  255. .Pp
  256. There are 3 groups of keybinds to add files to selection:
  257. .Pp
  258. (1) hovered file selection toggle
  259. - deselects if '+' is visible before the entry, else adds to selection
  260. .br
  261. (2) add a range of files to selection
  262. - repeat the range key on the same entry twice to clear selection completely
  263. .br
  264. (3) add all files in the current directory to selection
  265. .Pp
  266. A selection can be edited, copied, moved, removed, archived or linked.
  267. .Pp
  268. Absolute paths of the selected files are copied to \fB.selection\fR file in
  269. the config directory. The selection file is shared between multiple program
  270. instances. The most recent instance writing to the file overwrites the entries
  271. from earlier writes. If you have 2 instances if
  272. .Nm
  273. \fIopen\fR in 2 panes of a terminal multiplexer, you can select in one pane and
  274. use the selection (e.g. to copy or move) in the other pane (if the instance
  275. doesn't have any local selection already).
  276. .Pp
  277. To edit the selection use the _edit selection_ key. Use this key to remove a
  278. file from selection after you navigate away from its directory. Editing doesn't
  279. end the selection mode. You can add more files to the selection and edit the
  280. list again. If no file is selected in the current session, this option attempts
  281. to list the selection file.
  282. .Sh LIST INPUT
  283. .Nm
  284. can receive a list of NUL-separated ('\\0') file paths as input. Paths and can
  285. be relative to the current directory or absolute.
  286. .Pp
  287. Input is limited by 65,536 paths or 256 MiB of input.
  288. .Pp
  289. Start
  290. .Nm
  291. in this mode by writing to its standard input. E.g., to list files in current
  292. directory larger than
  293. 1M:
  294. .Bd -literal
  295. find -maxdepth 1 -size +1M -print0 | nnn
  296. .Ed
  297. .Pp
  298. or redirect a list from a file:
  299. .Bd -literal
  300. nnn < files.txt
  301. .Ed
  302. .Pp
  303. Handy bash/zsh shell function to list files by mime-type in current directory:
  304. .Bd -literal
  305. # to show video files, run: list video
  306. list ()
  307. {
  308. find . -maxdepth 1 | file -if- | grep "$1" | awk -F: '{printf "%s\0", $1}' | nnn
  309. }
  310. .Ed
  311. .Pp
  312. A temporary directory will be created containing symlinks to the given
  313. paths. Any action performed on these symlinks will be performed only on their
  314. targets, after which they might become invalid.
  315. .Pp
  316. Right arrow or 'l' on a symlink in the listing dir takes to the target file.
  317. Press '-' to return to the listing dir. Press 'Enter' to open the symlink.
  318. .Pp
  319. \fBInvalid paths in the input are ignored.\fR
  320. .Sh UNITS
  321. The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y
  322. (powers of 1024), same as the default units in \fIls\fR.
  323. .Sh ENVIRONMENT
  324. The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables are
  325. used. A single combination of arguments is supported for SHELL and PAGER.
  326. .Pp
  327. \fBNNN_OPTS:\fR binary options to
  328. .Nm
  329. .Bd -literal
  330. export NNN_OPTS="cEnrx"
  331. .Ed
  332. .Pp
  333. \fBNNN_OPENER:\fR specify a custom file opener.
  334. .Bd -literal
  335. export NNN_OPENER=nuke
  336. NOTE: 'nuke' is a file opener available in the plugin repository.
  337. .Ed
  338. .Pp
  339. \fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs
  340. separated by \fI;\fR:
  341. .Bd -literal
  342. export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
  343. .Ed
  344. .Pp
  345. \fBNNN_PLUG:\fR directly executable plugins as \fIkey_char:plugin\fR pairs
  346. separated by \fI;\fR:
  347. .Bd -literal
  348. export NNN_PLUG='f:finder;o:fzopen;p:mocplay;d:diffs;t:nmount;v:imgview'
  349. NOTES:
  350. 1. To run a plugin directly, press \fI;\fR followed by the key.
  351. 2. Alternatively, combine with \fIAlt\fR (i.e. \fIAlt+key\fR).
  352. 3. To skip directory refresh after running a plugin, prefix with \fB-\fR.
  353. export NNN_PLUG='m:-mediainf'
  354. .Ed
  355. .Pp
  356. To assign keys to arbitrary non-background non-shell-interpreted cli
  357. commands and invoke like plugins, add \fI_\fR (underscore) before the
  358. command.
  359. .Bd -literal
  360. export NNN_PLUG='x:_chmod +x $nnn;g:_git log;s:_smplayer $nnn'
  361. NOTES:
  362. 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
  363. 2. $nnn should be the last argument (IF used)
  364. 3. (Again) add \fB_\fR before the command
  365. 4. To disable directory refresh after running a \fIcommand as plugin\fR,
  366. prefix with \fB-_\fR
  367. 5. To skip user confirmation after command execution, suffix with \fB*\fR
  368. Note: Do not use \fB*\fR with programs those run and exit e.g. cat
  369. export NNN_PLUG='y:-_sync*'
  370. 6. To run a \fIGUI app as plugin\fR, add a \fB|\fR after \fB_\fR
  371. export NNN_PLUG='m:-_|mousepad $nnn'
  372. EXAMPLES:
  373. ----------------------------------- + -------------------------------------------------
  374. Key:Command | Description
  375. ----------------------------------- + -------------------------------------------------
  376. g:-_git diff | Show git diff
  377. k:-_fuser -kiv $nnn* | Interactively kill process(es) using hovered file
  378. l:-_git log | Show git log
  379. n:-_vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
  380. p:-_less -iR $nnn* | Page through hovered file in less
  381. s:-_|smplayer -minigui $nnn | Play hovered media file, even unfinished download
  382. x:_chmod +x $nnn | Make the hovered file executable
  383. y:-_sync* | Flush cached writes
  384. ----------------------------------- + -------------------------------------------------
  385. .Ed
  386. .Pp
  387. \fBNNN_COLORS:\fR string of color codes for each context, e.g.:
  388. .Bd -literal
  389. export NNN_COLORS='1234'
  390. codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
  391. .Ed
  392. .Pp
  393. \fBNNN_ARCHIVE:\fR archive types to be handled silently (default: bzip2, (g)zip, tar).
  394. .Bd -literal
  395. export NNN_ARCHIVE="\\\\.(7z|bz2|gz|tar|tgz|zip)$"
  396. NOTE: Non-default formats may require a third-party utility.
  397. .Ed
  398. .Pp
  399. \fBNNN_SSHFS:\fR pass additional options to sshfs command:
  400. .Bd -literal
  401. export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
  402. NOTE: The options must be preceded by "sshfs" and comma-separated without any space between them.
  403. .Ed
  404. .Pp
  405. \fBNNN_RCLONE:\fR pass additional options to rclone command:
  406. .Bd -literal
  407. export NNN_RCLONE='rclone mount --read-only --no-checksum'
  408. NOTE: The options must be preceded by "rclone" and max 5 flags are supported.
  409. .Ed
  410. .Pp
  411. \fBNNN_TRASH:\fR trash (instead of \fIdelete\fR) files to desktop Trash.
  412. .Bd -literal
  413. export NNN_TRASH=1
  414. .Ed
  415. .Pp
  416. \fBNNN_SEL:\fR absolute path to custom selection file.
  417. .Pp
  418. \fBNNN_FIFO:\fR path of a named pipe to write the hovered file path:
  419. .Bd -literal
  420. export NNN_FIFO='/tmp/nnn.fifo'
  421. NOTES:
  422. 1. Overridden by a temporary path with -a option.
  423. 2. If the FIFO file doesn't exist it will be created, but not removed (unless it is generated by -a option).
  424. .Ed
  425. .Pp
  426. \fBNNN_LOCKER:\fR terminal locker program.
  427. .Bd -literal
  428. export NNN_LOCKER='bmon -p wlp1s0'
  429. export NNN_LOCKER='cmatrix'
  430. .Ed
  431. .Pp
  432. \fBNNN_MCLICK:\fR key emulated by a middle mouse click.
  433. .Bd -literal
  434. export NNN_MCLICK='^R'
  435. NOTE: Only the first character is considered if not a \fICtrl+key\fR combo.
  436. .Ed
  437. .Pp
  438. \fBnnn:\fR this is a special variable set to the hovered entry before executing
  439. a command from the command prompt or spawning a shell.
  440. .Pp
  441. \fBNO_COLOR:\fR disable ANSI color output (overridden by \fBNNN_COLORS\fR).
  442. .Sh KNOWN ISSUES
  443. .Nm
  444. may not handle keypresses correctly when used with tmux (see issue #104 for
  445. more details). Set \fBTERM=xterm-256color\fR to address it.
  446. .Sh AUTHORS
  447. .An Arun Prakash Jana Aq Mt engineerarun@gmail.com ,
  448. .An Lazaros Koromilas Aq Mt lostd@2f30.org ,
  449. .An Dimitris Papastamos Aq Mt sin@2f30.org .
  450. .Sh HOME
  451. .Em https://github.com/jarun/nnn