retrovim 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/.conda/retrovim.yaml +259 -0
  2. package/.conda/terax.icns +0 -0
  3. package/.conda/terax.ico +0 -0
  4. package/.conda/terax.png +0 -0
  5. package/.github/workflows/release.yml +95 -0
  6. package/.gitmodules +3 -0
  7. package/.npm/kanata_touchcursor.js +28 -0
  8. package/.npm/nvim.js +26 -0
  9. package/.npm/yazi.js +26 -0
  10. package/.npm/zsh.js +17 -0
  11. package/.pip/kanata_touchcursor/__init__.py +28 -0
  12. package/.pip/nvim/__init__.py +31 -0
  13. package/.pip/yazi/__init__.py +31 -0
  14. package/.pip/zsh/__init__.py +22 -0
  15. package/CHANGELOG.md +26 -0
  16. package/LICENSE +674 -0
  17. package/README.md +336 -0
  18. package/kanata/touchcursor.kbd +164 -0
  19. package/nvim/init.lua +813 -0
  20. package/nvim/plugins/mini.nvim/.github/DISCUSSION_TEMPLATE/q-a.yml +72 -0
  21. package/nvim/plugins/mini.nvim/.github/ISSUE_TEMPLATE/bug-report.yml +136 -0
  22. package/nvim/plugins/mini.nvim/.github/ISSUE_TEMPLATE/config.yml +5 -0
  23. package/nvim/plugins/mini.nvim/.github/ISSUE_TEMPLATE/feature-request.yml +75 -0
  24. package/nvim/plugins/mini.nvim/.github/PULL_REQUEST_TEMPLATE.md +2 -0
  25. package/nvim/plugins/mini.nvim/.github/workflows/quality-control.yml +150 -0
  26. package/nvim/plugins/mini.nvim/.pre-commit-config.yaml +20 -0
  27. package/nvim/plugins/mini.nvim/.stylua.toml +7 -0
  28. package/nvim/plugins/mini.nvim/.styluaignore +1 -0
  29. package/nvim/plugins/mini.nvim/CHANGELOG.md +1894 -0
  30. package/nvim/plugins/mini.nvim/CODE_OF_CONDUCT.md +132 -0
  31. package/nvim/plugins/mini.nvim/CONTRIBUTING.md +331 -0
  32. package/nvim/plugins/mini.nvim/LICENSE +21 -0
  33. package/nvim/plugins/mini.nvim/MAINTAINING.md +330 -0
  34. package/nvim/plugins/mini.nvim/Makefile +51 -0
  35. package/nvim/plugins/mini.nvim/README.md +261 -0
  36. package/nvim/plugins/mini.nvim/TESTING.md +1011 -0
  37. package/nvim/plugins/mini.nvim/benchmarks/starter/README.md +35 -0
  38. package/nvim/plugins/mini.nvim/benchmarks/starter/benchmark.sh +56 -0
  39. package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_dashboard-alpha.lua +21 -0
  40. package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_dashboard-original.lua +17 -0
  41. package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_dashboard-starter.lua +18 -0
  42. package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_empty.lua +4 -0
  43. package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_starter-default.lua +7 -0
  44. package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_startify-alpha.lua +10 -0
  45. package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_startify-original.lua +7 -0
  46. package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_startify-starter.lua +20 -0
  47. package/nvim/plugins/mini.nvim/benchmarks/starter/install.sh +10 -0
  48. package/nvim/plugins/mini.nvim/benchmarks/starter/make_summary.py +68 -0
  49. package/nvim/plugins/mini.nvim/benchmarks/starter/startup-summary.md +10 -0
  50. package/nvim/plugins/mini.nvim/colors/miniautumn.lua +55 -0
  51. package/nvim/plugins/mini.nvim/colors/minicyan.lua +95 -0
  52. package/nvim/plugins/mini.nvim/colors/minischeme.lua +95 -0
  53. package/nvim/plugins/mini.nvim/colors/minispring.lua +53 -0
  54. package/nvim/plugins/mini.nvim/colors/minisummer.lua +49 -0
  55. package/nvim/plugins/mini.nvim/colors/miniwinter.lua +51 -0
  56. package/nvim/plugins/mini.nvim/colors/randomhue.lua +16 -0
  57. package/nvim/plugins/mini.nvim/doc/mini-ai.txt +889 -0
  58. package/nvim/plugins/mini.nvim/doc/mini-align.txt +923 -0
  59. package/nvim/plugins/mini.nvim/doc/mini-animate.txt +937 -0
  60. package/nvim/plugins/mini.nvim/doc/mini-base16.txt +285 -0
  61. package/nvim/plugins/mini.nvim/doc/mini-basics.txt +359 -0
  62. package/nvim/plugins/mini.nvim/doc/mini-bracketed.txt +622 -0
  63. package/nvim/plugins/mini.nvim/doc/mini-bufremove.txt +123 -0
  64. package/nvim/plugins/mini.nvim/doc/mini-clue.txt +760 -0
  65. package/nvim/plugins/mini.nvim/doc/mini-cmdline.txt +392 -0
  66. package/nvim/plugins/mini.nvim/doc/mini-colors.txt +880 -0
  67. package/nvim/plugins/mini.nvim/doc/mini-comment.txt +230 -0
  68. package/nvim/plugins/mini.nvim/doc/mini-completion.txt +477 -0
  69. package/nvim/plugins/mini.nvim/doc/mini-cursorword.txt +105 -0
  70. package/nvim/plugins/mini.nvim/doc/mini-deps.txt +590 -0
  71. package/nvim/plugins/mini.nvim/doc/mini-diff.txt +661 -0
  72. package/nvim/plugins/mini.nvim/doc/mini-doc.txt +434 -0
  73. package/nvim/plugins/mini.nvim/doc/mini-extra.txt +856 -0
  74. package/nvim/plugins/mini.nvim/doc/mini-files.txt +1018 -0
  75. package/nvim/plugins/mini.nvim/doc/mini-fuzzy.txt +160 -0
  76. package/nvim/plugins/mini.nvim/doc/mini-git.txt +425 -0
  77. package/nvim/plugins/mini.nvim/doc/mini-hipatterns.txt +489 -0
  78. package/nvim/plugins/mini.nvim/doc/mini-hues.txt +420 -0
  79. package/nvim/plugins/mini.nvim/doc/mini-icons.txt +508 -0
  80. package/nvim/plugins/mini.nvim/doc/mini-indentscope.txt +485 -0
  81. package/nvim/plugins/mini.nvim/doc/mini-input.txt +932 -0
  82. package/nvim/plugins/mini.nvim/doc/mini-jump.txt +202 -0
  83. package/nvim/plugins/mini.nvim/doc/mini-jump2d.txt +525 -0
  84. package/nvim/plugins/mini.nvim/doc/mini-keymap.txt +449 -0
  85. package/nvim/plugins/mini.nvim/doc/mini-map.txt +717 -0
  86. package/nvim/plugins/mini.nvim/doc/mini-misc.txt +431 -0
  87. package/nvim/plugins/mini.nvim/doc/mini-move.txt +181 -0
  88. package/nvim/plugins/mini.nvim/doc/mini-notify.txt +434 -0
  89. package/nvim/plugins/mini.nvim/doc/mini-nvim.txt +431 -0
  90. package/nvim/plugins/mini.nvim/doc/mini-operators.txt +472 -0
  91. package/nvim/plugins/mini.nvim/doc/mini-pairs.txt +346 -0
  92. package/nvim/plugins/mini.nvim/doc/mini-pick.txt +1535 -0
  93. package/nvim/plugins/mini.nvim/doc/mini-sessions.txt +239 -0
  94. package/nvim/plugins/mini.nvim/doc/mini-snippets.txt +1291 -0
  95. package/nvim/plugins/mini.nvim/doc/mini-splitjoin.txt +536 -0
  96. package/nvim/plugins/mini.nvim/doc/mini-starter.txt +618 -0
  97. package/nvim/plugins/mini.nvim/doc/mini-statusline.txt +361 -0
  98. package/nvim/plugins/mini.nvim/doc/mini-surround.txt +863 -0
  99. package/nvim/plugins/mini.nvim/doc/mini-tabline.txt +151 -0
  100. package/nvim/plugins/mini.nvim/doc/mini-test.txt +966 -0
  101. package/nvim/plugins/mini.nvim/doc/mini-trailspace.txt +91 -0
  102. package/nvim/plugins/mini.nvim/doc/mini-visits.txt +937 -0
  103. package/nvim/plugins/mini.nvim/logo.png +0 -0
  104. package/nvim/plugins/mini.nvim/lua/mini/ai.lua +2244 -0
  105. package/nvim/plugins/mini.nvim/lua/mini/align.lua +2076 -0
  106. package/nvim/plugins/mini.nvim/lua/mini/animate.lua +2127 -0
  107. package/nvim/plugins/mini.nvim/lua/mini/base16.lua +1752 -0
  108. package/nvim/plugins/mini.nvim/lua/mini/basics.lua +772 -0
  109. package/nvim/plugins/mini.nvim/lua/mini/bracketed.lua +2013 -0
  110. package/nvim/plugins/mini.nvim/lua/mini/bufremove.lua +283 -0
  111. package/nvim/plugins/mini.nvim/lua/mini/clue.lua +2096 -0
  112. package/nvim/plugins/mini.nvim/lua/mini/cmdline.lua +1182 -0
  113. package/nvim/plugins/mini.nvim/lua/mini/colors.lua +2483 -0
  114. package/nvim/plugins/mini.nvim/lua/mini/comment.lua +586 -0
  115. package/nvim/plugins/mini.nvim/lua/mini/completion.lua +2094 -0
  116. package/nvim/plugins/mini.nvim/lua/mini/cursorword.lua +311 -0
  117. package/nvim/plugins/mini.nvim/lua/mini/deps.lua +1660 -0
  118. package/nvim/plugins/mini.nvim/lua/mini/diff.lua +1938 -0
  119. package/nvim/plugins/mini.nvim/lua/mini/doc.lua +1371 -0
  120. package/nvim/plugins/mini.nvim/lua/mini/extra.lua +2290 -0
  121. package/nvim/plugins/mini.nvim/lua/mini/files.lua +3145 -0
  122. package/nvim/plugins/mini.nvim/lua/mini/fuzzy.lua +356 -0
  123. package/nvim/plugins/mini.nvim/lua/mini/git.lua +1737 -0
  124. package/nvim/plugins/mini.nvim/lua/mini/hipatterns.lua +1042 -0
  125. package/nvim/plugins/mini.nvim/lua/mini/hues.lua +2088 -0
  126. package/nvim/plugins/mini.nvim/lua/mini/icons.lua +2254 -0
  127. package/nvim/plugins/mini.nvim/lua/mini/indentscope.lua +1158 -0
  128. package/nvim/plugins/mini.nvim/lua/mini/init.lua +427 -0
  129. package/nvim/plugins/mini.nvim/lua/mini/input.lua +2183 -0
  130. package/nvim/plugins/mini.nvim/lua/mini/jump.lua +609 -0
  131. package/nvim/plugins/mini.nvim/lua/mini/jump2d.lua +1244 -0
  132. package/nvim/plugins/mini.nvim/lua/mini/keymap.lua +880 -0
  133. package/nvim/plugins/mini.nvim/lua/mini/map.lua +1709 -0
  134. package/nvim/plugins/mini.nvim/lua/mini/misc.lua +969 -0
  135. package/nvim/plugins/mini.nvim/lua/mini/move.lua +509 -0
  136. package/nvim/plugins/mini.nvim/lua/mini/notify.lua +938 -0
  137. package/nvim/plugins/mini.nvim/lua/mini/operators.lua +1349 -0
  138. package/nvim/plugins/mini.nvim/lua/mini/pairs.lua +657 -0
  139. package/nvim/plugins/mini.nvim/lua/mini/pick.lua +3876 -0
  140. package/nvim/plugins/mini.nvim/lua/mini/sessions.lua +689 -0
  141. package/nvim/plugins/mini.nvim/lua/mini/snippets.lua +2828 -0
  142. package/nvim/plugins/mini.nvim/lua/mini/splitjoin.lua +1132 -0
  143. package/nvim/plugins/mini.nvim/lua/mini/starter.lua +1599 -0
  144. package/nvim/plugins/mini.nvim/lua/mini/statusline.lua +686 -0
  145. package/nvim/plugins/mini.nvim/lua/mini/surround.lua +2388 -0
  146. package/nvim/plugins/mini.nvim/lua/mini/tabline.lua +564 -0
  147. package/nvim/plugins/mini.nvim/lua/mini/test.lua +2516 -0
  148. package/nvim/plugins/mini.nvim/lua/mini/trailspace.lua +215 -0
  149. package/nvim/plugins/mini.nvim/lua/mini/visits.lua +1577 -0
  150. package/nvim/plugins/mini.nvim/readmes/mini-ai.md +190 -0
  151. package/nvim/plugins/mini.nvim/readmes/mini-align.md +203 -0
  152. package/nvim/plugins/mini.nvim/readmes/mini-animate.md +214 -0
  153. package/nvim/plugins/mini.nvim/readmes/mini-base16.md +198 -0
  154. package/nvim/plugins/mini.nvim/readmes/mini-basics.md +184 -0
  155. package/nvim/plugins/mini.nvim/readmes/mini-bracketed.md +193 -0
  156. package/nvim/plugins/mini.nvim/readmes/mini-bufremove.md +139 -0
  157. package/nvim/plugins/mini.nvim/readmes/mini-clue.md +260 -0
  158. package/nvim/plugins/mini.nvim/readmes/mini-cmdline.md +183 -0
  159. package/nvim/plugins/mini.nvim/readmes/mini-colors.md +169 -0
  160. package/nvim/plugins/mini.nvim/readmes/mini-comment.md +183 -0
  161. package/nvim/plugins/mini.nvim/readmes/mini-completion.md +217 -0
  162. package/nvim/plugins/mini.nvim/readmes/mini-cursorword.md +137 -0
  163. package/nvim/plugins/mini.nvim/readmes/mini-deps.md +271 -0
  164. package/nvim/plugins/mini.nvim/readmes/mini-diff.md +289 -0
  165. package/nvim/plugins/mini.nvim/readmes/mini-doc.md +198 -0
  166. package/nvim/plugins/mini.nvim/readmes/mini-extra.md +158 -0
  167. package/nvim/plugins/mini.nvim/readmes/mini-files.md +247 -0
  168. package/nvim/plugins/mini.nvim/readmes/mini-fuzzy.md +134 -0
  169. package/nvim/plugins/mini.nvim/readmes/mini-git.md +168 -0
  170. package/nvim/plugins/mini.nvim/readmes/mini-hipatterns.md +176 -0
  171. package/nvim/plugins/mini.nvim/readmes/mini-hues.md +285 -0
  172. package/nvim/plugins/mini.nvim/readmes/mini-icons.md +183 -0
  173. package/nvim/plugins/mini.nvim/readmes/mini-indentscope.md +191 -0
  174. package/nvim/plugins/mini.nvim/readmes/mini-input.md +163 -0
  175. package/nvim/plugins/mini.nvim/readmes/mini-jump.md +161 -0
  176. package/nvim/plugins/mini.nvim/readmes/mini-jump2d.md +197 -0
  177. package/nvim/plugins/mini.nvim/readmes/mini-keymap.md +205 -0
  178. package/nvim/plugins/mini.nvim/readmes/mini-map.md +191 -0
  179. package/nvim/plugins/mini.nvim/readmes/mini-misc.md +145 -0
  180. package/nvim/plugins/mini.nvim/readmes/mini-move.md +163 -0
  181. package/nvim/plugins/mini.nvim/readmes/mini-notify.md +175 -0
  182. package/nvim/plugins/mini.nvim/readmes/mini-operators.md +193 -0
  183. package/nvim/plugins/mini.nvim/readmes/mini-pairs.md +158 -0
  184. package/nvim/plugins/mini.nvim/readmes/mini-pick.md +340 -0
  185. package/nvim/plugins/mini.nvim/readmes/mini-sessions.md +164 -0
  186. package/nvim/plugins/mini.nvim/readmes/mini-snippets.md +373 -0
  187. package/nvim/plugins/mini.nvim/readmes/mini-splitjoin.md +194 -0
  188. package/nvim/plugins/mini.nvim/readmes/mini-starter.md +176 -0
  189. package/nvim/plugins/mini.nvim/readmes/mini-statusline.md +155 -0
  190. package/nvim/plugins/mini.nvim/readmes/mini-surround.md +190 -0
  191. package/nvim/plugins/mini.nvim/readmes/mini-tabline.md +156 -0
  192. package/nvim/plugins/mini.nvim/readmes/mini-test.md +175 -0
  193. package/nvim/plugins/mini.nvim/readmes/mini-trailspace.md +137 -0
  194. package/nvim/plugins/mini.nvim/readmes/mini-visits.md +243 -0
  195. package/nvim/plugins/mini.nvim/scripts/dual_log.sh +13 -0
  196. package/nvim/plugins/mini.nvim/scripts/dual_push.sh +15 -0
  197. package/nvim/plugins/mini.nvim/scripts/dual_release.sh +102 -0
  198. package/nvim/plugins/mini.nvim/scripts/dual_sync.sh +115 -0
  199. package/nvim/plugins/mini.nvim/scripts/init-deps-example.lua +59 -0
  200. package/nvim/plugins/mini.nvim/scripts/lint-filename-length.sh +16 -0
  201. package/nvim/plugins/mini.nvim/scripts/lintcommit-ci.sh +18 -0
  202. package/nvim/plugins/mini.nvim/scripts/lintcommit.lua +393 -0
  203. package/nvim/plugins/mini.nvim/scripts/minidoc.lua +57 -0
  204. package/nvim/plugins/mini.nvim/scripts/minimal_init.lua +28 -0
  205. package/nvim/plugins/mini.nvim/scripts/minitest.lua +4 -0
  206. package/package.json +16 -0
  207. package/pyproject.toml +43 -0
  208. package/yazi/init.lua +12 -0
  209. package/yazi/keymap.toml +114 -0
  210. package/yazi/lesskey +5 -0
  211. package/yazi/plugins/bookmarks.yazi/main.lua +86 -0
  212. package/yazi/plugins/cd-git-root.yazi/main.lua +31 -0
  213. package/yazi/plugins/smart-enter.yazi/main.lua +11 -0
  214. package/yazi/theme.toml +26 -0
  215. package/yazi/yazi.toml +15 -0
  216. package/zsh/.zshrc +145 -0
  217. package/zsh/starship.toml +20 -0
  218. package/zsh/zsh-patina.toml +2 -0
