My build of nnn with minor changes
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

392 行
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 -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 -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 -v
  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. use access time for all operations (default: modification time)
  57. .Pp
  58. .Fl A
  59. disable directory auto-select in navigate-as-you-type mode
  60. .Pp
  61. .Fl "b key"
  62. specify bookmark key to open
  63. .Pp
  64. .Fl c
  65. opener opens files in cli utilities only (overrides -e)
  66. .Pp
  67. .Fl d
  68. detail mode
  69. .Pp
  70. .Fl e
  71. open text files in $VISUAL (else $EDITOR, fallback vi) [preferably CLI]
  72. .Pp
  73. .Fl E
  74. use $EDITOR for internal undetached edits
  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 v
  114. use case-insensitive version compare to sort files
  115. .Pp
  116. .Fl V
  117. show version and exit
  118. .Pp
  119. .Fl x
  120. show notis on selection cp, mv, rm completion
  121. copy path to system clipboard on select
  122. .Pp
  123. .Fl h
  124. show program help and exit
  125. .Sh CONFIGURATION
  126. There is no configuration file. Associated files are at
  127. .Pp
  128. \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/\fR
  129. .Pp
  130. Configuration is done using a few optional (set if you need) environment
  131. variables. See ENVIRONMENT section.
  132. .Pp
  133. .Nm
  134. uses \fIxdg-open\fR (on Linux), \fIopen(1)\fR (on macOS), \fIcygstart\fR on
  135. (Cygwin) and \fIopen\fR on (Haiku) as the desktop opener. It's also possible
  136. to specify a custom opener. See ENVIRONMENT section.
  137. .Sh CONTEXTS
  138. Contexts serve the purpose of exploring multiple directories simultaneously. 4
  139. contexts are available. The status of the contexts are shown in the top left
  140. corner:
  141. .Pp
  142. - the current context is in reverse video
  143. .br
  144. - other active contexts are underlined
  145. .br
  146. - rest are inactive
  147. .Pp
  148. On context creation, the state of the previous context is copied. Each context
  149. remembers its last visited directory.
  150. .Pp
  151. Each context can have its own directory color specified. See ENVIRONMENT
  152. section.
  153. .Sh SESSIONS
  154. Sessions are a way to save and restore states of work. A session stores the
  155. settings and contexts.
  156. .Pp
  157. Sessions can be loaded dynamically from within a running
  158. .Nm
  159. instance, or with a program option.
  160. .Pp
  161. When a session is loaded dynamically, the last working session is saved
  162. automatically to a dedicated -- "last session" -- session file.
  163. .Pp
  164. All the session files are located by session name in the directory
  165. .Pp
  166. \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR
  167. .Pp
  168. "@" is the "last session" file.
  169. .Sh FILTERS
  170. Filters are strings to find matching entries in the current directory
  171. instantly (\fIsearch-as-you-type\fR). There is a program option to switch to
  172. regex filters. Matches are case-insensitive by default. In each context the
  173. last filter is persisted at runtime or in saved sessions.
  174. .Pp
  175. Special keys at filter prompt:
  176. .Bd -literal
  177. ------ + ---------------------------------------
  178. Key | Function
  179. ------ + ---------------------------------------
  180. ^char | Usual keybind functionality
  181. Esc | Exit filter prompt but skip dir refresh
  182. ------ + ---------------------------------------
  183. .Ed
  184. .Pp
  185. Special keys at \fBempty filter prompt\fR:
  186. .Bd -literal
  187. ------ + ---------------------------------------
  188. Key | Function
  189. ------ + ---------------------------------------
  190. ? | Show help and config screen
  191. / | Toggle between string and regex
  192. : | Toggle case-sensitivity
  193. ^L | Clear filter (\fIif prompt is non-empty\fR)
  194. | OR apply last filter
  195. ------ + ---------------------------------------
  196. .Ed
  197. .Pp
  198. Additional special keys at \fBempty filter prompt\fR
  199. in \fBnav-as-you-type\fR mode:
  200. .Bd -literal
  201. ------ + ------------------------
  202. Key | Function
  203. ------ + ------------------------
  204. ' | Go to first non-dir file
  205. + | Toggle proceed on open
  206. , | Pin CWD
  207. - | Go to last visited dir
  208. . | Show hidden files
  209. ; | Run a plugin by its key
  210. = | Launch a GUI application
  211. @ | Visit start dir
  212. ] | Show command prompt
  213. ` | Visit /
  214. ~ | Go HOME
  215. ------ + ------------------------
  216. .Ed
  217. .Pp
  218. Common regex use cases:
  219. .Pp
  220. (1) To list all matches starting with the filter expression,
  221. start the expression with a '^' (caret) symbol.
  222. .br
  223. (2) Type '\\.mkv' to list all MKV files.
  224. .br
  225. (3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
  226. .Pp
  227. In the \fInavigate-as-you-type\fR mode directories are opened in filter
  228. mode, allowing continuous navigation. Works best with the \fBarrow keys\fR.
  229. .br
  230. When there's a unique match and it's a directory,
  231. .Nm
  232. auto selects the directory and enters it in this mode. Use the relevant
  233. program option to disable this behaviour.
  234. .Sh SELECTION
  235. .Nm
  236. allows file selection across directories and contexts!
  237. .Pp
  238. There are 3 groups of keybinds to add files to selection:
  239. .Pp
  240. (1) hovered file selection toggle (deselects if '+' is visible before the
  241. entry, else adds to selection)
  242. .br
  243. (2) add a range of files to selection (repeat the range key on the same entry
  244. twice to clear selection completely)
  245. .br
  246. (3) add all files in the current directory to selection
  247. .Pp
  248. A selection can be edited, copied, moved, removed, archived or linked.
  249. .Pp
  250. Absolute paths of the selected files are copied to \fB.selection\fR file in
  251. the config directory.
  252. .Pp
  253. To edit the selection use the _edit selection_ key. Use this key to remove a
  254. file from selection after you navigate away from its directory. Editing doesn't
  255. end the selection mode. You can add more files to the selection and edit the
  256. list again. If no file is selected in the current session, this option attempts
  257. to list the selection file.
  258. .Sh LIST FILES
  259. .Nm
  260. can receive a list of files as input. The paths should be NUL-separated ('\\0')
  261. but doesn't need to be NUL-terminated. Paths and can be relative to the current
  262. directory or absolute.
  263. .Pp
  264. Input is limited by 65,536 paths or 256 MiB of input.
  265. .Pp
  266. Start
  267. .Nm
  268. in this mode by writing to its standard input. So the output of another command
  269. can be piped to it. For example, to list files in current directory larger than
  270. 1M:
  271. .Bd -literal
  272. find -maxdepth 1 -size +1M -print0 | nnn
  273. .Ed
  274. .Pp
  275. or you can redirect a list from a file:
  276. .Bd -literal
  277. nnn < files.txt
  278. .Ed
  279. .Pp
  280. A temporary directory will be created containing symlinks to the given
  281. paths. Any action performed on these symlinks will be performed only on their
  282. targets, after which they might become invalid.
  283. .Pp
  284. Though the term "files" is used, any input is valid as long as it's a valid
  285. path. \fBInvalid paths are ignored.\fR
  286. .Sh UNITS
  287. The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y
  288. (powers of 1024), same as the default units in \fIls\fR.
  289. .Sh ENVIRONMENT
  290. The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables are
  291. used. A single combination of arguments is supported for SHELL and PAGER.
  292. .Pp
  293. \fBNNN_OPENER:\fR specify a custom file opener.
  294. .Bd -literal
  295. export NNN_OPENER=nuke
  296. NOTE: `nuke` is a file opener available in plugin repository
  297. .Ed
  298. .Pp
  299. \fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs
  300. (max 10) separated by \fI;\fR:
  301. .Bd -literal
  302. export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
  303. NOTE: To go to a bookmark, press the Lead key followed by the bookmark key.
  304. .Ed
  305. .Pp
  306. \fBNNN_PLUG:\fR directly executable plugins as \fIkey_char:location\fR pairs
  307. (max 15) separated by \fI;\fR:
  308. .Bd -literal
  309. export NNN_PLUG='o:fzopen;p:mocplay;d:diffs;m:nmount;t:imgthumb'
  310. NOTES:
  311. 1. To run a plugin directly, press \fI;\fR followed by the plugin key
  312. 2. To skip directory refresh after running a plugin, prefix with \fB-\fR
  313. export NNN_PLUG='m:-mediainfo'
  314. .Ed
  315. .Pp
  316. To assign keys to arbitrary non-background non-shell-interpreted cli
  317. commands and invoke like plugins, add \fI_\fR (underscore) before the
  318. command.
  319. .Bd -literal
  320. export NNN_PLUG='x:_chmod +x $nnn;g:_git log;s:_smplayer $nnn;o:fzopen'
  321. NOTES:
  322. 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
  323. 2. $nnn should be the last argument (IF used)
  324. 3. (Again) add \fB_\fR before the command
  325. 4. To disable directory refresh after running a \fIcommand as plugin\fR,
  326. prefix with \fB-_\fR
  327. 5. To skip user confirmation after command execution, suffix with \fB*\fR
  328. export NNN_PLUG='y:-_sync*'
  329. 6. To run a \fIGUI app as plugin\fR, add a \fB|\fR after \fB_\fR
  330. export NNN_PLUG='m:-_|mousepad $nnn'
  331. EXAMPLES:
  332. ----------------------------------- + -------------------------------------------------
  333. Key:Command | Description
  334. ----------------------------------- + -------------------------------------------------
  335. k:-_fuser -kiv $nnn* | Interactively kill process(es) using hovered file
  336. l:_git log | Show git log
  337. n:-_vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
  338. p:-_less -iR $nnn* | Page through hovered file in less
  339. s:-_|smplayer -minigui $nnn | Play hovered media file, even unfinished download
  340. x:_chmod +x $nnn | Make the hovered file executable
  341. y:-_sync* | Flush cached writes
  342. ----------------------------------- + -------------------------------------------------
  343. .Ed
  344. .Pp
  345. \fBNNN_COLORS:\fR string of color codes for each context, e.g.:
  346. .Bd -literal
  347. export NNN_COLORS='1234'
  348. codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
  349. .Ed
  350. .Pp
  351. \fBNNN_SSHFS:\fR pass additional options to sshfs command:
  352. .Bd -literal
  353. export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
  354. NOTE: The options must be preceded by `sshfs` and comma-separated without any space between them.
  355. .Ed
  356. .Pp
  357. \fBNNN_RCLONE:\fR pass additional options to rclone command:
  358. .Bd -literal
  359. export NNN_RCLONE='rclone mount --read-only --no-checksum'
  360. NOTE: The options must be preceded by `rclone` and max 5 flags are supported.
  361. .Ed
  362. .Pp
  363. \fBNNN_TRASH:\fR trash (instead of \fIdelete\fR) files to desktop Trash.
  364. .Bd -literal
  365. export NNN_TRASH=1
  366. .Ed
  367. .Pp
  368. \fBnnn:\fR this is a special variable set to the hovered entry before executing
  369. a command from the command prompt or spawning a shell.
  370. .Sh KNOWN ISSUES
  371. .Nm
  372. may not handle keypresses correctly when used with tmux (see issue #104 for
  373. more details). Set \fBTERM=xterm-256color\fR to address it.
  374. .Sh AUTHORS
  375. .An Arun Prakash Jana Aq Mt engineerarun@gmail.com ,
  376. .An Lazaros Koromilas Aq Mt lostd@2f30.org ,
  377. .An Dimitris Papastamos Aq Mt sin@2f30.org .
  378. .Sh HOME
  379. .Em https://github.com/jarun/nnn