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

452 行
13 KiB

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