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.

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