@@ -0,0 +1,1018 @@
1
+ *mini.files* Navigate and manipulate file system
2
+
3
+ MIT License Copyright (c) 2023 Evgeni Chasnovski
4
+
5
+ ------------------------------------------------------------------------------
6
+ *MiniFiles*
7
+ Features:
8
+ - Navigate file system using column view (Miller columns) to display nested
9
+ directories. See |MiniFiles-navigation| for overview.
10
+
11
+ - Opt-in preview of file or directory under cursor.
12
+
13
+ - Manipulate files and directories by editing text buffers: create, delete,
14
+ rename (all three are LSP aware), copy, move.
15
+ See |MiniFiles-manipulation| for an overview.
16
+
17
+ - Use as default file explorer instead of `netrw`.
18
+
19
+ - Configurable:
20
+ - Filter/prefix/sort of file system entries.
21
+ - Mappings used for common explorer actions.
22
+ - UI options: whether to show preview of file/directory under cursor, etc.
23
+ - Bookmarks for quicker navigation.
24
+
25
+ What it doesn't do:
26
+ - Try to be replacement of system file explorer. It is mostly designed to
27
+ be used within Neovim to quickly explore file system structure, open
28
+ files, and perform some quick file system edits.
29
+
30
+ - Work on remote locations. Only local file system is supported.
31
+
32
+ - Provide built-in interactive toggle of content `filter` and `sort`.
33
+ See |MiniFiles-examples| for some common examples.
34
+
35
+ - Provide out of the box extra information like git or diagnostic status.
36
+ This can be achieved by setting |extmarks| on appropriate event(s)
37
+ (see |MiniFiles-events|)
38
+
39
+ Notes:
40
+ - This module is written and thoroughly tested on Linux. Support for other
41
+ platform/OS (like Windows or MacOS) is a goal, but there is no guarantee.
42
+
43
+ - This module silently reacts to not enough permissions:
44
+ - In case of missing file, check its or its parent read permissions.
45
+ - In case of no manipulation result, check write permissions.
46
+
47
+ # Dependencies ~
48
+
49
+ Suggested dependencies (provide extra functionality, will work without them):
50
+
51
+ - Enabled |mini.icons| module to show icons near file/directory names.
52
+ Falls back to [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons)
53
+ plugin or uses default icons.
54
+
55
+ # Setup ~
56
+
57
+ This module needs a setup with `require('mini.files').setup({})` (replace
58
+ `{}` with your `config` table). It will create global Lua table `MiniFiles`
59
+ which you can use for scripting or manually (with `:lua MiniFiles.*`).
60
+
61
+ See |MiniFiles.config| for available config settings.
62
+
63
+ You can override runtime config settings (like mappings or window options)
64
+ locally to buffer inside `vim.b.minifiles_config` which should have same
65
+ structure as `MiniFiles.config`. See |mini.nvim-buffer-local-config| for
66
+ more details.
67
+
68
+ # Comparisons ~
69
+
70
+ - [nvim-tree/nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua):
71
+ - Provides tree view of file system, while this module uses column view.
72
+ - File system manipulation is done with custom set of mappings for each
73
+ action, while this module is designed to do that by editing text.
74
+ - Has more out of the box functionality with extra configuration, while
75
+ this module has not (by design).
76
+
77
+ - [stevearc/oil.nvim](https://github.com/stevearc/oil.nvim):
78
+ - Uses single window to show information only about currently explored
79
+ directory, while this module uses column view to show whole currently
80
+ explored branch.
81
+ - Also uses text editing to manipulate file system entries.
82
+ - Can work for remote file systems, while this module can not (by design).
83
+ - Both provide LSP integration.
84
+
85
+ - [nvim-neo-tree/neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim):
86
+ - Compares to this module mostly the same as `nvim-tree/nvim-tree.lua`.
87
+
88
+ # Highlight groups ~
89
+ *MiniFiles-hl-groups*
90
+
91
+ - `MiniFilesBorder` - border of regular windows.
92
+ - `MiniFilesBorderModified` - border of windows showing modified buffer.
93
+ - `MiniFilesCursorLine` - cursor line in explorer windows.
94
+ - `MiniFilesDirectory` - text and icon representing directory.
95
+ - `MiniFilesFile` - text representing file.
96
+ - `MiniFilesNormal` - basic foreground/background highlighting.
97
+ - `MiniFilesTitle` - title of regular windows.
98
+ - `MiniFilesTitleFocused` - title of focused window.
99
+
100
+ To change any highlight group, set it directly with |nvim_set_hl()|.
101
+
102
+ # Disabling ~
103
+
104
+ This plugin provides only manually started functionality, so no disabling
105
+ is available.
106
+
107
+ ------------------------------------------------------------------------------
108
+ *MiniFiles-navigation*
109
+ Every navigation starts by calling |MiniFiles.open()|, either directly or via
110
+ mapping (see its help for examples of some common scenarios). It will show
111
+ an explorer consisting of side-by-side floating windows with the following
112
+ principles:
113
+
114
+ - Explorer shows one branch of nested directories at a time.
115
+
116
+ - Explorer consists from several windows:
117
+
118
+ - Each window displays entries of a single directory in a modifiable
119
+ scratch buffer.
120
+
121
+ - Windows are organized left to right: for any particular window the left
122
+ neighbor is its parent directory and right neighbor - its child.
123
+
124
+ - Explorer windows are the viewport to some part of current branch, meaning
125
+ that their opening/closing does not affect the branch. This matters, for
126
+ example, if there are more elements in the branch than can be shown windows.
127
+
128
+ - Every buffer line represents separate file system entry following certain
129
+ format (not visible for users by default; set |'conceallevel'| to 0 to see it)
130
+
131
+ - Once directory is shown, its buffer is not updated automatically following
132
+ external file system changes. Manually use |MiniFiles.synchronize()| for that.
133
+
134
+ After opening explorer, in-buffer navigation is done the same way as any
135
+ regular buffer, except without some keys reserved for built-in actions.
136
+
137
+ Most common ways to navigate are:
138
+
139
+ - Press `j` to move cursor onto next (lower) entry in current directory.
140
+ - Press `k` to move cursor onto previous (higher) entry in current directory.
141
+ - Press `l` to expand entry under cursor (see "Go in" action).
142
+ - Press `h` to focus on parent directory (see "Go out" action).
143
+
144
+ Cursor positions in each directory buffer are tracked and saved during
145
+ navigation. This allows for more convenient repeated navigation to some
146
+ previously visited branch.
147
+
148
+ Available built-in actions (see "Details" for more information): >
149
+
150
+ | Action | Keys | Description |
151
+ |-------------|------|------------------------------------------------|
152
+ | Close | q | Close explorer |
153
+ |-------------|------|------------------------------------------------|
154
+ | Go in | l | Expand entry (show directory or open file) |
155
+ |-------------|------|------------------------------------------------|
156
+ | Go in plus | L | Expand entry plus extra action |
157
+ |-------------|------|------------------------------------------------|
158
+ | Go out | h | Focus on parent directory |
159
+ |-------------|------|------------------------------------------------|
160
+ | Go out plus | H | Focus on parent directory plus extra action |
161
+ |-------------|------|------------------------------------------------|
162
+ | Go to mark | ' | Jump to bookmark (waits for single key id) |
163
+ |-------------|------|------------------------------------------------|
164
+ | Set mark | m | Set bookmark (waits for single key id) |
165
+ |-------------|------|------------------------------------------------|
166
+ | Reset | <BS> | Reset current explorer |
167
+ |-------------|------|------------------------------------------------|
168
+ | Reveal cwd | @ | Reset current current working directory |
169
+ |-------------|------|------------------------------------------------|
170
+ | Show help | g? | Show help window |
171
+ |-------------|------|------------------------------------------------|
172
+ | Synchronize | = | Synchronize user edits and/or external changes |
173
+ |-------------|------|------------------------------------------------|
174
+ | Trim left | < | Trim left part of branch |
175
+ |-------------|------|------------------------------------------------|
176
+ | Trim right | > | Trim right part of branch |
177
+ |-------------|------|------------------------------------------------|
178
+ <
179
+ Details:
180
+
181
+ - "Go in":
182
+ - Always opens file in the latest window before `MiniFiles.open()` call.
183
+ - Never closes explorer.
184
+ - Works in linewise Visual mode to expand multiple entries.
185
+
186
+ - "Go in plus" is regular "Go in" but closes explorer after opening a file.
187
+
188
+ - "Go out plus" is regular "Go out" but trims right part of branch.
189
+
190
+ - "Set mark" and "Go to mark" both wait for user to press a single character
191
+ of a bookmark id. Example: `ma` sets directory path of focused window as
192
+ bookmark "a"; `'a` jumps (sets as whole branch) to bookmark "a".
193
+ Special bookmark `'` always points to path before the latest bookmark jump.
194
+
195
+ - "Reset" focuses only on "anchor" directory (the one used to open current
196
+ explorer) and resets all stored directory cursor positions.
197
+
198
+ - "Reveal cwd" extends branch to include |current-directory|.
199
+ If it is not an ancestor of the current branch, nothing is done.
200
+
201
+ - "Show help" results into new window with helpful information about current
202
+ explorer (like buffer mappings and bookmarks). Press `q` to close it.
203
+
204
+ - "Synchronize" parses user edits in directory buffers, applies them (after
205
+ confirmation), and updates all directory buffers with the most relevant
206
+ file system information. Can also be used without user edits to show up
207
+ to date file system entries.
208
+ See |MiniFiles-manipulation| for more info about file system manipulation.
209
+
210
+ - "Trim left" and "Trim right" trim parts of the whole branch, not only its
211
+ currently visible parts.
212
+
213
+ Notes:
214
+
215
+ - Each action has exported function with more details about it.
216
+
217
+ - Keys can be configured with `mappings` table of |MiniFiles.config|.
218
+
219
+ ------------------------------------------------------------------------------
220
+ *MiniFiles-manipulation*
221
+ File system manipulation is done by editing text inside directory buffers,
222
+ which are shown inside dedicated window(s). See |MiniFiles-navigation| for
223
+ more information about navigating to a particular directory.
224
+
225
+ General workflow:
226
+
227
+ - Navigate to the directory in which manipulation should be done.
228
+
229
+ - Edit buffer in the way representing file system action.
230
+
231
+ - Repeat previous steps until all necessary file system actions are recorded.
232
+ Note: even if directory buffer is hidden, its modifications are preserved,
233
+ so you can navigate in and out of directory with modified buffer.
234
+
235
+ - Execute |MiniFiles.synchronize()| (default key is `=`). This will prompt
236
+ confirmation dialog listing all file system actions (per directory) it is
237
+ about to perform. READ IT CAREFULLY.
238
+
239
+ - Confirm by pressing `y` / `<CR>` (apply edits and update buffers) or
240
+ don't confirm by pressing `n` / `<Esc>` (update buffers without applying edits).
241
+
242
+ Note: prefer small and not related steps with more frequent synchronization
243
+ over single complex manipulation. There are (known) cases which won't work.
244
+
245
+ # How does it work ~
246
+
247
+ All manipulation functionality is powered by creating and keeping track of
248
+ path indexes: text of the form `/xxx` (`xxx` is the number path index) placed
249
+ at the start of every line representing file system entry.
250
+
251
+ By default they are hidden as concealed text (along with prefix separators)
252
+ for more convenience but you can see them by setting |'conceallevel'| to 0.
253
+ DO NOT modify text to the left of entry name.
254
+
255
+ During synchronization, actual text for entry name is compared to path index
256
+ at that line (if present) to deduce which file system action to perform.
257
+ Note that order of text manipulation steps does not affect performed actions.
258
+
259
+ # Supported file system actions ~
260
+
261
+ ## Create ~
262
+
263
+ - Create file by creating new line with file name (including extension).
264
+
265
+ - Create directory by creating new line with directory name followed by `/`.
266
+
267
+ - Create file or directory inside nested directories by creating new line
268
+ with text like `dir/nested-dir/` or `dir/nested-dir/file`.
269
+ Always use `/` on any OS.
270
+
271
+ ## Delete ~
272
+
273
+ - Delete file or directory by deleting WHOLE LINE describing it.
274
+
275
+ - If `options.permanent_delete` is `true`, delete is permanent. Otherwise
276
+ file system entry is moved to a module-specific trash directory
277
+ (see |MiniFiles.config| for more details).
278
+
279
+ ## Rename ~
280
+
281
+ - Rename file or directory by editing its name (not icon or path index to
282
+ the left of it).
283
+
284
+ - With default mappings for `h` / `l` it might be not convenient to rename
285
+ only part of an entry. You can adopt any of the following approaches:
286
+ - Use different motions, like |$|, |e|, |f|, etc.
287
+ - Go into Insert mode and navigate inside it.
288
+ - Change mappings to be more suited for manipulation and not navigation.
289
+ See "Mappings" section in |MiniFiles.config|.
290
+
291
+ - It is not needed to end directory name with `/`.
292
+
293
+ - Appending `/` to a file name will delete it and create empty directory
294
+ with the same name.
295
+
296
+ - Cyclic renames ("a" to "b" and "b" to "a") are not supported.
297
+
298
+ ## Copy ~
299
+
300
+ - Copy file or directory by copying WHOLE LINE describing it and pasting
301
+ it inside buffer of target directory.
302
+
303
+ - Change of target path is allowed. Edit only entry name in target location
304
+ (not icon or path index to the left of it).
305
+
306
+ - Copying inside same parent directory is supported only if target path has
307
+ different name.
308
+
309
+ - Copying inside child directory is supported.
310
+
311
+ ## Move ~
312
+
313
+ - Move file or directory by cutting WHOLE LINE describing it and then
314
+ pasting it inside target directory.
315
+
316
+ - Change of target path is allowed. Edit only entry name in target location
317
+ (not icon or path index to the left of it).
318
+
319
+ - Moving directory inside itself is not supported.
320
+
321
+ # LSP integration ~
322
+
323
+ Create, delete, and rename are LSP aware (on Neovim>=0.11): the information
324
+ is forwarded to all active LSP servers for them to perform additional actions.
325
+ This means that LSP servers can, for example, update imports after renaming
326
+ a file or populate a file with a boilerplate code after creation.
327
+
328
+ The actual changes depend entirely on the LSP server and whether it supports
329
+ relevant methods:
330
+ - `workspace/will{Create,Delete,Rename}Files` before a file system action.
331
+ - `workspace/did{Create,Delete,Rename}Files` after a file system action.
332
+
333
+ It can be disabled by setting `options.lsp_timeout = 0` in |MiniFiles.config|.
334
+
335
+ ------------------------------------------------------------------------------
336
+ *MiniFiles-events*
337
+ To allow user customization and integration of external tools, certain |User|
338
+ autocommand events are triggered under common circumstances.
339
+
340
+ # UI events ~
341
+
342
+ - `MiniFilesExplorerOpen` - just after explorer finishes opening.
343
+
344
+ - `MiniFilesExplorerClose` - just before explorer starts closing.
345
+
346
+ - `MiniFilesBufferCreate` - when buffer is created to show a particular
347
+ directory/file. Triggered once per path during explorer session.
348
+ Can be used to create buffer-local mappings.
349
+
350
+ - `MiniFilesBufferUpdate` - when path buffer is updated with new content.
351
+ Can be used for integrations to set useful |extmarks|.
352
+
353
+ - `MiniFilesWindowOpen` - when new window is opened. Can be used to set
354
+ window-local settings (like border, |'winblend'|, etc.)
355
+
356
+ - `MiniFilesWindowUpdate` - when a window is updated. Triggers VERY frequently.
357
+ At least after every cursor movement and "go in" / "go out" action.
358
+
359
+ Callback for each buffer/window UI event will receive <data> field
360
+ (see |nvim_create_autocmd()|) with the following information:
361
+
362
+ - <buf_id> - index of target buffer.
363
+ - <win_id> - index of target window. Can be `nil`, like in
364
+ `MiniFilesBufferCreate` and buffer's first `MiniFilesBufferUpdate` as
365
+ they are triggered before window is created.
366
+
367
+ # File action events ~
368
+
369
+ - `MiniFilesActionCreate` - after entry is successfully created.
370
+
371
+ - `MiniFilesActionDelete` - after entry is successfully deleted.
372
+
373
+ - `MiniFilesActionRename` - after entry is successfully renamed.
374
+
375
+ - `MiniFilesActionCopy` - after entry is successfully copied.
376
+
377
+ - `MiniFilesActionMove` - after entry is successfully moved.
378
+
379
+ Callback for each file action event will receive `data` field
380
+ (see |nvim_create_autocmd()|) with the following information:
381
+
382
+ - <action> - string with action name.
383
+ - <from> - full path of entry before action (`nil` for "create" action).
384
+ - <to> - full path of entry after action (`nil` for permanent "delete" action).
385
+
386
+ ------------------------------------------------------------------------------
387
+ *MiniFiles-examples*
388
+ # Toggle explorer ~
389
+
390
+ Use a combination of |MiniFiles.open()| and |MiniFiles.close()|: >lua
391
+
392
+ local minifiles_toggle = function(...)
393
+ if not MiniFiles.close() then MiniFiles.open(...) end
394
+ end
395
+ <
396
+ # Customize windows ~
397
+
398
+ For most of the common customizations using `MiniFilesWindowOpen` event
399
+ autocommand is the suggested approach: >lua
400
+
401
+ vim.api.nvim_create_autocmd('User', {
402
+ pattern = 'MiniFilesWindowOpen',
403
+ callback = function(args)
404
+ local win_id = args.data.win_id
405
+
406
+ -- Customize window-local settings
407
+ vim.wo[win_id].winblend = 50
408
+ local config = vim.api.nvim_win_get_config(win_id)
409
+ config.border, config.title_pos = 'double', 'right'
410
+ vim.api.nvim_win_set_config(win_id, config)
411
+ end,
412
+ })
413
+ <
414
+ However, some parts (like window title and height) of window config are later
415
+ updated internally. Use `MiniFilesWindowUpdate` event for them: >lua
416
+
417
+ vim.api.nvim_create_autocmd('User', {
418
+ pattern = 'MiniFilesWindowUpdate',
419
+ callback = function(args)
420
+ local config = vim.api.nvim_win_get_config(args.data.win_id)
421
+
422
+ -- Ensure fixed height
423
+ config.height = 10
424
+
425
+ -- Ensure no title padding
426
+ local n = #config.title
427
+ config.title[1][1] = config.title[1][1]:gsub('^ ', '')
428
+ config.title[n][1] = config.title[n][1]:gsub(' $', '')
429
+
430
+ vim.api.nvim_win_set_config(args.data.win_id, config)
431
+ end,
432
+ })
433
+ <
434
+ # Customize icons ~
435
+
436
+ Use different directory icon (if you don't use |mini.icons|): >lua
437
+
438
+ local my_prefix = function(fs_entry)
439
+ if fs_entry.fs_type == 'directory' then
440
+ -- NOTE: it is usually a good idea to use icon followed by space
441
+ return ' ', 'MiniFilesDirectory'
442
+ end
443
+ return MiniFiles.default_prefix(fs_entry)
444
+ end
445
+
446
+ require('mini.files').setup({ content = { prefix = my_prefix } })
447
+ <
448
+ Show no icons: >lua
449
+
450
+ require('mini.files').setup({ content = { prefix = function() end } })
451
+ <
452
+ # Create mapping to show/hide dot-files ~
453
+
454
+ Create an autocommand for `MiniFilesBufferCreate` event which calls
455
+ |MiniFiles.refresh()| with explicit `content.filter` functions: >lua
456
+
457
+ local show_dotfiles = true
458
+
459
+ local filter_show = function(fs_entry) return true end
460
+
461
+ local filter_hide = function(fs_entry)
462
+ return not vim.startswith(fs_entry.name, '.')
463
+ end
464
+
465
+ local toggle_dotfiles = function()
466
+ show_dotfiles = not show_dotfiles
467
+ local new_filter = show_dotfiles and filter_show or filter_hide
468
+ MiniFiles.refresh({ content = { filter = new_filter } })
469
+ end
470
+
471
+ vim.api.nvim_create_autocmd('User', {
472
+ pattern = 'MiniFilesBufferCreate',
473
+ callback = function(args)
474
+ local buf_id = args.data.buf_id
475
+ -- Tweak left-hand side of mapping to your liking
476
+ vim.keymap.set('n', 'g.', toggle_dotfiles, { buffer = buf_id })
477
+ end,
478
+ })
479
+ <
480
+ # Create mappings to modify target window via split ~
481
+
482
+ Combine |MiniFiles.get_explorer_state()| and |MiniFiles.set_target_window()|: >lua
483
+
484
+ local map_split = function(buf_id, lhs, direction)
485
+ local rhs = function()
486
+ -- Make new window and set it as target
487
+ local cur_target = MiniFiles.get_explorer_state().target_window
488
+ local new_target = vim.api.nvim_win_call(cur_target, function()
489
+ vim.cmd(direction .. ' split')
490
+ return vim.api.nvim_get_current_win()
491
+ end)
492
+
493
+ MiniFiles.set_target_window(new_target)
494
+
495
+ -- This intentionally doesn't act on file under cursor in favor of
496
+ -- explicit "go in" action (`l` / `L`). To immediately open file,
497
+ -- add appropriate `MiniFiles.go_in()` call instead of this comment.
498
+ end
499
+
500
+ -- Adding `desc` will result into `show_help` entries
501
+ local desc = 'Split ' .. direction
502
+ vim.keymap.set('n', lhs, rhs, { buffer = buf_id, desc = desc })
503
+ end
504
+
505
+ vim.api.nvim_create_autocmd('User', {
506
+ pattern = 'MiniFilesBufferCreate',
507
+ callback = function(args)
508
+ local buf_id = args.data.buf_id
509
+ -- Tweak keys to your liking
510
+ map_split(buf_id, '<C-s>', 'belowright horizontal')
511
+ map_split(buf_id, '<C-v>', 'belowright vertical')
512
+ map_split(buf_id, '<C-t>', 'tab')
513
+ end,
514
+ })
515
+ <
516
+ # Create mappings which use data from entry under cursor ~
517
+
518
+ Use |MiniFiles.get_fs_entry()|: >lua
519
+
520
+ -- Set focused directory as current working directory
521
+ local set_cwd = function()
522
+ local path = (MiniFiles.get_fs_entry() or {}).path
523
+ if path == nil then return vim.notify('Cursor is not on valid entry') end
524
+ vim.fn.chdir(vim.fs.dirname(path))
525
+ end
526
+
527
+ -- Yank in register full path of entry under cursor
528
+ local yank_path = function()
529
+ local path = (MiniFiles.get_fs_entry() or {}).path
530
+ if path == nil then return vim.notify('Cursor is not on valid entry') end
531
+ vim.fn.setreg(vim.v.register, path)
532
+ end
533
+
534
+ -- Open path with system default handler (useful for non-text files)
535
+ local ui_open = function() vim.ui.open(MiniFiles.get_fs_entry().path) end
536
+
537
+ vim.api.nvim_create_autocmd('User', {
538
+ pattern = 'MiniFilesBufferCreate',
539
+ callback = function(args)
540
+ local b = args.data.buf_id
541
+ vim.keymap.set('n', 'g~', set_cwd, { buffer = b, desc = 'Set cwd' })
542
+ vim.keymap.set('n', 'gX', ui_open, { buffer = b, desc = 'OS open' })
543
+ vim.keymap.set('n', 'gy', yank_path, { buffer = b, desc = 'Yank path' })
544
+ end,
545
+ })
546
+ <
547
+ # Set custom bookmarks ~
548
+
549
+ Use |MiniFiles.set_bookmark()| inside `MiniFilesExplorerOpen` event: >lua
550
+
551
+ local set_mark = function(id, path, desc)
552
+ MiniFiles.set_bookmark(id, path, { desc = desc })
553
+ end
554
+ vim.api.nvim_create_autocmd('User', {
555
+ pattern = 'MiniFilesExplorerOpen',
556
+ callback = function()
557
+ set_mark('c', vim.fn.stdpath('config'), 'Config') -- path
558
+ set_mark('w', vim.fn.getcwd, 'Working directory') -- callable
559
+ set_mark('~', '~', 'Home directory')
560
+ end,
561
+ })
562
+ <
563
+ ------------------------------------------------------------------------------
564
+ *MiniFiles.setup()*
565
+ `MiniFiles.setup`({config})
566
+ Module setup
567
+
568
+ Parameters ~
569
+ {config} `(table|nil)` Module config table. See |MiniFiles.config|.
570
+
571
+ Usage ~
572
+ >lua
573
+ require('mini.files').setup() -- use default config
574
+ -- OR
575
+ require('mini.files').setup({}) -- replace {} with your config table
576
+ <
577
+ ------------------------------------------------------------------------------
578
+ *MiniFiles.config*
579
+ `MiniFiles.config`
580
+ Defaults ~
581
+ >lua
582
+ MiniFiles.config = {
583
+ -- Customization of shown content
584
+ content = {
585
+ -- Predicate for which file system entries to show
586
+ filter = nil,
587
+ -- Highlight group to use for a file system entry
588
+ highlight = nil,
589
+ -- Prefix text and highlight to show to the left of file system entry
590
+ prefix = nil,
591
+ -- Order in which to show file system entries
592
+ sort = nil,
593
+ },
594
+
595
+ -- Module mappings created only inside explorer.
596
+ -- Use `''` (empty string) to not create one.
597
+ mappings = {
598
+ close = 'q',
599
+ go_in = 'l',
600
+ go_in_plus = 'L',
601
+ go_out = 'h',
602
+ go_out_plus = 'H',
603
+ mark_goto = "'",
604
+ mark_set = 'm',
605
+ reset = '<BS>',
606
+ reveal_cwd = '@',
607
+ show_help = 'g?',
608
+ synchronize = '=',
609
+ trim_left = '<',
610
+ trim_right = '>',
611
+ },
612
+
613
+ -- General options
614
+ options = {
615
+ -- Whether to delete permanently or move into module-specific trash
616
+ permanent_delete = true,
617
+ -- Whether to use for editing directories
618
+ use_as_default_explorer = true,
619
+ -- Timeout for synchronous LSP integration requests
620
+ lsp_timeout = 1000,
621
+ },
622
+
623
+ -- Customization of explorer windows
624
+ windows = {
625
+ -- Maximum number of windows to show side by side
626
+ max_number = math.huge,
627
+ -- Whether to show preview of file/directory under cursor
628
+ preview = false,
629
+ -- Width of focused window
630
+ width_focus = 50,
631
+ -- Width of non-focused window
632
+ width_nofocus = 15,
633
+ -- Width of preview window
634
+ width_preview = 25,
635
+ },
636
+ }
637
+ <
638
+ # Content ~
639
+
640
+ `content.filter` is a predicate which takes file system entry data as input
641
+ and returns `true`-ish value if it should be shown.
642
+ Uses |MiniFiles.default_filter()| by default.
643
+
644
+ A file system entry data is a table with the following fields:
645
+ - <fs_type> `(string)` - one of "file" or "directory".
646
+ - <name> `(string)` - basename of an entry (including extension).
647
+ - <path> `(string)` - full path of an entry.
648
+
649
+ `content.highlight` describes how file system entry name should be highlighted.
650
+ Takes file system entry data as input and returns a highlight group name.
651
+ Uses |MiniFiles.default_highlight()| by default.
652
+
653
+ `content.prefix` describes what text (prefix) to show to the left of file
654
+ system entry name (if any) and how to highlight it. It also takes file
655
+ system entry data as input and returns tuple of text and highlight group
656
+ name to be used to highlight prefix. See |MiniFiles-examples| for common
657
+ examples of how to use it.
658
+ Note: due to how lines are parsed to detect user edits for file system
659
+ manipulation, output of `content.prefix` should not contain `/` character.
660
+ Uses |MiniFiles.default_prefix()| by default.
661
+
662
+ `content.sort` describes in which order directory entries should be shown
663
+ in directory buffer. Takes as input and returns as output an array of file
664
+ system entry data. Note: technically, it can be used to filter and modify
665
+ its elements as well.
666
+ Uses |MiniFiles.default_sort()| by default.
667
+
668
+ # Mappings ~
669
+
670
+ `mappings` table can be used to customize buffer-local mappings created in each
671
+ directory buffer for built-in actions. Entry name corresponds to the function
672
+ name of the action, value - right hand side of the mapping. Supply empty
673
+ string to not create a particular mapping.
674
+
675
+ Default mappings are mostly designed for consistent navigation experience.
676
+ Here are some alternatives: >lua
677
+
678
+ -- Close explorer after opening file with `l`
679
+ mappings = {
680
+ go_in = 'L',
681
+ go_in_plus = 'l',
682
+ }
683
+
684
+ -- Don't use `h`/`l` for easier cursor navigation during text edit
685
+ mappings = {
686
+ go_in = 'L',
687
+ go_in_plus = '',
688
+ go_out = 'H',
689
+ go_out_plus = '',
690
+ }
691
+ <
692
+ # Options ~
693
+
694
+ `options.use_as_default_explorer` is a boolean indicating whether this module
695
+ will be used as a default file explorer to edit directory (instead of `netrw`).
696
+ Note: to work with directory in |arglist|, do not lazy load this module.
697
+
698
+ `options.permanent_delete` is a boolean indicating whether to perform
699
+ permanent delete or move into special trash directory.
700
+ This is a module-specific variant of "remove to trash".
701
+ Target directory is `mini.files/trash` inside standard path of Neovim data
702
+ directory (execute `:echo stdpath('data')` to see its path in your case).
703
+
704
+ `options.lsp_timeout` is a number that defines a timeout for synchronous
705
+ LSP integration requests (see |MiniFiles-manipulation|).
706
+ Set to 0 to disable LSP integration.
707
+
708
+ # Windows ~
709
+
710
+ `windows.max_number` is a maximum number of windows allowed to be open
711
+ simultaneously. For example, use value 1 to always show single window.
712
+ There is no constraint by default.
713
+
714
+ `windows.preview` is a boolean indicating whether to show preview of
715
+ file/directory under cursor. Notes:
716
+ - It is always shown, even if current line is for not yet existing path.
717
+ - File preview is highlighted if its size is small enough (less than 1K
718
+ bytes per line or 1M bytes in total).
719
+
720
+ `windows.width_focus`, `windows.width_nofocus` and `windows.width_preview`
721
+ are number of columns used as `width` for the corresponding window type.
722
+
723
+ ------------------------------------------------------------------------------
724
+ *MiniFiles.open()*
725
+ `MiniFiles.open`({path}, {use_latest}, {opts})
726
+ Open file explorer
727
+
728
+ Common ways to use this function: >lua
729
+
730
+ -- Open current working directory in a last used state
731
+ MiniFiles.open()
732
+
733
+ -- Fresh explorer in current working directory
734
+ MiniFiles.open(nil, false)
735
+
736
+ -- Open directory of current file (in last used state) focused on the file
737
+ MiniFiles.open(vim.api.nvim_buf_get_name(0))
738
+
739
+ -- Fresh explorer in directory of current file
740
+ MiniFiles.open(vim.api.nvim_buf_get_name(0), false)
741
+
742
+ -- Open last used `path` (per tabpage)
743
+ -- Current working directory for the first time
744
+ MiniFiles.open(MiniFiles.get_latest_path())
745
+ <
746
+ Parameters ~
747
+ {path} `(string|nil)` A valid file system path used as anchor.
748
+ If it is a path to directory, used directly.
749
+ If it is a path to file, its parent directory is used as anchor while
750
+ explorer will focus on the supplied file.
751
+ Default: path of |current-directory|.
752
+ {use_latest} `(boolean|nil)` Whether to load explorer state from history
753
+ (based on the supplied anchor path). Default: `true`.
754
+ {opts} `(table|nil)` Table of options overriding |MiniFiles.config| and
755
+ `vim.b.minifiles_config` for this particular explorer session.
756
+
757
+ ------------------------------------------------------------------------------
758
+ *MiniFiles.refresh()*
759
+ `MiniFiles.refresh`({opts})
760
+ Refresh explorer
761
+
762
+ Notes:
763
+ - If in `opts` at least one of `content` entry is not `nil`, all directory
764
+ buffers are forced to update.
765
+
766
+ Parameters ~
767
+ {opts} `(table|nil)` Table of options overriding local options of active
768
+ explorer session.
769
+
770
+ ------------------------------------------------------------------------------
771
+ *MiniFiles.synchronize()*
772
+ `MiniFiles.synchronize`()
773
+ Synchronize explorer
774
+
775
+ - Parse user edits in directory buffers.
776
+ - Convert edits to file system actions and apply them after confirmation.
777
+ Choosing "No" skips application while "Cancel" stops synchronization.
778
+ - Update all directory buffers with the most relevant file system information.
779
+ Can be used without user edits to account for external file system changes.
780
+
781
+ Return ~
782
+ `(boolean)` Whether synchronization was done.
783
+
784
+ ------------------------------------------------------------------------------
785
+ *MiniFiles.reset()*
786
+ `MiniFiles.reset`()
787
+ Reset explorer
788
+
789
+ - Show single window focused on anchor directory (which was used as first
790
+ argument for |MiniFiles.open()|).
791
+ - Reset all tracked directory cursors to point at first entry.
792
+
793
+ ------------------------------------------------------------------------------
794
+ *MiniFiles.close()*
795
+ `MiniFiles.close`()
796
+ Close explorer
797
+
798
+ Return ~
799
+ `(boolean|nil)` Whether closing was done or `nil` if there was nothing to close.
800
+
801
+ ------------------------------------------------------------------------------
802
+ *MiniFiles.go_in()*
803
+ `MiniFiles.go_in`({opts})
804
+ Go in entry under cursor
805
+
806
+ Depends on entry under cursor:
807
+ - If directory, focus on it in the window to the right.
808
+ - If file, open it in the window which was current during |MiniFiles.open()|.
809
+ Explorer is not closed after that.
810
+
811
+ Parameters ~
812
+ {opts} `(table|nil)` Options. Possible fields:
813
+ - <close_on_file> `(boolean)` - whether to close explorer after going
814
+ inside a file. Powers the `go_in_plus` mapping.
815
+ Default: `false`.
816
+
817
+ ------------------------------------------------------------------------------
818
+ *MiniFiles.go_out()*
819
+ `MiniFiles.go_out`()
820
+ Go out to parent directory
821
+
822
+ - Focus on window to the left showing parent of current directory.
823
+
824
+ ------------------------------------------------------------------------------
825
+ *MiniFiles.trim_left()*
826
+ `MiniFiles.trim_left`()
827
+ Trim left part of branch
828
+
829
+ - Remove all branch paths to the left of currently focused one. This also
830
+ results into current window becoming the most left one.
831
+
832
+ ------------------------------------------------------------------------------
833
+ *MiniFiles.trim_right()*
834
+ `MiniFiles.trim_right`()
835
+ Trim right part of branch
836
+
837
+ - Remove all branch paths to the right of currently focused one. This also
838
+ results into current window becoming the most right one.
839
+
840
+ ------------------------------------------------------------------------------
841
+ *MiniFiles.reveal_cwd()*
842
+ `MiniFiles.reveal_cwd`()
843
+ Reveal current working directory
844
+
845
+ - Prepend branch with parent paths until current working directory is reached.
846
+ Do nothing if not inside it.
847
+
848
+ ------------------------------------------------------------------------------
849
+ *MiniFiles.show_help()*
850
+ `MiniFiles.show_help`()
851
+ Show help window
852
+
853
+ - Open window with helpful information about currently shown explorer and
854
+ focus on it. To close it, press `q`.
855
+
856
+ ------------------------------------------------------------------------------
857
+ *MiniFiles.get_fs_entry()*
858
+ `MiniFiles.get_fs_entry`({buf_id}, {line})
859
+ Get file system entry data
860
+
861
+ Parameters ~
862
+ {buf_id} `(number|nil)` Buffer identifier of valid directory buffer.
863
+ Default: current buffer.
864
+ {line} `(number|nil)` Line number of entry for which to return information.
865
+ Default: cursor line.
866
+
867
+ Return ~
868
+ `(table|nil)` Table of file system entry data with the following fields:
869
+ - <fs_type> `(string)` - one of "file" or "directory".
870
+ - <name> `(string)` - basename of an entry (including extension).
871
+ - <path> `(string)` - full path of an entry.
872
+
873
+ Returns `nil` if there is no proper file system entry path at the line.
874
+
875
+ ------------------------------------------------------------------------------
876
+ *MiniFiles.get_explorer_state()*
877
+ `MiniFiles.get_explorer_state`()
878
+ Get state of active explorer
879
+
880
+ Return ~
881
+ `(table|nil)` Table with explorer state data or `nil` if no active explorer.
882
+ State data is a table with the following fields:
883
+ - <anchor> `(string)` - anchor directory path (see |MiniFiles.open()|).
884
+ - <bookmarks> `(table)` - map from bookmark id (single character) to its data:
885
+ table with <path> and <desc> fields (see |MiniFiles.set_bookmark()|).
886
+ - <branch> `(table)` - array of nested paths for currently opened branch.
887
+ - <depth_focus> `(number)` - an index in <branch> for currently focused path.
888
+ - <target_window> `(number)` - identifier of target window.
889
+ - <windows> `(table)` - array with data about currently opened windows.
890
+ Each element is a table with <win_id> (window identifier) and <path> (path
891
+ shown in the window) fields.
892
+
893
+ See also ~
894
+ - |MiniFiles.set_bookmark()|
895
+ - |MiniFiles.set_branch()|
896
+ - |MiniFiles.set_target_window()|
897
+
898
+ ------------------------------------------------------------------------------
899
+ *MiniFiles.set_target_window()*
900
+ `MiniFiles.set_target_window`({win_id})
901
+ Set target window
902
+
903
+ Parameters ~
904
+ {win_id} `(number)` Window identifier inside which file will be opened.
905
+
906
+ ------------------------------------------------------------------------------
907
+ *MiniFiles.set_branch()*
908
+ `MiniFiles.set_branch`({branch}, {opts})
909
+ Set branch
910
+
911
+ Set which paths to display. Preview (if enabled) is applied afterwards.
912
+
913
+ Parameters ~
914
+ {branch} `(table)` Array of strings representing actually present on disk paths.
915
+ Each consecutive pair should represent direct parent-child paths.
916
+ Should contain at least one directory path.
917
+ May end with file path (will be previewed).
918
+ Relative paths are resolved using |current-directory|.
919
+ {opts} `(table|nil)` Options. Possible fields:
920
+ - <depth_focus> `(number)` - an index in `branch` for path to focus. Will
921
+ be normalized to fit inside `branch`. Default: index of deepest directory.
922
+
923
+ See also ~
924
+ |MiniFiles.get_explorer_state()|
925
+
926
+ ------------------------------------------------------------------------------
927
+ *MiniFiles.set_bookmark()*
928
+ `MiniFiles.set_bookmark`({id}, {path}, {opts})
929
+ Set bookmark
930
+
931
+ Parameters ~
932
+ {id} `(string)` Single character bookmark id.
933
+ {path} `(string|function)` Path of a present on disk directory to set as
934
+ a bookmark's path. If callable, should return such path.
935
+ {opts} `(table|nil)` Options. Possible fields:
936
+ - <desc> `(string)` - bookmark description (used in help window).
937
+
938
+ ------------------------------------------------------------------------------
939
+ *MiniFiles.get_latest_path()*
940
+ `MiniFiles.get_latest_path`()
941
+ Get latest used anchor path
942
+
943
+ Note: if latest used `path` argument for |MiniFiles.open()| was for file,
944
+ this will return its parent (as it was used as anchor path).
945
+
946
+ ------------------------------------------------------------------------------
947
+ *MiniFiles.default_filter()*
948
+ `MiniFiles.default_filter`({fs_entry})
949
+ Default filter of file system entries
950
+
951
+ Currently does not filter anything out.
952
+
953
+ Parameters ~
954
+ {fs_entry} `(table)` Table with the following fields:
955
+ - <fs_type> `(string)` - one of "file" or "directory".
956
+ - <name> `(string)` - basename of an entry (including extension).
957
+ - <path> `(string)` - full path of an entry.
958
+
959
+ Return ~
960
+ `(boolean)` Always `true`.
961
+
962
+ ------------------------------------------------------------------------------
963
+ *MiniFiles.default_prefix()*
964
+ `MiniFiles.default_prefix`({fs_entry})
965
+ Default prefix of file system entries
966
+
967
+ - If set up |mini.icons|, use |MiniIcons.get()| for "directory"/"file" category.
968
+ - Otherwise:
969
+ - For directory return fixed icon and "MiniFilesDirectory" group name.
970
+ - For file try to use `get_icon()` from `nvim-tree/nvim-web-devicons`.
971
+ If missing, return fixed icon and `MiniFilesFile` group name.
972
+
973
+ Parameters ~
974
+ {fs_entry} `(table)` Table with the following fields:
975
+ - <fs_type> `(string)` - one of "file" or "directory".
976
+ - <name> `(string)` - basename of an entry (including extension).
977
+ - <path> `(string)` - full path of an entry.
978
+
979
+ Return ~
980
+ `(...)` Icon and highlight group name. For more details, see |MiniFiles.config|
981
+ and |MiniFiles-examples|.
982
+
983
+ ------------------------------------------------------------------------------
984
+ *MiniFiles.default_sort()*
985
+ `MiniFiles.default_sort`({fs_entries})
986
+ Default sort of file system entries
987
+
988
+ Sort directories and files separately (alphabetically ignoring case) and
989
+ put directories first.
990
+
991
+ Parameters ~
992
+ {fs_entries} `(table)` Array of file system entry data.
993
+ Each one is a table with the following fields:
994
+ - <fs_type> `(string)` - one of "file" or "directory".
995
+ - <name> `(string)` - basename of an entry (including extension).
996
+ - <path> `(string)` - full path of an entry.
997
+
998
+ Return ~
999
+ `(table)` Sorted array of file system entries.
1000
+
1001
+ ------------------------------------------------------------------------------
1002
+ *MiniFiles.default_highlight()*
1003
+ `MiniFiles.default_highlight`({fs_entry})
1004
+ Default file system entry highlight
1005
+
1006
+ Returns `'MiniFilesDirectory'` for directory and `'MiniFilesFile'` otherwise.
1007
+
1008
+ Parameters ~
1009
+ {fs_entry} `(table)` Table with the following fields:
1010
+ - <fs_type> `(string)` - one of "file" or "directory".
1011
+ - <name> `(string)` - basename of an entry (including extension).
1012
+ - <path> `(string)` - full path of an entry.
1013
+
1014
+ Return ~
1015
+ `(string)` Highlight group name.
1016
+
1017
+
1018
+ vim:tw=78:ts=8:noet:ft=help:norl: