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.
 
 
 
 
 
 

415 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. Explore multiple directories simultaneously with 4 contexts. The status is
  144. shown in the top left corner:
  145. .Pp
  146. - the current context is in reverse video
  147. .br
  148. - other active contexts are underlined
  149. .br
  150. - rest are inactive
  151. .Pp
  152. A new context copies the state of the previous context. Each context can have
  153. its own color. See ENVIRONMENT section.
  154. .Sh SESSIONS
  155. Sessions are a way to save and restore states of work. A session stores the
  156. settings and contexts.
  157. .Pp
  158. Sessions can be loaded dynamically from within a running
  159. .Nm
  160. instance, or with a program option.
  161. .Pp
  162. When a session is loaded dynamically, the last working session is saved
  163. automatically to a dedicated -- "last session" -- session file.
  164. .Pp
  165. All the session files are located by session name in the directory
  166. .Pp
  167. \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR
  168. .Pp
  169. "@" is the "last session" file.
  170. .Sh FILTERS
  171. Filters are strings (or regex patterns) to find matching entries in the current
  172. directory instantly (\fIsearch-as-you-type\fR). Matches are case-insensitive by
  173. default. The last filter in each context is persisted at runtime or in saved
  174. sessions.
  175. .Pp
  176. Special keys at filter prompt:
  177. .Bd -literal
  178. ------ + ---------------------------------------
  179. Key | Function
  180. ------ + ---------------------------------------
  181. ^char | Usual keybind functionality
  182. Esc | Exit filter prompt but skip dir refresh
  183. ------ + ---------------------------------------
  184. .Ed
  185. .Pp
  186. Special keys at \fBempty filter prompt\fR:
  187. .Bd -literal
  188. ------ + ---------------------------------------
  189. Key | Function
  190. ------ + ---------------------------------------
  191. ? | Show help and config screen
  192. / | Toggle between string and regex
  193. : | Toggle case-sensitivity
  194. ^L | Clear filter (\fIif prompt is non-empty\fR)
  195. | OR apply last filter
  196. ------ + ---------------------------------------
  197. .Ed
  198. .Pp
  199. Additional special keys at \fBempty filter prompt\fR
  200. in \fBnav-as-you-type\fR mode:
  201. .Bd -literal
  202. ------ + ------------------------
  203. Key | Function
  204. ------ + ------------------------
  205. ' | Go to first non-dir file
  206. + | Toggle proceed on open
  207. , | Pin CWD
  208. - | Go to last visited dir
  209. . | Show hidden files
  210. ; | Run a plugin by its key
  211. = | Launch a GUI application
  212. > | Export file list
  213. @ | Visit start dir
  214. ] | Show command prompt
  215. ` | Visit /
  216. ~ | Go HOME
  217. ------ + ------------------------
  218. .Ed
  219. .Pp
  220. Common regex use cases:
  221. .Pp
  222. (1) To list all matches starting with the filter expression,
  223. start the expression with a '^' (caret) symbol.
  224. .br
  225. (2) Type '\\.mkv' to list all MKV files.
  226. .br
  227. (3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
  228. .br
  229. (4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
  230. .Pp
  231. In the \fInavigate-as-you-type\fR mode directories are opened in filter
  232. mode, allowing continuous navigation.
  233. .br
  234. When there's a unique match and it's a directory,
  235. .Nm
  236. auto selects the directory and enters it in this mode. Use the relevant
  237. program option to disable this behaviour.
  238. .Sh SELECTION
  239. .Nm
  240. allows file selection across directories and contexts!
  241. .Pp
  242. There are 3 groups of keybinds to add files to selection:
  243. .Pp
  244. (1) hovered file selection toggle
  245. - deselects if '+' is visible before the entry, else adds to selection
  246. .br
  247. (2) add a range of files to selection
  248. - repeat the range key on the same entry twice to clear selection completely
  249. .br
  250. (3) add all files in the current directory to selection
  251. .Pp
  252. A selection can be edited, copied, moved, removed, archived or linked.
  253. .Pp
  254. Absolute paths of the selected files are copied to \fB.selection\fR file in
  255. the config directory.
  256. .Pp
  257. To edit the selection use the _edit selection_ key. Use this key to remove a
  258. file from selection after you navigate away from its directory. Editing doesn't
  259. end the selection mode. You can add more files to the selection and edit the
  260. list again. If no file is selected in the current session, this option attempts
  261. to list the selection file.
  262. .Sh LIST INPUT
  263. .Nm
  264. can receive a list of NUL-separated ('\\0') file pathss as input. Paths and can
  265. be relative to the current directory or absolute.
  266. .Pp
  267. Input is limited by 65,536 paths or 256 MiB of input.
  268. .Pp
  269. Start
  270. .Nm
  271. in this mode by writing to its standard input. E.g., to list files in current
  272. directory larger than
  273. 1M:
  274. .Bd -literal
  275. find -maxdepth 1 -size +1M -print0 | nnn
  276. .Ed
  277. .Pp
  278. or redirect a list from a file:
  279. .Bd -literal
  280. nnn < files.txt
  281. .Ed
  282. .Pp
  283. A temporary directory will be created containing symlinks to the given
  284. paths. Any action performed on these symlinks will be performed only on their
  285. targets, after which they might become invalid.
  286. .Pp
  287. \fBInvalid paths in the iput are ignored.\fR
  288. .Sh UNITS
  289. The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y
  290. (powers of 1024), same as the default units in \fIls\fR.
  291. .Sh ENVIRONMENT
  292. The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables are
  293. used. A single combination of arguments is supported for SHELL and PAGER.
  294. .Pp
  295. \fBNNN_OPTS:\fR binary options to
  296. .Nm
  297. .Bd -literal
  298. export NNN_OPTS="cEnrx"
  299. .Ed
  300. .Pp
  301. \fBNNN_OPENER:\fR specify a custom file opener.
  302. .Bd -literal
  303. export NNN_OPENER=nuke
  304. NOTE: 'nuke' is a file opener available in the plugin repository.
  305. .Ed
  306. .Pp
  307. \fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs
  308. separated by \fI;\fR:
  309. .Bd -literal
  310. export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
  311. .Ed
  312. .Pp
  313. \fBNNN_PLUG:\fR directly executable plugins as \fIkey_char:location\fR pairs
  314. separated by \fI;\fR:
  315. .Bd -literal
  316. export NNN_PLUG='o:fzopen;p:mocplay;d:diffs;m:nmount;t:imgthumb'
  317. NOTES:
  318. 1. To run a plugin directly, press \fI;\fR followed by the plugin key.
  319. 2. To skip directory refresh after running a plugin, prefix with \fB-\fR.
  320. export NNN_PLUG='m:-mediainfo'
  321. .Ed
  322. .Pp
  323. To assign keys to arbitrary non-background non-shell-interpreted cli
  324. commands and invoke like plugins, add \fI_\fR (underscore) before the
  325. command.
  326. .Bd -literal
  327. export NNN_PLUG='x:_chmod +x $nnn;g:_git log;s:_smplayer $nnn;o:fzopen'
  328. NOTES:
  329. 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
  330. 2. $nnn should be the last argument (IF used)
  331. 3. (Again) add \fB_\fR before the command
  332. 4. To disable directory refresh after running a \fIcommand as plugin\fR,
  333. prefix with \fB-_\fR
  334. 5. To skip user confirmation after command execution, suffix with \fB*\fR
  335. export NNN_PLUG='y:-_sync*'
  336. 6. To run a \fIGUI app as plugin\fR, add a \fB|\fR after \fB_\fR
  337. export NNN_PLUG='m:-_|mousepad $nnn'
  338. EXAMPLES:
  339. ----------------------------------- + -------------------------------------------------
  340. Key:Command | Description
  341. ----------------------------------- + -------------------------------------------------
  342. k:-_fuser -kiv $nnn* | Interactively kill process(es) using hovered file
  343. g:-_git diff | Show git diff
  344. l:-_git log | Show git log
  345. n:-_vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
  346. p:-_less -iR $nnn* | Page through hovered file in less
  347. s:-_|smplayer -minigui $nnn | Play hovered media file, even unfinished download
  348. x:_chmod +x $nnn | Make the hovered file executable
  349. y:-_sync* | Flush cached writes
  350. ----------------------------------- + -------------------------------------------------
  351. .Ed
  352. .Pp
  353. \fBNNN_COLORS:\fR string of color codes for each context, e.g.:
  354. .Bd -literal
  355. export NNN_COLORS='1234'
  356. codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
  357. .Ed
  358. .Pp
  359. \fBNNN_ARCHIVE:\fR archive types to be handled silently (default: bzip2, (g)zip, tar).
  360. .Bd -literal
  361. export NNN_ARCHIVE="\\\\.(7z|bz2|gz|tar|tgz|zip)$"
  362. NOTE: Non-default formats may require a third-party utility.
  363. .Ed
  364. .Pp
  365. \fBNNN_SSHFS:\fR pass additional options to sshfs command:
  366. .Bd -literal
  367. export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
  368. NOTE: The options must be preceded by "sshfs" and comma-separated without any space between them.
  369. .Ed
  370. .Pp
  371. \fBNNN_RCLONE:\fR pass additional options to rclone command:
  372. .Bd -literal
  373. export NNN_RCLONE='rclone mount --read-only --no-checksum'
  374. NOTE: The options must be preceded by "rclone" and max 5 flags are supported.
  375. .Ed
  376. .Pp
  377. \fBNNN_TRASH:\fR trash (instead of \fIdelete\fR) files to desktop Trash.
  378. .Bd -literal
  379. export NNN_TRASH=1
  380. .Ed
  381. .Pp
  382. \fBNNN_MCLICK:\fR key emulated by a middle mouse click.
  383. .Bd -literal
  384. export NNN_MCLICK='^R'
  385. NOTE: Only the first character is considered if not a \fICtrl+key\fR combo.
  386. .Ed
  387. .Pp
  388. \fBnnn:\fR this is a special variable set to the hovered entry before executing
  389. a command from the command prompt or spawning a shell.
  390. .Pp
  391. \fBNO_COLOR:\fR if defined, disable ANSI color output.
  392. .Sh KNOWN ISSUES
  393. .Nm
  394. may not handle keypresses correctly when used with tmux (see issue #104 for
  395. more details). Set \fBTERM=xterm-256color\fR to address it.
  396. .Sh AUTHORS
  397. .An Arun Prakash Jana Aq Mt engineerarun@gmail.com ,
  398. .An Lazaros Koromilas Aq Mt lostd@2f30.org ,
  399. .An Dimitris Papastamos Aq Mt sin@2f30.org .
  400. .Sh HOME
  401. .Em https://github.com/jarun/nnn