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,618 @@
1
+ *mini.starter* Start screen
2
+
3
+ MIT License Copyright (c) 2021 Evgeni Chasnovski
4
+
5
+ ------------------------------------------------------------------------------
6
+ *MiniStarter*
7
+ Displayed items are fully customizable both in terms of what they do and
8
+ how they look (with reasonable defaults). Item selection can be done using
9
+ prefix query with instant visual feedback.
10
+
11
+ Key design ideas:
12
+ - All available actions are defined inside items. Each item should have the
13
+ following info:
14
+ - <action> - function or string for |vim.cmd()| which is executed when
15
+ item is chosen. Empty string result in placeholder "inactive" item.
16
+ - <name> - string which will be displayed and used for choosing.
17
+ - <section> - string representing to which section item belongs.
18
+ There are pre-configured whole sections in |MiniStarter.sections|.
19
+
20
+ - Configure what items are displayed by supplying an array which can be
21
+ normalized to an array of items. Read about how supplied items are
22
+ normalized in |MiniStarter.refresh()|.
23
+
24
+ - Modify the final look by supplying content hooks: functions which take
25
+ buffer content (see |MiniStarter.get_content()|) and identifier as input
26
+ while returning buffer content as output. There are pre-configured
27
+ content hook generators in |MiniStarter.gen_hook|.
28
+
29
+ - Choosing an item can be done in two ways:
30
+ - Type prefix query to filter item by matching its name (ignoring
31
+ case). Displayed information is updated after every typed character.
32
+ For every item its unique prefix is highlighted.
33
+ - Use Up/Down arrows and hit Enter.
34
+
35
+ - Allow multiple simultaneously open Starter buffers.
36
+
37
+ What is doesn't do:
38
+ - It doesn't support fuzzy query for items. And probably will never do.
39
+
40
+ # Setup ~
41
+
42
+ This module needs a setup with `require('mini.starter').setup({})`
43
+ (replace `{}` with your `config` table). It will create global Lua table
44
+ `MiniStarter` which you can use for scripting or manually (with
45
+ `:lua MiniStarter.*`).
46
+
47
+ See |MiniStarter.config| for `config` structure and default values. For
48
+ some configuration examples (including one similar to `vim-startify` and
49
+ `dashboard-nvim`), see |MiniStarter-example-config|.
50
+
51
+ You can override runtime config settings locally to buffer inside
52
+ `vim.b.ministarter_config` which should have same structure as
53
+ `MiniStarter.config`. See |mini.nvim-buffer-local-config| for more details.
54
+ Note: `vim.b.ministarter_config` is copied to Starter buffer from current
55
+ buffer allowing full customization.
56
+
57
+ To stop module from showing non-error feedback, set `config.silent = true`.
58
+
59
+ # Highlight groups ~
60
+ *MiniStarter-hl-groups*
61
+
62
+ - `MiniStarterCurrent` - current item.
63
+ - `MiniStarterFooter` - footer units.
64
+ - `MiniStarterHeader` - header units.
65
+ - `MiniStarterInactive` - inactive item.
66
+ - `MiniStarterItem` - item name.
67
+ - `MiniStarterItemBullet` - units from |MiniStarter.gen_hook.adding_bullet()|.
68
+ - `MiniStarterItemPrefix` - unique query for item.
69
+ - `MiniStarterSection` - section units.
70
+ - `MiniStarterQuery` - current query in active items.
71
+
72
+ To change any highlight group, set it directly with |nvim_set_hl()|.
73
+
74
+ # Disabling ~
75
+
76
+ To disable core functionality, set `vim.g.ministarter_disable` (globally) or
77
+ `vim.b.ministarter_disable` (for a buffer) to `true`. Considering high number
78
+ of different scenarios and customization intentions, writing exact rules
79
+ for disabling module's functionality is left to user. See
80
+ |mini.nvim-disabling-recipes| for common recipes.
81
+
82
+ ------------------------------------------------------------------------------
83
+ *MiniStarter-example-config*
84
+ # Similar to `mhinz/vim-startify` ~
85
+ >lua
86
+ local starter = require('mini.starter')
87
+ starter.setup({
88
+ evaluate_single = true,
89
+ items = {
90
+ starter.sections.builtin_actions(),
91
+ starter.sections.recent_files(10, false),
92
+ starter.sections.recent_files(10, true),
93
+ -- Use this if you set up 'mini.sessions'
94
+ starter.sections.sessions(5, true)
95
+ },
96
+ content_hooks = {
97
+ starter.gen_hook.adding_bullet(),
98
+ starter.gen_hook.indexing('all', { 'Builtin actions' }),
99
+ starter.gen_hook.padding(3, 2),
100
+ },
101
+ })
102
+ <
103
+ # Similar to `glepnir/dashboard-nvim` ~
104
+ >lua
105
+ local starter = require('mini.starter')
106
+ starter.setup({
107
+ items = {
108
+ starter.sections.telescope(),
109
+ },
110
+ content_hooks = {
111
+ starter.gen_hook.adding_bullet(),
112
+ starter.gen_hook.aligning('center', 'center'),
113
+ },
114
+ })
115
+ <
116
+ # Demo of capabilities ~
117
+ >lua
118
+ local my_items = {
119
+ { name = 'Echo random number', action = 'lua print(math.random())', section = 'Section 1' },
120
+ function()
121
+ return {
122
+ { name = 'Item #1 from function', action = [[echo 'Item #1']], section = 'From function' },
123
+ { name = 'Placeholder (always inactive) item', action = '', section = 'From function' },
124
+ function()
125
+ return {
126
+ name = 'Item #1 from double function',
127
+ action = [[echo 'Double function']],
128
+ section = 'From double function',
129
+ }
130
+ end,
131
+ }
132
+ end,
133
+ { name = [[Another item in 'Section 1']], action = 'lua print(math.random() + 10)', section = 'Section 1' },
134
+ }
135
+
136
+ local footer_n_seconds = (function()
137
+ local timer = vim.loop.new_timer()
138
+ local n_seconds = 0
139
+ timer:start(0, 1000, vim.schedule_wrap(function()
140
+ if vim.bo.filetype ~= 'ministarter' then
141
+ timer:stop()
142
+ return
143
+ end
144
+ n_seconds = n_seconds + 1
145
+ MiniStarter.refresh()
146
+ end))
147
+
148
+ return function()
149
+ return 'Number of seconds since opening: ' .. n_seconds
150
+ end
151
+ end)()
152
+
153
+ local hook_top_pad_10 = function(content)
154
+ -- Pad from top
155
+ for _ = 1, 10 do
156
+ -- Insert at start a line with single content unit
157
+ table.insert(content, 1, { { type = 'empty', string = '' } })
158
+ end
159
+ return content
160
+ end
161
+
162
+ local starter = require('mini.starter')
163
+ starter.setup({
164
+ items = my_items,
165
+ footer = footer_n_seconds,
166
+ content_hooks = { hook_top_pad_10 },
167
+ })
168
+ <
169
+ ------------------------------------------------------------------------------
170
+ *MiniStarter-lifecycle*
171
+ - Open with |MiniStarter.open()|. It includes creating buffer with
172
+ appropriate options, mappings, behavior; call to |MiniStarter.refresh()|;
173
+ issue `MiniStarterOpened` |User| event.
174
+ - Wait for user to choose an item. This is done using following logic:
175
+ - Typing any character from `MiniStarter.config.query_updaters` leads
176
+ to updating query. Read more in |MiniStarter.add_to_query()|.
177
+ - <BS> deletes latest character from query.
178
+ - <Down>/<Up>, <C-n>/<C-p>, <M-j>/<M-k> move current item.
179
+ - <CR> executes action of current item.
180
+ - <C-c> closes Starter buffer.
181
+ - Evaluate current item when appropriate (after `<CR>` or when there is a
182
+ single item and `MiniStarter.config.evaluate_single` is `true`). This
183
+ executes item's `action`.
184
+
185
+ ------------------------------------------------------------------------------
186
+ *MiniStarter.setup()*
187
+ `MiniStarter.setup`({config})
188
+ Module setup
189
+
190
+ Parameters ~
191
+ {config} `(table|nil)` Module config table. See |MiniStarter.config|.
192
+
193
+ Usage ~
194
+ >lua
195
+ require('mini.starter').setup() -- use default config
196
+ -- OR
197
+ require('mini.starter').setup({}) -- replace {} with your config table
198
+ <
199
+ ------------------------------------------------------------------------------
200
+ *MiniStarter.config*
201
+ `MiniStarter.config`
202
+ Defaults ~
203
+ >lua
204
+ MiniStarter.config = {
205
+ -- Whether to open Starter buffer on VimEnter. Not opened if Neovim was
206
+ -- started with intent to show something else.
207
+ autoopen = true,
208
+
209
+ -- Whether to evaluate action of single active item
210
+ evaluate_single = false,
211
+
212
+ -- Items to be displayed. Should be an array with the following elements:
213
+ -- - Item: table with <action>, <name>, and <section> keys.
214
+ -- - Function: should return one of these three categories.
215
+ -- - Array: elements of these three types (i.e. item, array, function).
216
+ -- If `nil` (default), default items will be used (see |mini.starter|).
217
+ items = nil,
218
+
219
+ -- Header to be displayed before items. Converted to single string via
220
+ -- `tostring` (use `\n` to display several lines). If function, it is
221
+ -- evaluated first. If `nil` (default), polite greeting will be used.
222
+ header = nil,
223
+
224
+ -- Footer to be displayed after items. Converted to single string via
225
+ -- `tostring` (use `\n` to display several lines). If function, it is
226
+ -- evaluated first. If `nil` (default), default usage help will be shown.
227
+ footer = nil,
228
+
229
+ -- Array of functions to be applied consecutively to initial content.
230
+ -- Each function should take and return content for Starter buffer (see
231
+ -- |mini.starter| and |MiniStarter.get_content()| for more details).
232
+ content_hooks = nil,
233
+
234
+ -- Characters to update query. Each character will have special buffer
235
+ -- mapping overriding your global ones. Be careful to not add `:` as it
236
+ -- allows you to go into command mode.
237
+ query_updaters = 'abcdefghijklmnopqrstuvwxyz0123456789_-.',
238
+
239
+ -- Whether to disable showing non-error feedback
240
+ silent = false,
241
+ }
242
+ <
243
+ ------------------------------------------------------------------------------
244
+ *MiniStarter.open()*
245
+ `MiniStarter.open`({buf_id})
246
+ Open Starter buffer
247
+
248
+ - Create buffer if necessary and move into it.
249
+ - Set buffer options. Note that settings are done with |:noautocmd| to
250
+ achieve a massive speedup.
251
+ - Set buffer mappings. Besides basic mappings (described inside "Lifecycle
252
+ of Starter buffer" of |mini.starter|), map every character from
253
+ `MiniStarter.config.query_updaters` to add itself to query with
254
+ |MiniStarter.add_to_query()|.
255
+ - Populate buffer with |MiniStarter.refresh()|.
256
+ - Issue custom `MiniStarterOpened` event to allow acting upon opening
257
+ Starter buffer. Use it with
258
+ `autocmd User MiniStarterOpened <your command>`.
259
+
260
+ Note: to fully use it in autocommand, use |autocmd-nested|. Example: >lua
261
+
262
+ local starter_open = function() MiniStarter.open() end
263
+ local au_opts = { nested = true, callback = starter_open }
264
+ vim.api.nvim_create_autocmd('TabNewEntered', au_opts)
265
+ <
266
+ Parameters ~
267
+ {buf_id} `(number|nil)` Identifier of existing valid buffer (see |bufnr()|) to
268
+ open inside. Default: create a new one.
269
+
270
+ ------------------------------------------------------------------------------
271
+ *MiniStarter.refresh()*
272
+ `MiniStarter.refresh`({buf_id})
273
+ Refresh Starter buffer
274
+
275
+ - Normalize `MiniStarter.config.items`:
276
+ - Flatten: recursively (in depth-first fashion) parse its elements. If
277
+ function is found, execute it and continue with parsing its output
278
+ (this allows deferring item collection up until it is actually
279
+ needed). If proper item is found (table with fields `action`,
280
+ `name`, `section`), add it to output.
281
+ - Sort: order first by section and then by item id (both in order of
282
+ appearance).
283
+ - Normalize `MiniStarter.config.header` and `MiniStarter.config.footer` to
284
+ be multiple lines by splitting at `\n`. If function - evaluate it first.
285
+ - Make initial buffer content (see |MiniStarter.get_content()| for a
286
+ description of what a buffer content is). It consist from content lines
287
+ with single content unit:
288
+ - First lines contain strings of normalized header.
289
+ - Body is for normalized items. Section names have own lines preceded
290
+ by empty line.
291
+ - Last lines contain separate strings of normalized footer.
292
+ - Sequentially apply hooks from `MiniStarter.config.content_hooks` to
293
+ content. All hooks are applied with `(content, buf_id)` signature. Output
294
+ of one hook serves as first argument to the next.
295
+ - Gather final items from content with |MiniStarter.content_to_items()|.
296
+ - Convert content to buffer lines with |MiniStarter.content_to_lines()| and
297
+ add them to buffer.
298
+ - Add highlighting of content units.
299
+ - Position cursor.
300
+ - Make current query. This results into some items being marked as
301
+ "inactive" and updating highlighting of current query on "active" items.
302
+
303
+ Note: this function is executed on every |VimResized| to allow more
304
+ responsive behavior.
305
+
306
+ Parameters ~
307
+ {buf_id} `(number|nil)` Buffer identifier of a valid Starter buffer.
308
+ Default: current buffer.
309
+
310
+ ------------------------------------------------------------------------------
311
+ *MiniStarter.close()*
312
+ `MiniStarter.close`({buf_id})
313
+ Close Starter buffer
314
+
315
+ Parameters ~
316
+ {buf_id} `(number|nil)` Buffer identifier of a valid Starter buffer.
317
+ Default: current buffer.
318
+
319
+ ------------------------------------------------------------------------------
320
+ *MiniStarter.sections*
321
+ `MiniStarter.sections`
322
+ Table of pre-configured sections
323
+
324
+ ------------------------------------------------------------------------------
325
+ *MiniStarter.sections.builtin_actions()*
326
+ `MiniStarter.sections.builtin_actions`()
327
+ Section with builtin actions
328
+
329
+ Return ~
330
+ `(table)` Array of items.
331
+
332
+ ------------------------------------------------------------------------------
333
+ *MiniStarter.sections.sessions()*
334
+ `MiniStarter.sections.sessions`({n}, {recent})
335
+ Section with |mini.sessions| sessions
336
+
337
+ Sessions are taken from |MiniSessions.detected|. Notes:
338
+ - If it shows `'mini.sessions' is not set up`, it means that you didn't
339
+ call `require('mini.sessions').setup()`.
340
+ - If it shows `There are no detected sessions in 'mini.sessions'`, it means
341
+ that there are no sessions at the current sessions directory. Either
342
+ create session or supply different directory where session files are
343
+ stored (see |MiniSessions.setup()|).
344
+ - Local session (if detected) is always displayed first.
345
+
346
+ Parameters ~
347
+ {n} `(number|nil)` Number of returned items. Default: 5.
348
+ {recent} `(boolean|nil)` Whether to use recent sessions (instead of
349
+ alphabetically by name). Default: true.
350
+
351
+ Return ~
352
+ `(function)` Function which returns array of items.
353
+
354
+ ------------------------------------------------------------------------------
355
+ *MiniStarter.sections.recent_files()*
356
+ `MiniStarter.sections.recent_files`({n}, {current_dir}, {show_path})
357
+ Section with most recently used files
358
+
359
+ Files are taken from |v:oldfiles|.
360
+
361
+ Parameters ~
362
+ {n} `(number|nil)` Number of returned items. Default: 5.
363
+ {current_dir} `(boolean|nil)` Whether to return files only from current working
364
+ directory and its subdirectories. Default: `false`.
365
+ {show_path} `(boolean|function|nil)` Whether to append file name with its path.
366
+ If callable, will be called with full path and should return string to be
367
+ directly appended to file name. Default: `true`.
368
+
369
+ Return ~
370
+ `(function)` Function which returns array of items.
371
+
372
+ ------------------------------------------------------------------------------
373
+ *MiniStarter.sections.pick()*
374
+ `MiniStarter.sections.pick`()
375
+ Section with |mini.pick| pickers
376
+
377
+ Notes:
378
+ - All actions require |mini.pick| module of |mini.nvim|.
379
+ - "Command history", "Explorer", and "Visited paths" items
380
+ require |mini.extra| module of |mini.nvim|.
381
+ - "Visited paths" items requires |mini.visits| module of |mini.nvim|.
382
+
383
+ Return ~
384
+ `(function)` Function which returns array of items.
385
+
386
+ ------------------------------------------------------------------------------
387
+ *MiniStarter.sections.telescope()*
388
+ `MiniStarter.sections.telescope`()
389
+ Section with basic Telescope pickers relevant to start screen
390
+
391
+ Notes:
392
+ - All actions require
393
+ [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim).
394
+ - "Browser" item requires
395
+ [nvim-telescope/telescope-file-browser.nvim](https://github.com/nvim-telescope/telescope-file-browser.nvim).
396
+
397
+ Return ~
398
+ `(function)` Function which returns array of items.
399
+
400
+ ------------------------------------------------------------------------------
401
+ *MiniStarter.gen_hook*
402
+ `MiniStarter.gen_hook`
403
+ Table with pre-configured content hook generators
404
+
405
+ Each element is a function which returns content hook. So to use them
406
+ inside |MiniStarter.setup()|, call them.
407
+
408
+ ------------------------------------------------------------------------------
409
+ *MiniStarter.gen_hook.padding()*
410
+ `MiniStarter.gen_hook.padding`({left}, {top})
411
+ Hook generator for padding
412
+
413
+ Output is a content hook which adds constant padding from left and top.
414
+ This allows tweaking the screen position of buffer content.
415
+
416
+ Parameters ~
417
+ {left} `(number|nil)` Number of empty spaces to add to start of each content
418
+ line. Default: 0.
419
+ {top} `(number|nil)` Number of empty lines to add to start of content.
420
+ Default: 0.
421
+
422
+ Return ~
423
+ `(function)` Content hook.
424
+
425
+ ------------------------------------------------------------------------------
426
+ *MiniStarter.gen_hook.adding_bullet()*
427
+ `MiniStarter.gen_hook.adding_bullet`({bullet}, {place_cursor})
428
+ Hook generator for adding bullet to items
429
+
430
+ Output is a content hook which adds supplied string to be displayed to the
431
+ left of item.
432
+
433
+ Parameters ~
434
+ {bullet} `(string|nil)` String to be placed to the left of item name.
435
+ Default: "░ ".
436
+ {place_cursor} `(boolean|nil)` Whether to place cursor on the first character
437
+ of bullet when corresponding item becomes current. Default: true.
438
+
439
+ Return ~
440
+ `(function)` Content hook.
441
+
442
+ ------------------------------------------------------------------------------
443
+ *MiniStarter.gen_hook.indexing()*
444
+ `MiniStarter.gen_hook.indexing`({grouping}, {exclude_sections})
445
+ Hook generator for indexing items
446
+
447
+ Output is a content hook which adds unique index to the start of item's
448
+ name. It results into shortening queries required to choose an item (at
449
+ expense of clarity).
450
+
451
+ Parameters ~
452
+ {grouping} `(string|nil)` One of "all" (number indexing across all sections) or
453
+ "section" (letter-number indexing within each section). Default: "all".
454
+ {exclude_sections} `(table|nil)` Array of section names (values of `section`
455
+ element of item) for which index won't be added. Default: `{}`.
456
+
457
+ Return ~
458
+ `(function)` Content hook.
459
+
460
+ ------------------------------------------------------------------------------
461
+ *MiniStarter.gen_hook.aligning()*
462
+ `MiniStarter.gen_hook.aligning`({horizontal}, {vertical})
463
+ Hook generator for aligning content
464
+
465
+ Output is a content hook which independently aligns content horizontally
466
+ and vertically. Window width and height are taken from first window in current
467
+ tabpage displaying the Starter buffer.
468
+
469
+ Basically, this computes left and top pads for |MiniStarter.gen_hook.padding()|
470
+ such that output lines would appear aligned in certain way.
471
+
472
+ Parameters ~
473
+ {horizontal} `(string|nil)` One of "left", "center", "right". Default: "left".
474
+ {vertical} `(string|nil)` One of "top", "center", "bottom". Default: "top".
475
+
476
+ Return ~
477
+ `(function)` Content hook.
478
+
479
+ ------------------------------------------------------------------------------
480
+ *MiniStarter.get_content()*
481
+ `MiniStarter.get_content`({buf_id})
482
+ Get content of Starter buffer
483
+
484
+ Generally, buffer content is a table in the form of "2d array" (or rather
485
+ "2d list" because number of elements can differ):
486
+ - Each element represents content line: an array with content units to be
487
+ displayed in one buffer line.
488
+ - Each content unit is a table with at least the following elements:
489
+ - "type" - string with type of content. Something like "item",
490
+ "section", "header", "footer", "empty", etc.
491
+ - "string" - which string should be displayed. May be an empty string.
492
+ - "hl" - which highlighting should be applied to content string. May be
493
+ `nil` for no highlighting.
494
+
495
+ See |MiniStarter.content_to_lines()| for converting content to buffer lines
496
+ and |MiniStarter.content_to_items()| - to list of parsed items.
497
+
498
+ Notes:
499
+ - Content units with type "item" also have `item` element with all
500
+ information about an item it represents. Those elements are used directly
501
+ to create an array of items used for query.
502
+
503
+ Parameters ~
504
+ {buf_id} `(number|nil)` Buffer identifier of a valid Starter buffer.
505
+ Default: current buffer.
506
+
507
+ ------------------------------------------------------------------------------
508
+ *MiniStarter.content_coords()*
509
+ `MiniStarter.content_coords`({content}, {predicate})
510
+ Helper to iterate through content
511
+
512
+ Basically, this traverses content "2d array" (in depth-first fashion; top
513
+ to bottom, left to right) and returns "coordinates" of units for which
514
+ `predicate` is true-ish.
515
+
516
+ Parameters ~
517
+ {content} `(table|nil)` Content "2d array". Default: content of current buffer.
518
+ {predicate} `(function|string|nil)` Predictate to filter units. If it is:
519
+ - Function, then it is evaluated with unit as input.
520
+ - String, then it checks unit to have this type (allows easy getting of
521
+ units with some type).
522
+ - `nil`, all units are kept.
523
+
524
+ Return ~
525
+ `(table)` Array with coordinates of resulting units. Each coordinate is a
526
+ table with <line> and <unit> keys. To retrieve actual unit from coordinate
527
+ `c`, use `content[c.line][c.unit]`.
528
+
529
+ ------------------------------------------------------------------------------
530
+ *MiniStarter.content_to_lines()*
531
+ `MiniStarter.content_to_lines`({content})
532
+ Convert content to buffer lines
533
+
534
+ One buffer line is made by concatenating `string` element of units within
535
+ same content line.
536
+
537
+ Parameters ~
538
+ {content} `(table|nil)` Content "2d array". Default: content of current buffer.
539
+
540
+ Return ~
541
+ `(table)` Array of strings for each buffer line.
542
+
543
+ ------------------------------------------------------------------------------
544
+ *MiniStarter.content_to_items()*
545
+ `MiniStarter.content_to_items`({content})
546
+ Convert content to items
547
+
548
+ Parse content (in depth-first fashion) and retrieve each item from `item`
549
+ element of content units with type "item". This also:
550
+ - Computes some helper information about how item will be actually
551
+ displayed (after |MiniStarter.content_to_lines()|) and minimum number of
552
+ prefix characters needed for a particular item to be queried single.
553
+ - Modifies item's `name` element taking it from corresponding `string`
554
+ element of content unit. This allows modifying item's `name` at the stage
555
+ of content hooks (like, for example, in |MiniStarter.gen_hook.indexing()|).
556
+
557
+ Parameters ~
558
+ {content} `(table|nil)` Content "2d array". Default: content of current buffer.
559
+
560
+ Return ~
561
+ `(table)` Array of items.
562
+
563
+ ------------------------------------------------------------------------------
564
+ *MiniStarter.eval_current_item()*
565
+ `MiniStarter.eval_current_item`({buf_id})
566
+ Evaluate current item
567
+
568
+ Note that it resets current query before evaluation, as it is rarely needed
569
+ any more.
570
+
571
+ Parameters ~
572
+ {buf_id} `(number|nil)` Buffer identifier of a valid Starter buffer.
573
+ Default: current buffer.
574
+
575
+ ------------------------------------------------------------------------------
576
+ *MiniStarter.update_current_item()*
577
+ `MiniStarter.update_current_item`({direction}, {buf_id})
578
+ Update current item
579
+
580
+ This makes next (with respect to `direction`) active item to be current.
581
+
582
+ Parameters ~
583
+ {direction} `(string)` One of "next" or "previous".
584
+ {buf_id} `(number|nil)` Buffer identifier of a valid Starter buffer.
585
+ Default: current buffer.
586
+
587
+ ------------------------------------------------------------------------------
588
+ *MiniStarter.add_to_query()*
589
+ `MiniStarter.add_to_query`({char}, {buf_id})
590
+ Add character to current query
591
+
592
+ - Update current query by appending `char` to its end (only if it results
593
+ into at least one active item) or delete latest character if `char` is `nil`.
594
+ - Recompute status of items: "active" if its name starts with new query,
595
+ "inactive" otherwise.
596
+ - Update highlighting: whole strings for "inactive" items, current query
597
+ for "active" items.
598
+
599
+ Parameters ~
600
+ {char} `(string|nil)` Single character to be added to query. If `nil`, deletes
601
+ latest character from query.
602
+ {buf_id} `(number|nil)` Buffer identifier of a valid Starter buffer.
603
+ Default: current buffer.
604
+
605
+ ------------------------------------------------------------------------------
606
+ *MiniStarter.set_query()*
607
+ `MiniStarter.set_query`({query}, {buf_id})
608
+ Set current query
609
+
610
+ Parameters ~
611
+ {query} `(string|nil)` Query to be set (only if it results into at least one
612
+ active item). Default: `nil` for setting query to empty string, which
613
+ essentially resets query.
614
+ {buf_id} `(number|nil)` Buffer identifier of a valid Starter buffer.
615
+ Default: current buffer.
616
+
617
+
618
+ vim:tw=78:ts=8:noet:ft=help:norl: