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.
 
 
 
 
 
 

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