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,472 @@
1
+ *mini.operators* Text edit operators
2
+
3
+ MIT License Copyright (c) 2023 Evgeni Chasnovski
4
+
5
+ ------------------------------------------------------------------------------
6
+ *MiniOperators*
7
+ Features:
8
+ - Operators:
9
+ - Evaluate text and replace with output.
10
+ - Exchange text regions.
11
+ - Multiply (duplicate) text.
12
+ - Replace text with register.
13
+ - Sort text.
14
+
15
+ - Automated configurable mappings to operate on textobject, line, selection.
16
+ Can be disabled in favor of more control with |MiniOperators.make_mappings()|.
17
+
18
+ - All operators support |[count]| and dot-repeat.
19
+
20
+ See |MiniOperators-overview| and |MiniOperators.config| for more details.
21
+
22
+ # Setup ~
23
+
24
+ This module needs a setup with `require('mini.operators').setup({})` (replace
25
+ `{}` with your `config` table). It will create global Lua table `MiniOperators`
26
+ which you can use for scripting or manually (with `:lua MiniOperators.*`).
27
+
28
+ See |MiniOperators.config| for available config settings.
29
+
30
+ You can override runtime config settings (but not `config.mappings`) locally
31
+ to buffer inside `vim.b.minioperators_config` which should have same structure
32
+ as `MiniOperators.config`. See |mini.nvim-buffer-local-config| for more details.
33
+
34
+ # Comparisons ~
35
+
36
+ - [gbprod/substitute.nvim](https://github.com/gbprod/substitute.nvim):
37
+ - Has "replace" and "exchange" variants, but not others from this module.
38
+ - Has "replace/substitute" over range functionality, while this module
39
+ does not by design (it is similar to |:s| functionality while not
40
+ offering significantly lower mental complexity).
41
+ - "Replace" highlights pasted text, while in this module it doesn't.
42
+ - "Exchange" doesn't work across buffers, while in this module it does.
43
+
44
+ - [svermeulen/vim-subversive](https://github.com/svermeulen/vim-subversive):
45
+ - Main inspiration for "replace" functionality, so they are mostly similar
46
+ for this operator.
47
+ - Has "replace/substitute" over range functionality, while this module
48
+ does not by design.
49
+
50
+ - [tommcdo/vim-exchange](https://github.com/tommcdo/vim-exchange):
51
+ - Main inspiration for "exchange" functionality, so they are mostly
52
+ similar for this operator.
53
+ - Doesn't work across buffers, while this module does.
54
+
55
+ - [christoomey/vim-sort-motion](https://github.com/christoomey/vim-sort-motion):
56
+ - Uses |:sort| for linewise sorting, while this module uses consistent
57
+ sorting algorithm (by default, see |MiniOperators.default_sort_func()|).
58
+ - Sorting algorithm can't be customized, while this module allows this
59
+ (see `sort.func` in |MiniOperators.config|).
60
+ - For charwise region uses only commas as separators, while this module
61
+ can also separate by semicolon or whitespace (by default,
62
+ see |MiniOperators.default_sort_func()|).
63
+
64
+ # Highlight groups ~
65
+ *MiniOperators-hl-groups*
66
+
67
+ - `MiniOperatorsExchangeFrom` - first region to exchange.
68
+
69
+ To change any highlight group, set it directly with |nvim_set_hl()|.
70
+
71
+ # Disabling ~
72
+
73
+ To disable main functionality, set `vim.g.minioperators_disable` (globally) or
74
+ `vim.b.minioperators_disable` (for a buffer) to `true`. Considering high number
75
+ of different scenarios and customization intentions, writing exact rules
76
+ for disabling module's functionality is left to user. See
77
+ |mini.nvim-disabling-recipes| for common recipes.
78
+
79
+ ------------------------------------------------------------------------------
80
+ *MiniOperators-overview*
81
+ Operator defines an action that will be performed on a textobject, motion,
82
+ or visual selection (similar to |d|, |c|, etc.). When makes sense, it can also
83
+ respect supplied register (like "replace" operator).
84
+
85
+ This module implements each operator in a separate dedicated function
86
+ (like |MiniOperators.replace()| for "replace" operator). Each such function
87
+ takes `mode` as argument and acts depending on it:
88
+
89
+ - If `mode` is `nil` (or not explicitly supplied), it sets |'operatorfunc'|
90
+ to this dedicated function and returns `g@` assuming being called from
91
+ expression mapping. See |:map-operator| and |:map-expression| for more details.
92
+
93
+ - If `mode` is "char", "line", or "block", it acts as `operatorfunc` and performs
94
+ action for region between |`[| and |`]| marks.
95
+
96
+ - If `mode` is "visual", it performs action for region between |`<| and |`>| marks.
97
+
98
+ For more details about specific operator, see help for its function:
99
+
100
+ - Evaluate: |MiniOperators.evaluate()|
101
+ - Exchange: |MiniOperators.exchange()|
102
+ - Multiply: |MiniOperators.multiply()|
103
+ - Replace: |MiniOperators.replace()|
104
+ - Sort: |MiniOperators.sort()|
105
+
106
+ # Mappings ~
107
+ *MiniOperators-mappings*
108
+
109
+ All operators are automatically mapped during |MiniOperators.setup()| execution.
110
+ Mappings keys are deduced from `prefix` field of corresponding `config` entry.
111
+ All built-in conflicting mappings are removed (like |gra|, |grn| in Neovim>=0.11).
112
+ Both |gx| and |v_gx| are remapped to `gX` (if that is not already taken).
113
+
114
+ For each operator the following mappings are created:
115
+
116
+ - In Normal mode to operate on textobject. Uses `prefix` directly.
117
+ - In Normal mode to operate on line. Appends to `prefix` the last character.
118
+ This aligns with |operator-doubled| and established patterns for operators
119
+ with more than two characters, like |guu|, |gUU|, etc.
120
+ - In Visual mode to operate on visual selection. Uses `prefix` directly.
121
+
122
+ Example of default mappings for "replace":
123
+ - `gr` in Normal mode for operating on textobject.
124
+ Example of usage: `griw` replaces "inner word" with default register.
125
+ - `grr` in Normal mode for operating on line.
126
+ Example of usage: `grr` replaces current line.
127
+ - `gr` in Visual mode for operating on visual selection.
128
+ Example of usage: `viw` selects "inner word" and `gr` replaces it.
129
+
130
+ There are two suggested ways to customize mappings:
131
+
132
+ - Change `prefix` in |MiniOperators.setup()| call. For example, doing >lua
133
+
134
+ require('mini.operators').setup({ replace = { prefix = 'cr' } })
135
+ <
136
+ will make mappings for `cr` / `crr` / `cr` instead of `gr` / `grr` / `gr`.
137
+
138
+ - Disable automated mapping creation by supplying empty string as prefix and
139
+ use |MiniOperators.make_mappings()| directly. For example: >lua
140
+
141
+ -- Disable automated creation of "replace"
142
+ local operators = require('mini.operators')
143
+ operators.setup({ replace = { prefix = '' } })
144
+
145
+ -- Make custom mappings
146
+ operators.make_mappings(
147
+ 'replace',
148
+ { textobject = 'cr', line = 'crr', selection = 'cr' }
149
+ )
150
+ <
151
+ ------------------------------------------------------------------------------
152
+ *MiniOperators.setup()*
153
+ `MiniOperators.setup`({config})
154
+ Module setup
155
+
156
+ Parameters ~
157
+ {config} `(table|nil)` Module config table. See |MiniOperators.config|.
158
+
159
+ Usage ~
160
+ >lua
161
+ require('mini.operators').setup() -- use default config
162
+ -- OR
163
+ require('mini.operators').setup({}) -- replace {} with your config table
164
+ <
165
+ ------------------------------------------------------------------------------
166
+ *MiniOperators.config*
167
+ `MiniOperators.config`
168
+ Defaults ~
169
+ >lua
170
+ MiniOperators.config = {
171
+ -- Each entry configures one operator.
172
+ -- `prefix` defines keys mapped during `setup()`: in Normal mode
173
+ -- to operate on textobject and line, in Visual - on selection.
174
+
175
+ -- Evaluate text and replace with output
176
+ evaluate = {
177
+ prefix = 'g=',
178
+
179
+ -- Function which does the evaluation
180
+ func = nil,
181
+ },
182
+
183
+ -- Exchange text regions
184
+ exchange = {
185
+ -- NOTE: Default `gx` is remapped to `gX`
186
+ prefix = 'gx',
187
+
188
+ -- Whether to reindent new text to match previous indent
189
+ reindent_linewise = true,
190
+ },
191
+
192
+ -- Multiply (duplicate) text
193
+ multiply = {
194
+ prefix = 'gm',
195
+
196
+ -- Function which can modify text before multiplying
197
+ func = nil,
198
+ },
199
+
200
+ -- Replace text with register
201
+ replace = {
202
+ -- NOTE: Default `gr*` LSP mappings are removed
203
+ prefix = 'gr',
204
+
205
+ -- Whether to reindent new text to match previous indent
206
+ reindent_linewise = true,
207
+ },
208
+
209
+ -- Sort text
210
+ sort = {
211
+ prefix = 'gs',
212
+
213
+ -- Function which does the sort
214
+ func = nil,
215
+ }
216
+ }
217
+ <
218
+ # Evaluate ~
219
+
220
+ `evaluate.prefix` is a string used to automatically infer operator mappings keys
221
+ during |MiniOperators.setup()|. See |MiniOperators-mappings|.
222
+
223
+ `evaluate.func` is a function used to actually evaluate text region.
224
+ If `nil` (default), |MiniOperators.default_evaluate_func()| is used.
225
+
226
+ This function will take content table representing selected text as input
227
+ and should return array of lines as output (each item per line).
228
+ Content table has fields `lines`, array of region lines, and `submode`,
229
+ one of `v`, `V`, `\22` (escaped `<C-v>`) for charwise, linewise, and blockwise.
230
+
231
+ To customize evaluation per language, set `evaluate.func` in buffer-local
232
+ config (`vim.b.minioperators_config`; see |mini.nvim-buffer-local-config|).
233
+
234
+ # Exchange ~
235
+
236
+ `exchange.prefix` is a string used to automatically infer operator mappings keys
237
+ during |MiniOperators.setup()|. See |MiniOperators-mappings|.
238
+
239
+ Note: default value "gx" overrides |gx| / |v_gx|. Instead they are remapped
240
+ to `gX` (if that is not already taken). To keep using `gx` with built-in
241
+ feature (open URL at cursor) choose different `config.prefix`.
242
+
243
+ `exchange.reindent_linewise` is a boolean indicating whether newly put linewise
244
+ text should preserve indent of replaced text. In other words, if `false`,
245
+ regions are exchanged preserving their indents; if `true` - without them.
246
+
247
+ # Multiply ~
248
+
249
+ `multiply.prefix` is a string used to automatically infer operator mappings keys
250
+ during |MiniOperators.setup()|. See |MiniOperators-mappings|.
251
+
252
+ `multiply.func` is a function used to optionally update multiplied text.
253
+ If `nil` (default), text used as is.
254
+
255
+ Takes content table as input (see "Evaluate" section) and should return
256
+ array of lines as output.
257
+
258
+ # Replace ~
259
+
260
+ `replace.prefix` is a string used to automatically infer operator mappings keys
261
+ during |MiniOperators.setup()|. See |MiniOperators-mappings|.
262
+
263
+ `replace.reindent_linewise` is a boolean indicating whether newly put linewise
264
+ text should preserve indent of replaced text.
265
+
266
+ # Sort ~
267
+
268
+ `sort.prefix` is a string used to automatically infer operator mappings keys
269
+ during |MiniOperators.setup()|. See |MiniOperators-mappings|.
270
+
271
+ `sort.func` is a function used to actually sort text region.
272
+ If `nil` (default), |MiniOperators.default_sort_func()| is used.
273
+
274
+ Takes content table as input (see "Evaluate" section) and should return
275
+ array of lines as output.
276
+
277
+ Example of `sort.func` which asks user for custom delimiter for charwise region: >lua
278
+
279
+ local sort_func = function(content)
280
+ local opts = {}
281
+ if content.submode == 'v' then
282
+ -- Ask for delimiter to be treated as is (not as Lua pattern)
283
+ local delimiter = vim.fn.input('Sort delimiter: ')
284
+ -- Treat surrounding whitespace as part of split
285
+ opts.split_patterns = { '%s*' .. vim.pesc(delimiter) .. '%s*' }
286
+ end
287
+ return MiniOperators.default_sort_func(content, opts)
288
+ end
289
+
290
+ require('mini.operators').setup({ sort = { func = sort_func } })
291
+ <
292
+ ------------------------------------------------------------------------------
293
+ *MiniOperators.evaluate()*
294
+ `MiniOperators.evaluate`({mode})
295
+ Evaluate text and replace with output
296
+
297
+ It replaces the region with the output of `config.evaluate.func`.
298
+ By default it is |MiniOperators.default_evaluate_func()| which evaluates
299
+ text as Lua code depending on the region submode.
300
+
301
+ Parameters ~
302
+ {mode} `(string|nil)` One of `nil`, `'char'`, `'line'`, `'block'`, `'visual'`.
303
+
304
+ ------------------------------------------------------------------------------
305
+ *MiniOperators.exchange()*
306
+ `MiniOperators.exchange`({mode})
307
+ Exchange text regions
308
+
309
+ Has two-step logic:
310
+ - First call remembers the region as the one to be exchanged and highlights it
311
+ with `MiniOperatorsExchangeFrom` highlight group.
312
+ - Second call performs the exchange. Basically, a two substeps action:
313
+ "yank both regions" and replace each one with another.
314
+
315
+ Notes:
316
+ - Use `<C-c>` to stop exchanging after the first step.
317
+
318
+ - Exchanged regions can have different (char,line,block)-wise submodes.
319
+
320
+ - Works with most cases of intersecting regions, but not officially supported.
321
+
322
+ Parameters ~
323
+ {mode} `(string|nil)` One of `nil`, `'char'`, `'line'`, `'block'`, `'visual'`.
324
+
325
+ ------------------------------------------------------------------------------
326
+ *MiniOperators.multiply()*
327
+ `MiniOperators.multiply`({mode})
328
+ Multiply (duplicate) text
329
+
330
+ Copies a region (without affecting registers) and puts it directly after.
331
+
332
+ Notes:
333
+ - Supports two types of |[count]|: `[count1]gm[count2][textobject]` with default
334
+ `config.multiply.prefix` makes `[count1]` copies of region defined by
335
+ `[count2][textobject]`. Example: `2gm3aw` - 2 copies of `3aw`.
336
+
337
+ - |[count]| for "line" mapping (`gmm` by default) is treated as `[count1]` from
338
+ previous note.
339
+
340
+ - Advantages of using this instead of "yank" + "paste":
341
+ - Doesn't modify any register, while separate steps need some register to
342
+ hold multiplied text.
343
+ - In most cases separate steps would be "yank" + "move cursor" + "paste",
344
+ while "multiply" makes it at once.
345
+
346
+ Parameters ~
347
+ {mode} `(string|nil)` One of `nil`, `'char'`, `'line'`, `'block'`, `'visual'`.
348
+
349
+ ------------------------------------------------------------------------------
350
+ *MiniOperators.replace()*
351
+ `MiniOperators.replace`({mode})
352
+ Replace text with register
353
+
354
+ Notes:
355
+ - Supports two types of |[count]|: `[count1]gr[count2][textobject]` with default
356
+ `config.replace.prefix` puts `[count1]` contents of register over region defined
357
+ by `[count2][textobject]`. Example: `2gr3aw` - 2 register contents over `3aw`.
358
+
359
+ - |[count]| for "line" mapping (`grr` by default) is treated as `[count1]` from
360
+ previous note.
361
+
362
+ - Advantages of using this instead of "visually select" + "paste with |v_P|":
363
+ - As operator it is dot-repeatable which has cumulative gain in case of
364
+ multiple replacing is needed.
365
+ - Can automatically reindent.
366
+
367
+ Parameters ~
368
+ {mode} `(string|nil)` One of `nil`, `'char'`, `'line'`, `'block'`, `'visual'`.
369
+
370
+ ------------------------------------------------------------------------------
371
+ *MiniOperators.sort()*
372
+ `MiniOperators.sort`({mode})
373
+ Sort text
374
+
375
+ It replaces the region with the output of `config.sort.func`.
376
+ By default it is |MiniOperators.default_sort_func()| which sorts the text
377
+ depending on submode.
378
+
379
+ Notes:
380
+ - "line" mapping is charwise (as there is not much sense in sorting
381
+ linewise a single line). This also results into no |[count]| support.
382
+
383
+ Parameters ~
384
+ {mode} `(string|nil)` One of `nil`, `'char'`, `'line'`, `'block'`, `'visual'`.
385
+
386
+ ------------------------------------------------------------------------------
387
+ *MiniOperators.make_mappings()*
388
+ `MiniOperators.make_mappings`({operator_name}, {lhs_tbl})
389
+ Make operator mappings
390
+
391
+ Parameters ~
392
+ {operator_name} `(string)` Name of existing operator from this module.
393
+ {lhs_tbl} `(table)` Table with mappings keys. Should have these fields:
394
+ - <textobject> `(string)` - Normal mode mapping to operate on textobject.
395
+ - <line> `(string)` - Normal mode mapping to operate on line.
396
+ Usually an alias for textobject mapping followed by |_|.
397
+ For "sort" it operates charwise on whole line without left and right
398
+ whitespace (as there is not much sense in sorting linewise a single line).
399
+ - <selection> `(string)` - Visual mode mapping to operate on selection.
400
+
401
+ Supply empty string to not create particular mapping. Note: creating `line`
402
+ mapping needs `textobject` mapping to be set.
403
+
404
+ Usage ~
405
+ >lua
406
+ require('mini.operators').make_mappings(
407
+ 'replace',
408
+ { textobject = 'cr', line = 'crr', selection = 'cr' }
409
+ )
410
+ <
411
+ ------------------------------------------------------------------------------
412
+ *MiniOperators.default_evaluate_func()*
413
+ `MiniOperators.default_evaluate_func`({content})
414
+ Default evaluate function
415
+
416
+ Evaluate text as Lua code and return object from last line (like if last
417
+ line is prepended with `return` if it is not already).
418
+
419
+ Behavior depends on region submode:
420
+
421
+ - For charwise and linewise regions, text evaluated as is.
422
+
423
+ - For blockwise region, lines are evaluated per line using only first lines
424
+ of outputs. This allows separate execution of lines in order to provide
425
+ something different compared to linewise region.
426
+
427
+ Parameters ~
428
+ {content} `(table)` Table with the following fields:
429
+ - <lines> `(table)` - array with content lines.
430
+ - <submode> `(string)` - region submode. One of `'v'`, `'V'`, `'<C-v>'` (escaped).
431
+
432
+ ------------------------------------------------------------------------------
433
+ *MiniOperators.default_sort_func()*
434
+ `MiniOperators.default_sort_func`({content}, {opts})
435
+ Default sort function
436
+
437
+ Sort text based on region submode:
438
+
439
+ - For charwise region, split by separator pattern, sort parts, merge back
440
+ with separators. Actual pattern is inferred based on the array of patterns
441
+ from `opts.split_patterns`: whichever element is present in the text is
442
+ used, preferring the earlier one if several are present.
443
+ Example: sorting "c, b; a" line with default `opts.split_patterns` results
444
+ into "b; a, c" as it is split only by comma.
445
+
446
+ - For linewise and blockwise regions sort lines as is.
447
+
448
+ Notes:
449
+ - Sort is done with |table.sort()| on an array of lines, which doesn't treat
450
+ whitespace or digits specially. Use |:sort| for more complicated tasks.
451
+
452
+ - Pattern is allowed to be an empty string in which case split results into
453
+ all characters as parts.
454
+
455
+ - Pad pattern in `split_patterns` with `%s*` to include whitespace into separator.
456
+ Example: line "b _ a" with "_" pattern will be sorted as " a_b " (because
457
+ it is split as "b ", "_", " a" ) while with `%s*_%s*` pattern it results
458
+ into "a _ b" (split as "b", " _ ", "a").
459
+
460
+ Parameters ~
461
+ {content} `(table)` Table with the following fields:
462
+ - <lines> `(table)` - array with content lines.
463
+ - <submode> `(string)` - region submode. One of `'v'`, `'V'`, `'<C-v>'` (escaped).
464
+ {opts} `(table|nil)` Options. Possible fields:
465
+ - <compare_fun> `(function)` - compare function compatible with |table.sort()|.
466
+ Default: direct compare with `<`.
467
+ - <split_patterns> `(table)` - array of split Lua patterns to be used for
468
+ charwise submode. Order is important.
469
+ Default: `{ '%s*,%s*', '%s*;%s*', '%s+', '' }`.
470
+
471
+
472
+ vim:tw=78:ts=8:noet:ft=help:norl: