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