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.
 
 
 
 
 
 

257 lines
8.5 KiB

  1. .Dd Oct 06, 2019
  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 name
  14. .Op Ar -E
  15. .Op Ar -f
  16. .Op Ar -H
  17. .Op Ar -i
  18. .Op Ar -K
  19. .Op Ar -n
  20. .Op Ar -p file
  21. .Op Ar -r
  22. .Op Ar -s
  23. .Op Ar -S
  24. .Op Ar -v
  25. .Op Ar -h
  26. .Op Ar PATH
  27. .Sh DESCRIPTION
  28. .Nm
  29. (Nnn's Not Noice) is a performance-optimized, feature-packed fork of noice (http://git.2f30.org/noice/) with seamless desktop integration, simplified navigation, \fInavigate-as-you-type\fR mode with auto select, disk usage analyzer mode, bookmarks, contexts, application launcher, familiar navigation shortcuts, subshell spawning and much more. It remains a simple and efficient file manager that stays out of your way.
  30. .Pp
  31. .Nm
  32. opens the current working directory by default if
  33. .Ar PATH
  34. is not specified.
  35. .Sh KEYBINDS
  36. .Pp
  37. Press \fB?\fR in
  38. .Nm
  39. to see the list of keybinds.
  40. .Sh OPTIONS
  41. .Pp
  42. .Nm
  43. supports the following options:
  44. .Pp
  45. .Fl a
  46. use access time for all operations (default: modification time)
  47. .Pp
  48. .Fl "b key"
  49. specify bookmark key to open
  50. .Pp
  51. .Fl c
  52. opener opens files in cli utilities only
  53. .Pp
  54. .Fl d
  55. detail mode
  56. .Pp
  57. .Fl "e name"
  58. load a session by name
  59. .Pp
  60. .Fl E
  61. use $EDITOR for internal undetached edits
  62. .Pp
  63. .Fl f
  64. run filter as command when the prompt key is pressed
  65. .Pp
  66. .Fl H
  67. show hidden files
  68. .Pp
  69. .Fl i
  70. start in navigate-as-you-type mode
  71. .Pp
  72. .Fl K
  73. test for keybind collision
  74. .Pp
  75. .Fl n
  76. use case-insensitive version compare to sort files
  77. .Pp
  78. .Fl o
  79. open files only on Enter key
  80. .Pp
  81. .Fl "p file"
  82. copy (or \fIpick\fR) selection to file, or stdout if file='-'
  83. .Pp
  84. .Fl r
  85. show cp, mv progress (Linux-only, needs advcpmv; '^T' shows the progress on BSD/macOS)
  86. .Pp
  87. .Fl s
  88. use substring match for filters instead of regex
  89. .Pp
  90. .Fl S
  91. start in disk usage analyzer mode
  92. .Pp
  93. .Fl t
  94. disable directory auto-select in navigate-as-you-type mode
  95. .Pp
  96. .Fl v
  97. show version and exit
  98. .Pp
  99. .Fl h
  100. show program help and exit
  101. .Sh CONFIGURATION
  102. .Nm
  103. uses \fIxdg-open\fR (on Linux) and \fIopen(1)\fR (on macOS) as the desktop opener.
  104. .Pp
  105. There is no configuration file. Associated files are stored in \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/\fR. Settings work on environment variables. See ENVIRONMENT section below.
  106. .Sh CONTEXTS
  107. Contexts serve the purpose of exploring multiple directories simultaneously. 4 contexts
  108. are available. The status of the contexts are shown in the top left corner:
  109. .Pp
  110. - the current context is in reverse video
  111. .br
  112. - other active contexts are underlined
  113. .br
  114. - rest are inactive
  115. .Pp
  116. On context creation, the state of the previous context is copied. Each context remembers its last visited directory.
  117. .Pp
  118. Each context can have its own directory color specified. See ENVIRONMENT section below.
  119. .Sh SESSIONS
  120. Sessions are a way to save and restore states of work. A session stores the settings and contexts.
  121. .Pp
  122. Sessions can be loaded dynamically from within a running
  123. .Nm
  124. instance, or with a program option.
  125. .Pp
  126. When a session is loaded dynamically, the last working session is saved automatically to a dedicated
  127. -- "last session" -- session file.
  128. .Pp
  129. All the session files are located in the \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR directory by the session name.
  130. "@" is the "last session" file.
  131. .Sh FILTERS
  132. Filters support regexes (default) to instantly (search-as-you-type) list the matching
  133. entries in the current directory.
  134. .Pp
  135. Common use cases:
  136. .Pp
  137. (1) To list all matches starting with the filter expression, start the expression
  138. with a '^' (caret) symbol.
  139. .br
  140. (2) Type '\\.mkv' to list all MKV files.
  141. .br
  142. (3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
  143. .Pp
  144. There is a program option to filter entries by substring match instead of regex.
  145. .Pp
  146. There is a program option to execute the current filter as a command when the prompt key is pressed.
  147. .Pp
  148. In the \fInavigate-as-you-type\fR mode directories are opened in filter mode,
  149. allowing continuous navigation. Works best with the \fBarrow keys\fR.
  150. .br
  151. When there's a unique match and it's a directory,
  152. .Nm
  153. auto selects the directory and enters it in this mode.
  154. .Sh SELECTION
  155. There are 3 groups of shortcuts to add files to selection:
  156. .Pp
  157. (1) add an individual file to selection
  158. .br
  159. (2) add a range of files to selection
  160. .br
  161. (3) add all files in the current directory to selection
  162. .Pp
  163. Selected files are visually indicated by a \fI+\fR before the entries.
  164. .br
  165. The selection can now be listed, copied, moved, removed, archived or linked.
  166. .br
  167. Absolute paths of the selected files are copied to the temporary file \fB.selection\fR in the config directory. The path is shown in the help and configuration screen. If \fB$NNN_COPIER\fR is set (see ENVIRONMENT section below) the file paths are also copied to the system clipboard.
  168. .Pp
  169. Repeat range selection on the same entry to clear selection. It's also possible to edit the current selection.
  170. .Pp
  171. Deselecting a single file is not implemented because substantial string processing would be required if thousands of files are selected. It would have been trivial if the selection was limited to a single directory (use a flag for each file and select the files with the flag set). However,
  172. .Nm
  173. allows selection across directories making it non-trivial to do that. Also, the buffer used to select is a compact one (no byte wasted) so \fBmemmove\fR() would be required to deselect each intermediate file. Considering these, the alternatives were chosen.
  174. .Sh FILE SIZE
  175. The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y (powers of 1024), same as the default units in \fIls\fR.
  176. .Sh ENVIRONMENT
  177. The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables take precedence
  178. when dealing with the !, e and p commands respectively. A single combination to arguments is supported for SHELL and PAGER.
  179. .Pp
  180. \fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs (max 10) separated by
  181. \fI;\fR:
  182. .Bd -literal
  183. export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
  184. NOTE: To go to a bookmark, press the Lead key followed by the bookmark key.
  185. .Ed
  186. .Pp
  187. \fBNNN_PLUG:\fR directly executable plugins as \fIkey_char:location\fR pairs (max 10) separated by
  188. \fI;\fR:
  189. .Bd -literal
  190. export NNN_PLUG='o:fzopen;p:mocplay;d:diffs;m:nmount;t:imgthumb;i:mediainf'
  191. NOTE: To run a plugin directly, press \fI:\fR followed by the plugin key.
  192. .Ed
  193. .Pp
  194. To assign keys to arbitrary non-background non-shell-interpreted cli
  195. commands and invoke like plugins, add \fI_\fR (underscore) before the command.
  196. .Bd -literal
  197. export NNN_PLUG='x:_chmod +x $nnn;g:_git log;s:_smplayer $nnn;o:fzopen'
  198. NOTES:
  199. 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
  200. 2. $nnn should be the last argument (IF you want to pass the hovered file name)
  201. 3. (Again) add \fI_\fR before the command
  202. .Ed
  203. .Pp
  204. \fBNNN_USE_EDITOR:\fR use VISUAL (else EDITOR, preferably CLI, fallback vi) to handle text files.
  205. .Bd -literal
  206. export NNN_USE_EDITOR=1
  207. .Ed
  208. .Pp
  209. \fBNNN_CONTEXT_COLORS:\fR string of color codes for each context, e.g.:
  210. .Bd -literal
  211. export NNN_CONTEXT_COLORS='1234'
  212. codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
  213. .Ed
  214. .Pp
  215. \fBNNN_SSHFS_OPTS:\fR pass additional options to sshfs command:
  216. .Bd -literal
  217. export NNN_SSHFS_OPTS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
  218. NOTE: The options must be preceded by `sshfs` and comma-separated without any space between them.
  219. .Ed
  220. .Pp
  221. \fBNNN_RCLONE_OPTS:\fR pass additional options to rclone command:
  222. .Bd -literal
  223. export NNN_RCLONE_OPTS='rclone mount --read-only --no-checksum'
  224. NOTE: The options must be preceded by `rclone` and max 5 flags are supported.
  225. .Ed
  226. .Pp
  227. \fBNNN_OPENER:\fR specify a custom file opener.
  228. .Bd -literal
  229. export NNN_OPENER=mimeopen
  230. .Ed
  231. .Pp
  232. \fBNNN_IDLE_TIMEOUT:\fR set idle timeout (in seconds) to invoke terminal locker (default: disabled).
  233. .Pp
  234. \fBNNN_COPIER:\fR system clipboard copier script. The project page has some sample copier scripts.
  235. .Pp
  236. \fBNNN_TRASH:\fR trash (instead of \fIdelete\fR) files to desktop Trash.
  237. .Bd -literal
  238. export NNN_TRASH=1
  239. .Ed
  240. .Pp
  241. \fBNNN:\fR this is a special variable set to the current entry before executing a command from the command prompt or spawning a shell.
  242. .Sh KNOWN ISSUES
  243. .Nm
  244. may not handle keypresses correctly when used with tmux (see issue #104 for more details). Set \fBTERM=xterm-256color\fR to address it.
  245. .Sh AUTHORS
  246. .An Arun Prakash Jana Aq Mt engineerarun@gmail.com ,
  247. .An Lazaros Koromilas Aq Mt lostd@2f30.org ,
  248. .An Dimitris Papastamos Aq Mt sin@2f30.org .
  249. .Sh HOME
  250. .Em https://github.com/jarun/nnn