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,622 @@
1
+ *mini.bracketed* Go forward/backward with square brackets
2
+
3
+ MIT License Copyright (c) 2023 Evgeni Chasnovski
4
+
5
+ ------------------------------------------------------------------------------
6
+ *MiniBracketed*
7
+ Features:
8
+ - Configurable Lua functions to go forward/backward to a certain target.
9
+ Each function can be customized with:
10
+ - Direction. One of "forward", "backward", "first" (forward starting
11
+ from first one), "last" (backward starting from last one).
12
+ - Number of times to go.
13
+ - Whether to wrap on edges (going forward on last one goes to first).
14
+ - Some other target specific options.
15
+
16
+ - Mappings using square brackets. They are created using configurable
17
+ target suffix and can be selectively disabled.
18
+
19
+ Each mapping supports |[count]|. Mappings are created in Normal mode; for
20
+ targets which move cursor in current buffer also Visual and
21
+ Operator-pending (with dot-repeat) modes are supported.
22
+
23
+ Using `lower-suffix` and `upper-suffix` (lower and upper case suffix) for
24
+ a single target the following mappings are created:
25
+ - `[` + `upper-suffix` : go first.
26
+ - `[` + `lower-suffix` : go backward.
27
+ - `]` + `lower-suffix` : go forward.
28
+ - `]` + `upper-suffix` : go last.
29
+
30
+ - Supported targets (for more information see help for corresponding Lua
31
+ function):
32
+
33
+ `Target` `Mappings` `Lua function`
34
+ Buffer ......................... `[B` `[b` `]b` `]B` .... |MiniBracketed.buffer()|
35
+ Comment block .................. `[C` `[c` `]c` `]C` .... |MiniBracketed.comment()|
36
+ Conflict marker ................ `[X` `[x` `]x` `]X` .... |MiniBracketed.conflict()|
37
+ Diagnostic ..................... `[D` `[d` `]d` `]D` .... |MiniBracketed.diagnostic()|
38
+ File on disk ................... `[F` `[f` `]f` `]F` .... |MiniBracketed.file()|
39
+ Indent change .................. `[I` `[i` `]i` `]I` .... |MiniBracketed.indent()|
40
+ Jump inside current buffer ..... `[J` `[j` `]j` `]J` .... |MiniBracketed.jump()|
41
+ Location from |location-list| .... `[L` `[l` `]l` `]L` .... |MiniBracketed.location()|
42
+ Old files ...................... `[O` `[o` `]o` `]O` .... |MiniBracketed.oldfile()|
43
+ Quickfix entry from |Quickfix| ... `[Q` `[q` `]q` `]Q` .... |MiniBracketed.quickfix()|
44
+ Tree-sitter node and parents ... `[T` `[t` `]t` `]T` .... |MiniBracketed.treesitter()|
45
+ Undo from linear history ....... `[U` `[u` `]u` `]U` .... |MiniBracketed.undo()|
46
+ Window in current tab .......... `[W` `[w` `]w` `]W` .... |MiniBracketed.window()|
47
+ Yank entry over put region ..... `[Y` `[y` `]y` `]Y` .... |MiniBracketed.yank()|
48
+
49
+ Notes:
50
+ - The `undo` target remaps |u| and |CTRL-R| keys to register undo state
51
+ after undo and redo respectively. If this conflicts with your setup,
52
+ either disable `undo` target or make your remaps after calling
53
+ |MiniBracketed.setup()|. To use `undo` target, remap your undo/redo keys
54
+ to call |MiniBracketed.register_undo_state()| after the action.
55
+
56
+ # Setup ~
57
+
58
+ This module needs a setup with `require('mini.bracketed').setup({})` (replace
59
+ `{}` with your `config` table). It will create global Lua table `MiniBracketed`
60
+ which you can use for scripting or manually (with `:lua MiniBracketed.*`).
61
+
62
+ See |MiniBracketed.config| for available config settings.
63
+
64
+ You can override runtime config settings (like target options) locally
65
+ to buffer inside `vim.b.minibracketed_config` which should have same structure
66
+ as `MiniBracketed.config`. See |mini.nvim-buffer-local-config| for more details.
67
+
68
+ # Comparisons ~
69
+
70
+ - [tpope/vim-unimpaired](https://github.com/tpope/vim-unimpaired):
71
+ - Supports buffer, conflict, file, location, and quickfix targets mostly
72
+ via built-in commands (like |:bprevious|, etc.) without configuration.
73
+ - Supports files from argument list and tags. This module does not.
74
+ - Doesn't support most other this module's targets (comment, indent, ...).
75
+ - |mini.indentscope|:
76
+ - Target |MiniBracketed.indent()| target can go to "first" and "last"
77
+ indent change. It also can go not only to line with smaller indent,
78
+ but also bigger or different one.
79
+ - Mappings from |mini.indentscope| have more flexibility in computation of
80
+ indent scope, like how to treat empty lines near border or whether to
81
+ compute indent at cursor.
82
+
83
+ # Disabling ~
84
+
85
+ To disable, set `vim.g.minibracketed_disable` (globally) or
86
+ `vim.b.minibracketed_disable` (for a buffer) to `true`. Considering high
87
+ number of different scenarios and customization intentions, writing exact
88
+ rules for disabling module's functionality is left to user. See
89
+ |mini.nvim-disabling-recipes| for common recipes.
90
+
91
+ ------------------------------------------------------------------------------
92
+ *MiniBracketed.setup()*
93
+ `MiniBracketed.setup`({config})
94
+ Module setup
95
+
96
+ Parameters ~
97
+ {config} `(table|nil)` Module config table. See |MiniBracketed.config|.
98
+
99
+ Usage ~
100
+ >lua
101
+ require('mini.bracketed').setup() -- use default config
102
+ -- OR
103
+ require('mini.bracketed').setup({}) -- replace {} with your config table
104
+ <
105
+ ------------------------------------------------------------------------------
106
+ *MiniBracketed.config*
107
+ `MiniBracketed.config`
108
+ Defaults ~
109
+ >lua
110
+ MiniBracketed.config = {
111
+ -- First-level elements are tables describing behavior of a target:
112
+ --
113
+ -- - <suffix> - single character suffix. Used after `[` / `]` in mappings.
114
+ -- For example, with `b` creates `[B`, `[b`, `]b`, `]B` mappings.
115
+ -- Supply empty string `''` to not create mappings.
116
+ --
117
+ -- - <options> - table overriding target options.
118
+ --
119
+ -- See `:h MiniBracketed.config` for more info.
120
+
121
+ buffer = { suffix = 'b', options = {} },
122
+ comment = { suffix = 'c', options = {} },
123
+ conflict = { suffix = 'x', options = {} },
124
+ diagnostic = { suffix = 'd', options = {} },
125
+ file = { suffix = 'f', options = {} },
126
+ indent = { suffix = 'i', options = {} },
127
+ jump = { suffix = 'j', options = {} },
128
+ location = { suffix = 'l', options = {} },
129
+ oldfile = { suffix = 'o', options = {} },
130
+ quickfix = { suffix = 'q', options = {} },
131
+ treesitter = { suffix = 't', options = {} },
132
+ undo = { suffix = 'u', options = {} },
133
+ window = { suffix = 'w', options = {} },
134
+ yank = { suffix = 'y', options = {} },
135
+ }
136
+ <
137
+ Options ~
138
+
139
+ Each entry configures target with the same name and can have data configuring
140
+ mapping suffix and target options.
141
+
142
+ Example of configuration: >lua
143
+
144
+ require('mini.bracketed').setup({
145
+ -- Map [N, [n, ]n, ]N for conflict marker like in 'tpope/vim-unimpaired'
146
+ conflict = { suffix = 'n' },
147
+
148
+ -- Make diagnostic advance only by errors
149
+ diagnostic = { options = { severity = vim.diagnostic.severity.ERROR } },
150
+
151
+ -- Disable creation of mappings for `indent` target (for example,
152
+ -- in favor of ones from |mini.indentscope|)
153
+ indent = { suffix = '' },
154
+
155
+ -- Disable mappings for `window` target in favor of custom ones
156
+ window = { suffix = '' },
157
+ })
158
+
159
+ -- Create custom `window` mappings
160
+ local map = vim.keymap.set
161
+ map('n', '<Leader>wH', "<Cmd>lua MiniBracketed.window('first')<CR>")
162
+ map('n', '<Leader>wh', "<Cmd>lua MiniBracketed.window('backward')<CR>")
163
+ map('n', '<Leader>wl', "<Cmd>lua MiniBracketed.window('forward')<CR>")
164
+ map('n', '<Leader>wL', "<Cmd>lua MiniBracketed.window('last')<CR>")
165
+ <
166
+ ## Suffix ~
167
+
168
+ The `suffix` key is used to create target mappings.
169
+
170
+ Supply empty string to disable mapping creation for that particular target.
171
+ To create a completely different mapping (like with |<Leader>|) use target
172
+ function manually.
173
+
174
+ Using `lower-suffix` and `upper-suffix` (lower and upper case suffix) for
175
+ a single target the following mappings are created:
176
+ - `[` + `upper-suffix` : go first.
177
+ - `[` + `lower-suffix` : go backward.
178
+ - `]` + `lower-suffix` : go forward.
179
+ - `]` + `upper-suffix` : go last.
180
+
181
+ When supplied with a non-letter, only forward/backward mappings are created.
182
+
183
+ ## Options ~
184
+
185
+ The `options` key is directly forwarded as `opts` to corresponding Lua function.
186
+
187
+ ------------------------------------------------------------------------------
188
+ *MiniBracketed.buffer()*
189
+ `MiniBracketed.buffer`({direction}, {opts})
190
+ Listed buffer
191
+
192
+ Go to next/previous listed buffer. Order by their number (see |bufnr()|).
193
+
194
+ Direction "forward" increases number, "backward" - decreases.
195
+
196
+ Parameters ~
197
+ {direction} `(string)` One of "first", "backward", "forward", "last".
198
+ {opts} `(table|nil)` Options. A table with fields:
199
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
200
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
201
+
202
+ ------------------------------------------------------------------------------
203
+ *MiniBracketed.comment()*
204
+ `MiniBracketed.comment`({direction}, {opts})
205
+ Comment block
206
+
207
+ Go to next/previous comment block. Only linewise comments using
208
+ |'commentstring'| are recognized.
209
+
210
+ Direction "forward" increases line number, "backward" - decreases.
211
+
212
+ Parameters ~
213
+ {direction} `(string)` One of "first", "backward", "forward", "last".
214
+ {opts} `(table|nil)` Options. A table with fields:
215
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
216
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
217
+ - <add_to_jumplist> (`boolean`) - Whether to add current position to jumplist.
218
+ Default: `false`.
219
+ - <block_side> `(string)` - which side of comment block to use. One of
220
+ "near" (default; use nearest side), "start" (use first line), "end"
221
+ (use last line), "both" (use both first and last lines).
222
+
223
+ ------------------------------------------------------------------------------
224
+ *MiniBracketed.conflict()*
225
+ `MiniBracketed.conflict`({direction}, {opts})
226
+ Git conflict marker
227
+
228
+ Go to next/previous lines containing Git conflict marker. That is, if it
229
+ starts with "<<<<<<< ", ">>>>>>> ", or is "=======".
230
+
231
+ Direction "forward" increases line number, "backward" - decreases.
232
+
233
+ Notes:
234
+ - Using this target in Operator-pending mode allows the following approach
235
+ at resolving merge conflicts:
236
+ - Place cursor on `=======` line.
237
+ - Execute one of these: `d]x[xdd` (choose upper part) or
238
+ `d[x]xdd` (choose lower part).
239
+
240
+ Parameters ~
241
+ {direction} `(string)` One of "first", "backward", "forward", "last".
242
+ {opts} `(table|nil)` Options. A table with fields:
243
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
244
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
245
+ - <add_to_jumplist> (`boolean`) - Whether to add current position to jumplist.
246
+ Default: `false`.
247
+
248
+ ------------------------------------------------------------------------------
249
+ *MiniBracketed.diagnostic()*
250
+ `MiniBracketed.diagnostic`({direction}, {opts})
251
+ Diagnostic
252
+
253
+ Go to next/previous diagnostic. This is mostly similar to built-in
254
+ |vim.diagnostic.jump()| (on Neovim<0.11 it is |vim.diagnostic.goto_next()| and
255
+ |vim.diagnostic.goto_prev()|) which has an interface and behavior
256
+ consistent with other methods of the module.
257
+
258
+ Direction "forward" increases line number, "backward" - decreases.
259
+
260
+ Notes:
261
+ - Using `severity` option, this target can be used in mappings like "go to
262
+ next/previous error" (), etc. Using code similar to this: >lua
263
+
264
+ local severity_error = vim.diagnostic.severity.ERROR
265
+ -- Use these inside custom mappings
266
+ MiniBracketed.diagnostic('forward', { severity = severity_error })
267
+ MiniBracketed.diagnostic('backward', { severity = severity_error })
268
+ <
269
+ Parameters ~
270
+ {direction} `(string)` One of "first", "backward", "forward", "last".
271
+ {opts} `(table|nil)` Options. A table with fields:
272
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
273
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
274
+ - <float> `(boolean|table)` - control floating window after movement.
275
+ For available values see |vim.diagnostic.goto_next()|.
276
+ - <severity> `(string|table)` - which severity to use.
277
+ For available values see |diagnostic-severity|.
278
+
279
+ ------------------------------------------------------------------------------
280
+ *MiniBracketed.file()*
281
+ `MiniBracketed.file`({direction}, {opts})
282
+ File on disk
283
+
284
+ Go to next/previous file on disk alphabetically. Files are taken from
285
+ directory of file in current buffer (or current working directory if buffer
286
+ doesn't contain a readable file). Only first-level files are used, i.e. it
287
+ doesn't go inside subdirectories.
288
+
289
+ Direction "forward" goes forward alphabetically, "backward" - backward.
290
+
291
+ Parameters ~
292
+ {direction} `(string)` One of "first", "backward", "forward", "last".
293
+ {opts} `(table|nil)` Options. A table with fields:
294
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
295
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
296
+
297
+ ------------------------------------------------------------------------------
298
+ *MiniBracketed.indent()*
299
+ `MiniBracketed.indent`({direction}, {opts})
300
+ Indent change
301
+
302
+ Go to next/previous line with different indent (see |indent()|).
303
+ Can be used to go to lines with smaller, bigger, or different indent.
304
+
305
+ Notes:
306
+ - Directions "first" and "last" work differently from most other targets
307
+ for performance reasons. They are essentially "backward" and "forward"
308
+ with very big `n_times` option.
309
+ - For similar reasons, `wrap` is not supported.
310
+ - Blank line inherit indent from near non-blank line in direction of movement.
311
+
312
+ Direction "forward" increases line number, "backward" - decreases.
313
+
314
+ Parameters ~
315
+ {direction} `(string)` One of "first", "backward", "forward", "last".
316
+ {opts} `(table|nil)` Options. A table with fields:
317
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
318
+ - <add_to_jumplist> (`boolean`) - Whether to add current position to jumplist.
319
+ Default: `false`.
320
+ - <change_type> `(string)` - which type of indent change to use.
321
+ One of "less" (default; smaller indent), "more" (bigger indent),
322
+ "diff" (different indent).
323
+
324
+ ------------------------------------------------------------------------------
325
+ *MiniBracketed.jump()*
326
+ `MiniBracketed.jump`({direction}, {opts})
327
+ Jump inside current buffer
328
+
329
+ Go to next/previous jump from |jumplist| which is inside current buffer.
330
+
331
+ Notes:
332
+ - There are no Visual mode mappings due to implementation problems.
333
+
334
+ Direction "forward" increases jump number, "backward" - decreases.
335
+
336
+ Parameters ~
337
+ {direction} `(string)` One of "first", "backward", "forward", "last".
338
+ {opts} `(table|nil)` Options. A table with fields:
339
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
340
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
341
+
342
+ ------------------------------------------------------------------------------
343
+ *MiniBracketed.location()*
344
+ `MiniBracketed.location`({direction}, {opts})
345
+ Location from location list
346
+
347
+ Go to next/previous location from |location-list|. This is similar to
348
+ |:lfirst|, |:lprevious|, |:lnext|, and |:llast| but with support of
349
+ wrapping around edges and |[count]| for "first"/"last" direction.
350
+
351
+ Direction "forward" increases location number, "backward" - decreases.
352
+
353
+ Parameters ~
354
+ {direction} `(string)` One of "first", "backward", "forward", "last".
355
+ {opts} `(table|nil)` Options. A table with fields:
356
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
357
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
358
+
359
+ ------------------------------------------------------------------------------
360
+ *MiniBracketed.oldfile()*
361
+ `MiniBracketed.oldfile`({direction}, {opts})
362
+ Old files from previous and current sessions
363
+
364
+ Go to older/newer readable file either from previous session (see |v:oldfiles|)
365
+ or the current one (updated automatically after |MiniBracketed.setup()| call).
366
+
367
+ Direction "forward" goes to more recent files, "backward" - to older.
368
+
369
+ Notes:
370
+ - In current session it tracks only normal buffers (see |'buftype'|) for
371
+ some readable file.
372
+ - No new file is tracked when advancing this target. Only after buffer
373
+ change is done not through this target (like with |MiniBracketed.buffer()|),
374
+ it updates recency of last advanced and new buffers.
375
+
376
+ Parameters ~
377
+ {direction} `(string)` One of "first", "backward", "forward", "last".
378
+ {opts} `(table|nil)` Options. A table with fields:
379
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
380
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
381
+
382
+ ------------------------------------------------------------------------------
383
+ *MiniBracketed.quickfix()*
384
+ `MiniBracketed.quickfix`({direction}, {opts})
385
+ Quickfix from quickfix list
386
+
387
+ Go to next/previous entry from |quickfix| list. This is similar to
388
+ |:cfirst|, |:cprevious|, |:cnext|, and |:clast| but with support of
389
+ wrapping around edges and |[count]| for "first"/"last" direction.
390
+
391
+ Direction "forward" increases location number, "backward" - decreases.
392
+
393
+ Parameters ~
394
+ {direction} `(string)` One of "first", "backward", "forward", "last".
395
+ {opts} `(table|nil)` Options. A table with fields:
396
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
397
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
398
+
399
+ ------------------------------------------------------------------------------
400
+ *MiniBracketed.treesitter()*
401
+ `MiniBracketed.treesitter`({direction}, {opts})
402
+ Tree-sitter node
403
+
404
+ Go to end/start of current tree-sitter node and its parents (except root).
405
+
406
+ Notes:
407
+ - Requires loaded tree-sitter parser in the current buffer.
408
+ - Directions "first" and "last" work differently from most other targets
409
+ for performance reasons. They are essentially "backward" and "forward"
410
+ with very big `n_times` option.
411
+ - For similar reasons, `wrap` is not supported.
412
+
413
+ Direction "forward" moves cursor forward to node's end, "backward" - backward
414
+ to node's start.
415
+
416
+ Parameters ~
417
+ {direction} `(string)` One of "first", "backward", "forward", "last".
418
+ {opts} `(table|nil)` Options. A table with fields:
419
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
420
+ - <add_to_jumplist> (`boolean`) - Whether to add current position to jumplist.
421
+ Default: `false`.
422
+
423
+ ------------------------------------------------------------------------------
424
+ *MiniBracketed.undo()*
425
+ `MiniBracketed.undo`({direction}, {opts})
426
+ Undo along a tracked linear history
427
+
428
+ In a nutshell:
429
+ - Keys |u| and |CTRL-R| (although remapped) can be used as usual, but every
430
+ their execution new state is recorded in this module's linear undo history.
431
+ - Advancing this target goes along linear undo history revealing undo states
432
+ IN ORDER THEY ACTUALLY APPEARED.
433
+ - One big difference with built-in methods is that tracked linear history
434
+ can repeat undo states (not consecutively, though).
435
+
436
+ Neovim's default way of managing undo history is through branches (see
437
+ |undo-branches|). Basically it means that if you undo several changes and then
438
+ make new ones, it creates new undo branch while usually (see |'undolevels'|)
439
+ saving previous buffer states in another branch. While there are commands
440
+ to navigate by time of undo state creation (like |:earlier| and |:later|),
441
+ there is no intuitive way to cycle through them. Existing |g-| and |g+|
442
+ cycle through undo states BASED ON THEIR CREATION TIME, which often
443
+ gets confusing really guickly in extensively edited buffer.
444
+
445
+ This `undo()` target provides a way to cycle through linear undo history
446
+ IN ORDER STATES ACTUALLY APPEARED. It does so by registering any new undo
447
+ states plus every time |MiniBracketed.register_undo_state()| is called. To have
448
+ more "out of the box" experience, |u| and |CTRL-R| are remapped to call it after
449
+ they perform their undo/redo.
450
+
451
+ Example:
452
+
453
+ To show more clearly the difference between advancing this target and using
454
+ built-in functionality, here is an example:
455
+
456
+ - Create undo history in a new buffer (|:new|):
457
+ - Enter `one two three` text.
458
+ - Delete first word with `daw` and undo the change with `u`.
459
+ - Delete second word with `daw` and undo the change with `u`.
460
+ - Delete third word with `daw` and undo the change with `u`.
461
+
462
+ - Now try one of the following (each one after performing previous steps in
463
+ separate new buffer):
464
+ - Press `u`. It goes back to empty buffer. Press `<C-R>` twice and it
465
+ goes to the latest change (`one two`). No way to get to other states
466
+ (like `two three` or `one three`) with these two keys.
467
+
468
+ - Press `g-`. It goes to an empty buffer. Press `g+` 4 times. It cycles
469
+ through all available undo states IN ORDER THEY WERE CREATED.
470
+
471
+ - Finally, press `[u`. It goes back to `one two` - state which was
472
+ PREVIOUSLY VISITED by the user. Another `[u` restores `one two three`.
473
+ Use `]U` to go to latest visited undo state.
474
+
475
+ Parameters ~
476
+ {direction} `(string)` One of "first", "backward", "forward", "last".
477
+ {opts} `(table|nil)` Options. A table with fields:
478
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
479
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
480
+
481
+ ------------------------------------------------------------------------------
482
+ *MiniBracketed.register_undo_state()*
483
+ `MiniBracketed.register_undo_state`()
484
+ Register state for undo target
485
+
486
+ Use this function to add current undo state to this module's linear undo
487
+ history. It is used in |MiniBracketed.setup()| to remap |u| and |CTRL-R| keys
488
+ to add their new state to linear undo history.
489
+
490
+ ------------------------------------------------------------------------------
491
+ *MiniBracketed.window()*
492
+ `MiniBracketed.window`({direction}, {opts})
493
+ Normal window
494
+
495
+ Go to next/previous normal window. Order by their number (see |winnr()|).
496
+
497
+ Direction "forward" increases window number, "backward" - decreases.
498
+
499
+ Only normal (non-floating) windows are used.
500
+
501
+ Parameters ~
502
+ {direction} `(string)` One of "first", "backward", "forward", "last".
503
+ {opts} `(table|nil)` Options. A table with fields:
504
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
505
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
506
+
507
+ ------------------------------------------------------------------------------
508
+ *MiniBracketed.yank()*
509
+ `MiniBracketed.yank`({direction}, {opts})
510
+ Replace "latest put region" with yank history entry
511
+
512
+ After |MiniBracketed.setup()| is called, on every yank/delete/change operation
513
+ (technically, every trigger of |TextYankPost| event) the object of operation
514
+ is added to yank history. Advancing this target will replace the region of
515
+ latest put operation with entry from yank history.
516
+
517
+ By default works best if called RIGHT AFTER text paste (like with |p| or |P|).
518
+
519
+ To better detect "latest put region", use |MiniBracketed.register_put_region()|
520
+ as described later.
521
+
522
+ Direction "forward" goes to newer yank history entry, "backward" - to older.
523
+
524
+ Example:
525
+
526
+ - Type `one two three`.
527
+ - Yank each word with `yiw`.
528
+ - Create new line and press `p`. This should paste `three`.
529
+ - Type `[y`. This should replace latest `three` with `two`.
530
+
531
+ # Latest put region ~
532
+
533
+ "Latest put region" is (in order of decreasing priority):
534
+ - The one from latest advance of this target.
535
+ - The one registered by user with |MiniBracketed.register_put_region()|.
536
+ - The one taken from |'[| and |']| marks.
537
+
538
+ For users there are these approaches to manage which region will be used:
539
+ - Do nothing. In this case region between `[` / `]` marks will always be used
540
+ for first `yank` advance.
541
+ Although doable, this has several drawbacks: it will use latest yanked or
542
+ changed region or the entire buffer if marks are not set.
543
+ If remember to advance this target only after recent put operation, this
544
+ should work as expected.
545
+
546
+ - Remap common put operations to use |MiniBracketed.register_put_region()|.
547
+ After that, only regions from mapped put operations will be used for first
548
+ advance. Example of custom mappings (note use of |:map-expression|): >lua
549
+
550
+ local put_keys = { 'p', 'P' }
551
+ for _, lhs in ipairs(put_keys) do
552
+ local rhs = 'v:lua.MiniBracketed.register_put_region("' .. lhs .. '")'
553
+ vim.keymap.set({ 'n', 'x' }, lhs, rhs, { expr = true })
554
+ end
555
+ <
556
+ Parameters ~
557
+ {direction} `(string)` One of "first", "backward", "forward", "last".
558
+ {opts} `(table|nil)` Options. A table with fields:
559
+ - <n_times> `(number)` - Number of times to advance. Default: |v:count1|.
560
+ - <wrap> `(boolean)` - Whether to wrap around edges. Default: `true`.
561
+ - <operators> `(table)` - array of operator names ("c", "d", or "y") for
562
+ which yank entry should be used to advance. For example, use `{ "y" }`
563
+ to advance only by entries actually resulted from yank operation with |y|.
564
+ Default: `{ 'c', 'd', 'y' }`.
565
+
566
+ ------------------------------------------------------------------------------
567
+ *MiniBracketed.register_put_region()*
568
+ `MiniBracketed.register_put_region`({put_key})
569
+ Register "latest put region"
570
+
571
+ This function should be called after put register becomes relevant
572
+ (|v:register| is appropriately set) but before put operation takes place
573
+ (|'[| and |']| marks become relevant).
574
+
575
+ Designed to be used in a user-facing expression mapping (see |:map-expression|).
576
+ For mapping examples see |MiniBracketed.yank()|.
577
+
578
+ Parameters ~
579
+ {put_key} `(string)` Put keys to be remapped.
580
+
581
+ Return ~
582
+ `(string)` Returns `put_key` for a better usage inside expression mappings.
583
+
584
+ ------------------------------------------------------------------------------
585
+ *MiniBracketed.advance()*
586
+ `MiniBracketed.advance`({iterator}, {direction}, {opts})
587
+ Advance iterator
588
+
589
+ This is the main function which performs any forward/backward/first/last
590
+ advance in this module. Its basic idea is to take iterator (object containing
591
+ information about current state and how to go to next/previous one) and go
592
+ in certain direction until needed/allowed.
593
+
594
+ Notes:
595
+ - Directions "first" and "last" are convenience wrappers for "forward" and
596
+ "backward" with pre-setting initial state to `start_edge` and `end_edge`.
597
+ - Iterators `next()` and `prev()` methods should be able to handle `nil` as input.
598
+ - This function only returns new state and doesn't modify `iterator.state`.
599
+
600
+ Parameters ~
601
+ {iterator} `(table)` Table:
602
+ - Methods:
603
+ - <next> - given state, return state in forward direction (no wrap).
604
+ - <prev> - given state, return state in backward direction (no wrap).
605
+ - Fields:
606
+ - <state> - object describing current state.
607
+ - <start_edge> (optional) - object with `forward(start_edge)` describing
608
+ first state. If `nil`, can't wrap forward or use direction "first".
609
+ - <end_edge> (optional) - object with `backward(end_edge)` describing
610
+ last state. If `nil`, can't wrap backward or use direction "last".
611
+ {direction} `(string)` Direction. One of "first", "backward", "forward", "last".
612
+ {opts} `(table|nil)` Options with the following keys:
613
+ - <n_times> `(number)` - number of times to go in input direction.
614
+ Default: `v:count1`.
615
+ - <wrap> `(boolean)` - whether to wrap around edges when `next()` or
616
+ `prev()` return `nil`. Default: `true`.
617
+
618
+ Return ~
619
+ `(any)` Result state. If `nil`, could not reach any valid result state.
620
+
621
+
622
+ vim:tw=78:ts=8:noet:ft=help:norl: