My build of nnn with minor changes
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

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