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,160 @@
1
+ *mini.fuzzy* Fuzzy matching
2
+
3
+ MIT License Copyright (c) 2021 Evgeni Chasnovski
4
+
5
+ ------------------------------------------------------------------------------
6
+ *MiniFuzzy*
7
+ Features:
8
+ - Minimal and fast fuzzy matching algorithm which prioritizes match width.
9
+
10
+ - Functions to for common fuzzy matching operations:
11
+ - |MiniFuzzy.match()|.
12
+ - |MiniFuzzy.filtersort()|.
13
+ - |MiniFuzzy.process_lsp_items()|.
14
+
15
+ - Generator of sorter (|MiniFuzzy.get_telescope_sorter()|) for
16
+ [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
17
+
18
+ # Setup ~
19
+
20
+ This module doesn't need setup, but it can be done to improve usability.
21
+ Setup with `require('mini.fuzzy').setup({})` (replace `{}` with your
22
+ `config` table). It will create global Lua table `MiniFuzzy` which you can
23
+ use for scripting or manually (with `:lua MiniFuzzy.*`).
24
+
25
+ See |MiniFuzzy.config| for `config` structure and default values.
26
+
27
+ You can override runtime config settings locally to buffer inside
28
+ `vim.b.minifuzzy_config` which should have same structure as
29
+ `MiniFuzzy.config`.
30
+ See |mini.nvim-buffer-local-config| for more details.
31
+
32
+ # Notes ~
33
+
34
+ 1. Currently there is no explicit design to work with multibyte symbols,
35
+ but simple examples should work.
36
+ 2. Smart case is used: case insensitive if input word (which is usually a
37
+ user input) is all lower case. Case sensitive otherwise.
38
+
39
+ ------------------------------------------------------------------------------
40
+ *MiniFuzzy-algorithm*
41
+ General design uses only width of found match and index of first letter
42
+ match. No special characters or positions (like in fzy and fzf) are used.
43
+
44
+ Given non-empty input `word` and target `candidate`:
45
+ - The goal is to find matching between letters in `word` and letters in
46
+ `candidate` which minimizes certain score. It is assumed that order of
47
+ letters in `word` and those matched in `candidate` should be the same.
48
+
49
+ - Matching is represented by matched positions: an array `positions` of
50
+ integers with length equal to number of letters in `word`. The following
51
+ should be always true in case of a match: `candidate` letter at index
52
+ `positions[i]` is `letters[i]` for all valid `i`.
53
+
54
+ - Matched positions are evaluated based only on two features: their width
55
+ (number of indexes between first and last positions) and first match
56
+ (index of first letter match). There is a global setting `cutoff` for
57
+ which all feature values greater than it can be considered "equally bad".
58
+
59
+ - Score of matched positions is computed with following explicit formula:
60
+ `cutoff * min(width, cutoff) + min(first, cutoff)`. It is designed to be
61
+ equivalent to first comparing widths (lower is better) and then comparing
62
+ first match (lower is better). For example, if `word = 'time'`:
63
+ - `_time` (width 4) will have a better match than `t_ime` (width 5).
64
+ - `time_a` (width 4, first 1) will have a better match than `a_time`
65
+ (width 4, first 3).
66
+
67
+ - Final matched positions are those which minimize score among all possible
68
+ matched positions of `word` and `candidate`.
69
+
70
+ ------------------------------------------------------------------------------
71
+ *MiniFuzzy.setup()*
72
+ `MiniFuzzy.setup`({config})
73
+ Module setup
74
+
75
+ Parameters ~
76
+ {config} `(table|nil)` Module config table. See |MiniFuzzy.config|.
77
+
78
+ Usage ~
79
+ >lua
80
+ require('mini.fuzzy').setup() -- use default config
81
+ -- OR
82
+ require('mini.fuzzy').setup({}) -- replace {} with your config table
83
+ <
84
+ ------------------------------------------------------------------------------
85
+ *MiniFuzzy.config*
86
+ `MiniFuzzy.config`
87
+ Defaults ~
88
+ >lua
89
+ MiniFuzzy.config = {
90
+ -- Maximum allowed value of match features (width and first match). All
91
+ -- feature values greater than cutoff can be considered "equally bad".
92
+ cutoff = 100,
93
+ }
94
+ <
95
+ ------------------------------------------------------------------------------
96
+ *MiniFuzzy.match()*
97
+ `MiniFuzzy.match`({word}, {candidate})
98
+ Compute match data
99
+
100
+ Parameters ~
101
+ {word} `(string)` Input word (usually user input).
102
+ {candidate} `(string)` Target word (usually with which matching is done).
103
+
104
+ Return ~
105
+ `(table)` Matching information:
106
+ - <positions> `(table|nil)` - array with letter indexes inside `candidate`
107
+ which matched to corresponding letters in `word`. It is empty array if
108
+ `word` is empty string and `nil` if no match.
109
+ - <score> `number` - positive number representing how good the match is
110
+ (lower is better). It is `-1` if no match or word is empty string.
111
+
112
+ ------------------------------------------------------------------------------
113
+ *MiniFuzzy.filtersort()*
114
+ `MiniFuzzy.filtersort`({word}, {candidate_array})
115
+ Filter string array
116
+
117
+ - Keep only input elements which match `word`.
118
+ - Sort from best to worst matches (based on score and index in original
119
+ array, both lower is better).
120
+
121
+ Parameters ~
122
+ {word} `(string)` String which will be searched.
123
+ {candidate_array} `(table)` Lua array of strings inside which word will be
124
+ searched.
125
+
126
+ Return ~
127
+ `(...)` Arrays of matched candidates and their indexes in original input.
128
+
129
+ ------------------------------------------------------------------------------
130
+ *MiniFuzzy.process_lsp_items()*
131
+ `MiniFuzzy.process_lsp_items`({items}, {base})
132
+ Fuzzy matching for `lsp_completion.process_items` of |MiniCompletion.config|
133
+
134
+ Parameters ~
135
+ {items} `(table)` Array with LSP `'textDocument/completion'` response items.
136
+ {base} `(string)` Word to complete.
137
+
138
+ Return ~
139
+ `(table)` Array of items with text (`filterText` or `label`) fuzzy matching `base`.
140
+
141
+ ------------------------------------------------------------------------------
142
+ *MiniFuzzy.get_telescope_sorter()*
143
+ `MiniFuzzy.get_telescope_sorter`({opts})
144
+ Custom getter for `telescope.nvim` sorter
145
+
146
+ Designed as a value for file and generic sorter of `telescope.nvim`.
147
+
148
+ Parameters ~
149
+ {opts} `(table|nil)` Options (currently not used).
150
+
151
+ Usage ~
152
+ >lua
153
+ require('telescope').setup({
154
+ defaults = {
155
+ generic_sorter = require('mini.fuzzy').get_telescope_sorter
156
+ }
157
+ })
158
+ <
159
+
160
+ vim:tw=78:ts=8:noet:ft=help:norl:
@@ -0,0 +1,425 @@
1
+ *mini.git* Git integration
2
+
3
+ MIT License Copyright (c) 2024 Evgeni Chasnovski
4
+
5
+ ------------------------------------------------------------------------------
6
+ *MiniGit*
7
+ Features:
8
+
9
+ - Automated tracking of Git related data: root path, status, HEAD, etc.
10
+ Exposes buffer-local variables for convenient use in statusline.
11
+ See |MiniGit.enable()| and |MiniGit.get_buf_data()| for more information.
12
+
13
+ - |:Git| command for executing any `git` call inside file's repository root with
14
+ deeper current instance integration (show output as notification/buffer,
15
+ use to edit commit messages, etc.).
16
+
17
+ - Helper functions to inspect Git history:
18
+ - |MiniGit.show_range_history()| shows how certain line range evolved.
19
+ - |MiniGit.show_diff_source()| shows file state as it was at diff entry.
20
+ - |MiniGit.show_at_cursor()| shows Git related data depending on context.
21
+
22
+ What it doesn't do:
23
+
24
+ - Replace fully featured Git client. Rule of thumb: if feature does not rely
25
+ on a state of current Neovim (opened buffers, etc.), it is out of scope.
26
+ For more functionality, use either |mini.diff| or fully featured Git client.
27
+
28
+ Sources with more details:
29
+ - |:Git|
30
+ - |MiniGit-examples|
31
+ - |MiniGit.enable()|
32
+ - |MiniGit.get_buf_data()|
33
+
34
+ # Setup ~
35
+
36
+ This module needs a setup with `require('mini.git').setup({})` (replace `{}` with
37
+ your `config` table). It will create global Lua table `MiniGit` which you can use
38
+ for scripting or manually (with `:lua MiniGit.*`).
39
+
40
+ See |MiniGit.config| for `config` structure and default values.
41
+
42
+ # Comparisons ~
43
+
44
+ - [tpope/vim-fugitive](https://github.com/tpope/vim-fugitive):
45
+ - Mostly a dedicated Git client, while this module is not (by design).
46
+ - Provides buffer-local Git data only through fixed statusline component,
47
+ while this module has richer data in the form of a Lua table.
48
+ - Both provide |:Git| command with `vim-fugitive` treating some cases
49
+ extra specially (like `:Git blame`, etc.), while this module mostly
50
+ treats all cases the same. See |MiniGit-examples| for how they can be
51
+ manually customized.
52
+ Also this module provides slightly different (usually richer)
53
+ completion suggestions.
54
+
55
+ - [NeogitOrg/neogit](https://github.com/NeogitOrg/neogit):
56
+ - Similar to `tpope/vim-fugitive`, but without `:Git` command.
57
+
58
+ - [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim):
59
+ - Provides buffer-local Git data with emphasis on granular diff status,
60
+ while this module is more oriented towards repository and file level
61
+ data (root, HEAD, file status, etc.). Use |mini.diff| for diff tracking.
62
+
63
+ # Disabling ~
64
+
65
+ To prevent buffer(s) from being tracked, set `vim.g.minigit_disable` (globally)
66
+ or `vim.b.minigit_disable` (for a buffer) to `true`. Considering high number of
67
+ different scenarios and customization intentions, writing exact rules for
68
+ disabling module's functionality is left to user.
69
+ See |mini.nvim-disabling-recipes| for common recipes.
70
+
71
+ ------------------------------------------------------------------------------
72
+ *MiniGit-examples*
73
+ # Statusline component ~
74
+
75
+ Tracked buffer data can be used in statusline via `vim.b.minigit_summary_string`
76
+ buffer-local variable. It is expected to be used as is. To show another info,
77
+ tweak buffer-local variable directly inside `MiniGitUpdated` `User` event: >lua
78
+
79
+ -- Use only HEAD name as summary string
80
+ local format_summary = function(data)
81
+ -- Utilize buffer-local table summary
82
+ local summary = vim.b[data.buf].minigit_summary
83
+ vim.b[data.buf].minigit_summary_string = summary.head_name or ''
84
+ end
85
+
86
+ local au_opts = { pattern = 'MiniGitUpdated', callback = format_summary }
87
+ vim.api.nvim_create_autocmd('User', au_opts)
88
+ <
89
+ # Tweaking command output ~
90
+
91
+ Buffer output of |:Git| command can be tweaked inside autocommand for
92
+ `MiniGitCommandSplit` `User` event (see |MiniGit-command-events|).
93
+ For example, to make `:vertical Git blame -- %` align blame output with the
94
+ current window state, use the following code: >lua
95
+
96
+ local align_blame = function(au_data)
97
+ if au_data.data.git_subcommand ~= 'blame' then return end
98
+
99
+ -- Align blame output with source
100
+ local win_src = au_data.data.win_source
101
+ vim.wo.wrap = false
102
+ vim.fn.winrestview({ topline = vim.fn.line('w0', win_src) })
103
+ vim.api.nvim_win_set_cursor(0, { vim.fn.line('.', win_src), 0 })
104
+
105
+ -- Bind both windows so that they scroll together
106
+ vim.wo[win_src].scrollbind, vim.wo.scrollbind = true, true
107
+ end
108
+
109
+ local au_opts = { pattern = 'MiniGitCommandSplit', callback = align_blame }
110
+ vim.api.nvim_create_autocmd('User', au_opts)
111
+ <
112
+ # History navigation ~
113
+
114
+ Function |MiniGit.show_at_cursor()| is specifically exported to make Git
115
+ history navigation easier. Here are some different ways it can be used:
116
+
117
+ - Call inside buffer for already committed file to show the evolution of
118
+ the current line (or visually selected range) through history.
119
+ It is essentially a `:Git log HEAD` with proper `-L` flag.
120
+ This also works inside output of |MiniGit.show_diff_source()|.
121
+
122
+ - Call with cursor on commit hash to inspect that commit in full.
123
+ This is usually helpful in the output of `:Git log`.
124
+
125
+ - Call with cursor inside diff entry to inspect its file in the state how it
126
+ was at certain commit. By default it shows state after commit, unless cursor
127
+ is on the "deleted" line (i.e. line starting with "-") in which case
128
+ state before commit is shown.
129
+
130
+ This workflow can be made more interactive when used with mapping, like this: >lua
131
+
132
+ local rhs = '<Cmd>lua MiniGit.show_at_cursor()<CR>'
133
+ vim.keymap.set({ 'n', 'x' }, '<Leader>gs', rhs, { desc = 'Show at cursor' })
134
+ <
135
+ ------------------------------------------------------------------------------
136
+ *:Git*
137
+ The `:Git` user command runs `git` CLI call with extra integration for currently
138
+ opened Neovim process:
139
+ - Command is executed inside repository root of the currently active file
140
+ (or |current-directory| if file is not tracked by this module).
141
+
142
+ - Command output is shown either in dedicated buffer in window split or as
143
+ notification via |vim.notify()|. Which method is used depends on whether
144
+ particular Git subcommand is supposed to show data for user to inspect
145
+ (like `log`, `status`, etc.) or not (like `commit`, `push`, etc.). This is
146
+ determined automatically based on the data Git itself provides.
147
+ Split window is made current after command execution.
148
+
149
+ Use split-related |:command-modifiers| (|:vertical|, |:horizontal|, or |:tab|)
150
+ to force output in a particular type of split. Default split direction is
151
+ controlled by `command.split` in |MiniGit.config|.
152
+
153
+ Use |:silent| command modifier to not show any output.
154
+
155
+ Errors and warnings are always shown as notifications.
156
+
157
+ See |MiniGit-examples| for the example of tweaking command output.
158
+
159
+ - Editor for tasks that require interactive user input (like `:Git commit` or
160
+ `:Git rebase --interactive`) is opened inside current session in a separate
161
+ split. Make modifications as in regular buffer, |:write| changes followed by
162
+ |:close| / |:quit| for Git CLI command to resume.
163
+
164
+ Examples of usage:
165
+ - `:Git log --oneline` - show compact log of current repository.
166
+ - `:vert Git blame -- %` - show latest commits per line in vertical split.
167
+ - `:Git help rebase` - show help page for `rebase` subcommand.
168
+ - `:Git -C <cwd> status` - execute `git status` inside |current-directory|.
169
+
170
+ There is also a context aware completion which can be invoked with `<Tab>`:
171
+ - If completed word starts with "-", options for the current Git subcommand
172
+ are shown. Like completion at `:Git log -` will suggest `-L`, `--oneline`, etc.
173
+ - If there is an explicit " -- " to the cursor's left, incremental path
174
+ suggestions will be shown.
175
+ - If there is no recognized Git subcommand yet, show list of subcommands.
176
+ Otherwise for some common subcommands list of its targets will be suggested:
177
+ like for `:Git branch` it will be list of branches, etc.
178
+
179
+ Notes:
180
+ - Paths are always treated as relative to command's execution directory
181
+ (file's repository root or |current-directory| if absent).
182
+ - Don't use quotes for entries containing space, escape it with `\` directly.
183
+ Like `:Git commit -m Hello\ world` and not `:Git commit -m 'Hello world'`
184
+ (which treats `'Hello` and `world'` as separate arguments).
185
+
186
+ # Events ~
187
+ *MiniGit-command-events*
188
+
189
+ There are several `User` events triggered during command execution:
190
+
191
+ - `MiniGitCommandDone` - after command is done executing. For Lua callbacks it
192
+ provides a special `data` table with the following fields:
193
+ - <cmd_input> `(table)` - structured data about executed command.
194
+ Has same structure as Lua function input in |nvim_create_user_command()|.
195
+ - <cwd> `(string)` - directory path inside which Git command was executed.
196
+ - <exit_code> `(number)` - exit code of CLI process.
197
+ - <git_command> `(table)` - array with arguments of full executed command.
198
+ - <git_subcommand> `(string)` - detected Git subcommand (like "log", etc.).
199
+ - <stderr> `(string)` - `stderr` process output.
200
+ - <stdout> `(string)` - `stdout` process output.
201
+
202
+ - `MiniGitCommandSplit` - after command showed its output in a split. Triggered
203
+ after `MiniGitCommandDone` and provides similar `data` table with extra fields:
204
+ - <win_source> `(number)` - window identifier of "source" window (current at
205
+ the moment before command execution).
206
+ - <win_stdout> `(number)` - window identifier of command output.
207
+
208
+ ------------------------------------------------------------------------------
209
+ *MiniGit.setup()*
210
+ `MiniGit.setup`({config})
211
+ Module setup
212
+
213
+ Besides general side effects (see |mini.nvim|), it also:
214
+ - Sets up auto enabling in every normal buffer for an actual file on disk.
215
+ - Creates |:Git| command.
216
+
217
+ Parameters ~
218
+ {config} `(table|nil)` Module config table. See |MiniGit.config|.
219
+
220
+ Usage ~
221
+ >lua
222
+ require('mini.git').setup() -- use default config
223
+ -- OR
224
+ require('mini.git').setup({}) -- replace {} with your config table
225
+ <
226
+ ------------------------------------------------------------------------------
227
+ *MiniGit.config*
228
+ `MiniGit.config`
229
+ Defaults ~
230
+ >lua
231
+ MiniGit.config = {
232
+ -- General CLI execution
233
+ job = {
234
+ -- Path to Git executable
235
+ git_executable = 'git',
236
+
237
+ -- Timeout (in ms) for each job before force quit
238
+ timeout = 30000,
239
+ },
240
+
241
+ -- Options for `:Git` command
242
+ command = {
243
+ -- Default split direction
244
+ split = 'auto',
245
+ },
246
+ }
247
+ <
248
+ # Job ~
249
+
250
+ `config.job` contains options for customizing CLI executions.
251
+
252
+ `job.git_executable` defines a full path to Git executable. Default: "git".
253
+
254
+ `job.timeout` is a duration (in ms) from job start until it is forced to stop.
255
+ Default: 30000.
256
+
257
+ # Command ~
258
+
259
+ `config.command` contains options for customizing |:Git| command.
260
+
261
+ `command.split` defines default split direction for |:Git| command output. Can be
262
+ one of "horizontal", "vertical", "tab", or "auto". Value "auto" uses |:vertical|
263
+ if only |mini.git| buffers are shown in the tabpage and |:tab| otherwise.
264
+ Default: "auto".
265
+
266
+ ------------------------------------------------------------------------------
267
+ *MiniGit.show_at_cursor()*
268
+ `MiniGit.show_at_cursor`({opts})
269
+ Show Git related data at cursor
270
+
271
+ - If inside |mini.deps| confirmation buffer, show in split relevant commit data.
272
+ - If there is a commit-like |<cword>|, show it in split.
273
+ - If possible, show diff source via |MiniGit.show_diff_source()|.
274
+ - If possible, show range history via |MiniGit.show_range_history()|.
275
+ - Otherwise throw an error.
276
+
277
+ Parameters ~
278
+ {opts} `(table|nil)` Options. Possible values:
279
+ - <split> `(string)` - split direction. One of "horizontal", "vertical",
280
+ "tab", or "auto" (default). Value "auto" uses |:vertical| if only |mini.git|
281
+ buffers are shown in the tabpage and |:tab| otherwise.
282
+ - Fields appropriate for forwarding to other functions.
283
+
284
+ ------------------------------------------------------------------------------
285
+ *MiniGit.show_diff_source()*
286
+ `MiniGit.show_diff_source`({opts})
287
+ Show diff source
288
+
289
+ When buffer contains text formatted as unified patch (like after
290
+ `:Git log --patch`, `:Git diff`, or |MiniGit.show_range_history()|),
291
+ show state of the file at the particular state. Target commit/state, path,
292
+ and line number are deduced from cursor position.
293
+
294
+ Notes:
295
+ - Needs |current-directory| to be the Git root for relative paths to work.
296
+ - Needs cursor to be inside hunk lines or on "---" / "+++" lines with paths.
297
+ - Only basic forms of `:Git diff` output is supported: `:Git diff`,
298
+ `:Git diff --cached`, and `:Git diff <commit>`.
299
+
300
+ Parameters ~
301
+ {opts} `(table|nil)` Options. Possible values:
302
+ - <split> `(string)` - split direction. One of "horizontal", "vertical",
303
+ "tab", or "auto" (default). Value "auto" uses |:vertical| if only |mini.git|
304
+ buffers are shown in the tabpage and |:tab| otherwise.
305
+ - <target> `(string)` - which file state to show. One of "before", "after",
306
+ "both" (both states in vertical split), "auto" (default). Value "auto"
307
+ shows "before" state if cursor line starts with "-", otherwise - "after".
308
+
309
+ ------------------------------------------------------------------------------
310
+ *MiniGit.show_range_history()*
311
+ `MiniGit.show_range_history`({opts})
312
+ Show range history
313
+
314
+ Compute and show in split data about how particular line range in current
315
+ buffer evolved through Git history. Essentially a `git log` with `-L` flag.
316
+
317
+ Notes:
318
+ - Works well with |MiniGit.diff_foldexpr()|.
319
+ - Does not work if there are uncommitted changes, as there is no easy way to
320
+ compute effective range line numbers.
321
+
322
+ Parameters ~
323
+ {opts} `(table|nil)` Options. Possible fields:
324
+ - <line_start> `(number)` - range start line.
325
+ - <line_end> `(number)` - range end line.
326
+ If both <line_start> and <line_end> are not supplied, they default to
327
+ current line in Normal mode and visual selection in Visual mode.
328
+ - <log_args> `(table)` - array of options to append to `git log` call.
329
+ - <split> `(string)` - split direction. One of "horizontal", "vertical",
330
+ "tab", or "auto" (default). Value "auto" uses |:vertical| if only |mini.git|
331
+ buffers are shown in the tabpage and |:tab| otherwise.
332
+
333
+ ------------------------------------------------------------------------------
334
+ *MiniGit.diff_foldexpr()*
335
+ `MiniGit.diff_foldexpr`({lnum})
336
+ Fold expression for Git logs
337
+
338
+ Folds contents of hunks, file patches, and log entries in unified diff.
339
+ Useful for filetypes "diff" (like after `:Git diff`) and "git" (like after
340
+ `:Git log --patch` or `:Git show` for commit).
341
+ Works well with |MiniGit.show_range_history()|.
342
+
343
+ General idea of folding levels (use |zr| and |zm| to adjust interactively):
344
+ - At level 0 there is one line per whole patch or log entry.
345
+ - At level 1 there is one line per patched file.
346
+ - At level 2 there is one line per hunk.
347
+ - At level 3 there is no folds.
348
+
349
+ For automated setup, set the following for "git" and "diff" filetypes (either
350
+ inside |FileType| autocommand or |ftplugin|): >vim
351
+
352
+ setlocal foldmethod=expr foldexpr=v:lua.MiniGit.diff_foldexpr()
353
+ <
354
+ Parameters ~
355
+ {lnum} `(number|nil)` Line number for which fold level is computed.
356
+ Default: |v:lnum|.
357
+
358
+ Return ~
359
+ `(number|string)` Line fold level. See |fold-expr|.
360
+
361
+ ------------------------------------------------------------------------------
362
+ *MiniGit.enable()*
363
+ `MiniGit.enable`({buf_id})
364
+ Enable Git tracking in a file buffer
365
+
366
+ Tracking is done by reacting to changes in file content or file's repository
367
+ in the form of keeping buffer data up to date. The data can be used via:
368
+ - |MiniGit.get_buf_data()|. See its help for a list of actually tracked data.
369
+ - `vim.b.minigit_summary` (table) and `vim.b.minigit_summary_string` (string)
370
+ buffer-local variables which are more suitable for statusline.
371
+ `vim.b.minigit_summary_string` contains information about HEAD, file status,
372
+ and in progress action (see |MiniGit.get_buf_data()| for more details).
373
+ See |MiniGit-examples| for how it can be tweaked and used in statusline.
374
+
375
+ Note: this function is called automatically for all new normal buffers.
376
+ Use it explicitly if buffer was disabled.
377
+
378
+ `User` event `MiniGitUpdated` is triggered whenever tracking data is updated.
379
+ Note that not all data listed in |MiniGit.get_buf_data()| can be present (yet)
380
+ at the point of event being triggered.
381
+
382
+ Parameters ~
383
+ {buf_id} `(number)` Target buffer identifier. Default: 0 for current buffer.
384
+
385
+ ------------------------------------------------------------------------------
386
+ *MiniGit.disable()*
387
+ `MiniGit.disable`({buf_id})
388
+ Disable Git tracking in buffer
389
+
390
+ Parameters ~
391
+ {buf_id} `(number)` Target buffer identifier. Default: 0 for current buffer.
392
+
393
+ ------------------------------------------------------------------------------
394
+ *MiniGit.toggle()*
395
+ `MiniGit.toggle`({buf_id})
396
+ Toggle Git tracking in buffer
397
+
398
+ Enable if disabled, disable if enabled.
399
+
400
+ Parameters ~
401
+ {buf_id} `(number)` Target buffer identifier. Default: 0 for current buffer.
402
+
403
+ ------------------------------------------------------------------------------
404
+ *MiniGit.get_buf_data()*
405
+ `MiniGit.get_buf_data`({buf_id})
406
+ Get buffer data
407
+
408
+ Parameters ~
409
+ {buf_id} `(number)` Target buffer identifier. Default: 0 for current buffer.
410
+
411
+ Return ~
412
+ `(table|nil)` Table with buffer Git data or `nil` if buffer is not enabled.
413
+ If the file is not part of Git repo, table will be empty.
414
+ Table has the following fields:
415
+ - <repo> `(string)` - full path to `.git` directory.
416
+ - <root> `(string)` - full path to worktree root.
417
+ - <head> `(string)` - full commit of current HEAD.
418
+ - <head_name> `(string)` - short name of current HEAD (like "master").
419
+ For detached HEAD it is "HEAD".
420
+ - <status> `(string)` - two character file status as returned by `git status`.
421
+ - <in_progress> `(string)` - name of action(s) currently in progress
422
+ (bisect, merge, etc.). Can be a combination of those separated by ",".
423
+
424
+
425
+ vim:tw=78:ts=8:noet:ft=help:norl: