My build of nnn with minor changes
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

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