My build of nnn with minor changes
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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