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.
 
 
 
 
 
 

419 lines
12 KiB

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