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
package/nvim/init.lua ADDED
@@ -0,0 +1,813 @@
1
+ --- ╭─────────╮
2
+ --- │ Plugins │
3
+ --- ╰─────────╯
4
+
5
+ local vim = vim --- lsp warnings
6
+ local colon = vim.env.APPDATA and ';' or ':'
7
+ local mini_path = vim.env.RETRONVIM_PREFIX and (vim.env.RETRONVIM_PREFIX .. '/nvim/plugins/mini.nvim') or ''
8
+ local plugins_path = vim.fn.expand(vim.fs.normalize(vim.fn.stdpath("data")) .. '/site/pack/core/opt/*', 0, 1)
9
+
10
+ vim.env.PNPM_HOME = vim.env.PNPM_HOME or (vim.env.HOME .. '/.local/share/pnpm')
11
+ vim.env.PATH = vim.env.PATH .. colon .. vim.env.HOME .. '/.pixi/bin'
12
+ vim.env.PATH = vim.env.PATH .. colon .. vim.env.PNPM_HOME
13
+ vim.env.PATH = vim.env.PATH .. colon .. vim.env.PNPM_HOME .. '/global/5/node_modules/.bin'
14
+
15
+ if not vim.loop.fs_stat(mini_path) then
16
+ vim.pack.add({ { src = 'https://github.com/nvim-mini/mini.nvim', version = 'v0.18.0' } })
17
+ end
18
+
19
+ vim.opt.rtp:prepend(mini_path)
20
+ vim.opt.rtp:append(plugins_path)
21
+
22
+ local map = vim.keymap.set
23
+ local autocmd = vim.api.nvim_create_autocmd
24
+ local _, vscode = pcall(require, "vscode-neovim")
25
+ vim.g.mapleader = " " --- <leader> key
26
+
27
+ ------------------------------------------------------------------------------------------------------------------------
28
+
29
+ if not vim.g.vscode then
30
+ vim.lsp.inline_completion.enable()
31
+
32
+ map({ 'i' }, '<a-l>', function() vim.lsp.inline_completion.get() end, { desc = ' accept suggestion' })
33
+ map({ 'i' }, '<a-[>', function() vim.lsp.inline_completion.select({ count = -1 }) end, { desc = ' prev suggestion' })
34
+ map({ 'i' }, '<a-]>', function() vim.lsp.inline_completion.select({ count = 1 }) end, { desc = ' next suggestion' })
35
+ map({ 'i', 'n', 'x' }, '<a-;>', function() require("sidekick").nes_jump_or_apply() end, { desc = ' nes apply' }) --- <m-;> doesn't work with pum
36
+ map({ 'i', 'n', 'x' }, '<a-,>', function() require("sidekick.nes").update() end, { desc = ' nes update' })
37
+ map({ 'i', 'n', 'x' }, "<a-'>", function() require("sidekick.nes").clear() end, { desc = ' nes clear' })
38
+ map({ 'i', 'n', 'x' }, '<leader>lg', "<cmd>Sidekick cli toggle name=opencode<cr>", { desc = '󰵰 opencode cli' })
39
+ map({ 'i', 'n', 'x' }, '<leader>lG', "<cmd>Sidekick cli prompt<cr>", { desc = '󰵰 opencode prompt' })
40
+
41
+ pcall(function() require("sidekick").setup({}) end)
42
+ end
43
+
44
+ ------------------------------------------------------------------------------------------------------------------------
45
+
46
+ pcall(function() require("flash").setup({ modes = { search = { enabled = true } } }) end)
47
+
48
+ ------------------------------------------------------------------------------------------------------------------------
49
+
50
+ if not vim.g.vscode then
51
+ local ok, supermaven = pcall(require, "supermaven-nvim")
52
+
53
+ if ok then
54
+ vim.lsp.inline_completion.enable(false) -- disable copilot inline suggestion
55
+ supermaven.setup({ disable_keymaps = true })
56
+ map("i", "<A-l>", function() require("supermaven-nvim.completion_preview").on_accept_suggestion() end)
57
+ map("i", "<A-k>", function() require("supermaven-nvim.completion_preview").on_dispose_inlay() end) -- clear suggestion
58
+ map("i", "<A-j>", function() require("supermaven-nvim.completion_preview").on_accept_suggestion_word() end)
59
+ end
60
+ end
61
+
62
+ --- ╭──────╮
63
+ --- │ Opts │
64
+ --- ╰──────╯
65
+
66
+ vim.opt.backupcopy =
67
+ "yes" --- fixes `next dev --turbopack` file change detection, see `:h file-watcher` and https://github.com/neovim/neovim/issues/1380
68
+ vim.opt.clipboard = "unnamedplus" --- allows neovim to access the system clipboard
69
+ vim.opt.expandtab = true --- convert tabs to spaces
70
+ vim.opt.hlsearch = true --- highlight all matches on previous search pattern
71
+ vim.opt.ignorecase = true --- ignore case in search patterns
72
+ vim.opt.shiftwidth = 2 --- the number of spaces inserted for each indentation
73
+ vim.opt.smartcase = true --- smart case
74
+ vim.opt.splitbelow = true --- force all horizontal splits to go below current window
75
+ vim.opt.splitright = true --- force all vertical splits to go to the right of current window
76
+ vim.opt.shellcmdflag = '-c' --- https://github.com/neovim/neovim/issues/16957
77
+ vim.opt.shellxquote = '' --- https://github.com/neovim/neovim/issues/16957
78
+ vim.opt.shellslash = true --- fixes windows path and Vexplore path
79
+ vim.opt.tabstop = 2 --- insert 2 spaces for a tab
80
+ vim.opt.termguicolors = true --- fixes colorscheme after :restart https://github.com/neovim/neovim/issues/38545
81
+ vim.opt.timeoutlen = 500 --- time to wait for a mapped sequence to complete (in milliseconds)
82
+ vim.opt.winborder = 'rounded' --- MiniCompletion's info and signature border
83
+ vim.opt.wrap = false --- display lines as one long line
84
+ vim.opt.list = true --- Enables the visibility of listchars globally
85
+ vim.opt.listchars = {
86
+ tab = "▏ ",
87
+ multispace = " ", --- Keeps non-leading consecutive spaces clean
88
+ leadmultispace = "▏ ", --- Matches your indent size (1 character + spaces)
89
+ trail = " ",
90
+ }
91
+
92
+ vim.treesitter.start = function() end --- nvim.conda on windows doesn't ship parser/lua.dll etc, lsp has their own syntax highlightting
93
+
94
+ if not vim.g.vscode then
95
+ vim.opt.pumborder = 'rounded' --- enable mini.completion border
96
+ vim.opt.cmdheight = 0 --- more space in the neovim command line for displaying messages
97
+ vim.opt.laststatus = 3 --- laststatus=3 global status line (line between splits)
98
+ vim.opt.number = true --- set numbered lines
99
+ vim.opt.scrolloff = 3 --- vertical scrolloff
100
+ vim.opt.sidescrolloff = 3 --- horizontal scrolloff
101
+ vim.opt.virtualedit = "all" --- allow cursor bypass end of line
102
+ vim.o.foldcolumn = '1' --- if '1' will show clickable fold signs
103
+ vim.o.foldlevel = 99 --- Disable folding at startup
104
+ vim.o.foldmethod = "expr" --- expr = specify an expression to define folds
105
+ vim.o.foldexpr = 'v:lua.vim.lsp.foldexpr()' --- if folding using treesitter then 'v:lua.vim.treesitter.foldexpr()'
106
+ vim.o.fillchars = [[eob: ,fold: ,foldinner: ,foldopen:,foldsep: ,foldclose:]]
107
+ vim.g.netrw_banner = 0 -- Hide the massive top banner
108
+ vim.g.netrw_liststyle = 3 -- Use tree-style view instead of a flat list
109
+ vim.g.netrw_browse_split = 4 -- Open files in a new vertical split on the right
110
+ vim.g.netrw_winsize = 18 -- Set the width of the netrw split window (percentage)
111
+ vim.g.netrw_preview = 1 -- open in a split window
112
+ vim.g.netrw_list_hide = -- absolute path not supported only relative path works
113
+ vim.cmd.packadd('netrw') and
114
+ vim.fn["netrw_gitignore#Hide"]()
115
+ .. ",.git"
116
+ -- vim.g.netrw_localcopydircmd = 'cp -r' -- Change copy command to support recursive copying
117
+ -- vim.g.netrw_keepdir = 0 -- don't close netrw after picking a file
118
+ -- vim.g.netrw_altv = 1 -- open file to the right
119
+ -- vim.g.netrw_special_syntax = 0 -- desactiva los colores por defecto de netrw
120
+ -- vim.g.netrw_fastbrowse = 1 -- re-use directory listings
121
+ end
122
+
123
+ --- ╭──────────────╮
124
+ --- │ Autocommands │
125
+ --- ╰──────────────╯
126
+
127
+ local M = {}
128
+ local mini_icons = require('mini.icons')
129
+ local netrw_ns = vim.api.nvim_create_namespace('netrw_icons')
130
+ local restore_cursor = function(ev) M.netrw_cursor = vim.api.nvim_win_get_cursor(tonumber(ev.match)) end
131
+
132
+ local function set_netrw_icons(ev)
133
+ M.netrw_buf = ev.buf
134
+ autocmd('WinClosed', { buffer = ev.buf, once = true, callback = function() M.netrw_buf = nil end })
135
+ autocmd('WinClosed', { buffer = ev.buf, once = true, callback = restore_cursor })
136
+
137
+ map("n", "l", "<cr>", { buffer = ev.buf, remap = true })
138
+ map("n", "h", "<cr>", { buffer = ev.buf, remap = true })
139
+ map("n", "q", "<cmd>quit<cr>", { buffer = ev.buf, remap = true })
140
+ map("n", "<c-l>", "<cmd>wincmd l<cr>", { buffer = ev.buf, remap = true })
141
+
142
+ vim.api.nvim_buf_clear_namespace(0, netrw_ns, 0, -1)
143
+
144
+ local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
145
+
146
+ for i, line in ipairs(lines) do
147
+ -- overlay tree bar characters
148
+ local col = 0
149
+ while true do
150
+ local s = line:find('|', col + 1, true)
151
+ if not s then break end
152
+ vim.api.nvim_buf_set_extmark(0, netrw_ns, i - 1, s - 1, {
153
+ virt_text = { { '│', 'Comment' } },
154
+ virt_text_pos = 'overlay',
155
+ })
156
+ col = s
157
+ end
158
+
159
+ -- netrw style 3: "| | filename" or "| | dir/"
160
+ local name = line:match('^.*|%s+(.+)$')
161
+
162
+ if name then
163
+ local is_dir = name:sub(-1) == '/'
164
+ local icon, hl = mini_icons.get('file', name)
165
+
166
+ if is_dir then
167
+ icon, hl = mini_icons.get('directory', name)
168
+ vim.api.nvim_buf_set_extmark(0, netrw_ns, i - 1, #line - 1, {
169
+ virt_text = { { ' ', hl } },
170
+ virt_text_pos = 'overlay'
171
+ })
172
+ end
173
+
174
+ if icon then
175
+ vim.api.nvim_buf_set_extmark(0, netrw_ns, i - 1, #line - #name - 2, {
176
+ virt_text = { { icon .. ' ', hl } },
177
+ virt_text_pos = 'overlay'
178
+ })
179
+ end
180
+ end
181
+ end
182
+ end
183
+
184
+ --- set mini.icons when opening netrw
185
+ autocmd('FileType', { pattern = 'netrw', callback = set_netrw_icons })
186
+
187
+ --- stop comment prefix on new lines
188
+ autocmd({ "BufEnter" }, { command = "set formatoptions-=cro" })
189
+
190
+ if not vim.g.vscode then
191
+ --- briefly highlight yanked text
192
+ autocmd("TextYankPost", { callback = function() vim.highlight.on_yank({ higroup = "Visual", timeout = 200 }) end })
193
+
194
+ autocmd({ "BufWinEnter" }, { pattern = "*.code-snippets", command = "set ft=json" })
195
+
196
+ --- right click menu
197
+ vim.cmd [[ anoremenu PopUp.Quit <cmd>quit!<cr> ]]
198
+
199
+ autocmd({ "TermEnter", "TermOpen" }, { command = "startinsert" })
200
+
201
+ --- hide bufferline if `nvim -cterm` or `nvim +term`
202
+ autocmd("TermLeave",
203
+ { command = [[lua vim.schedule(function() return vim.fn.bufname() == "" and vim.cmd.quit() end)]] })
204
+ end
205
+
206
+ --- ╭───────────╮
207
+ --- │ Mini.nvim │
208
+ --- ╰───────────╯
209
+
210
+ local gen_ai_spec = require('mini.extra').gen_ai_spec
211
+ local mini_clue = require("mini.clue")
212
+
213
+ require("mini.ai").setup({
214
+ custom_textobjects = {
215
+ d = gen_ai_spec.diagnostic(), --- diagnostic textobj
216
+ e = gen_ai_spec.line(), --- line textobj
217
+ I = gen_ai_spec.indent(), --- indent textobj including blank-lines
218
+ h = { { "<(%w-)%f[^<%w][^<>]->.-</%1>" }, { "%f[%w]%w+=()%b{}()", '%f[%w]%w+=()%b""()', "%f[%w]%w+=()%b''()" } }, --- html attribute textobj
219
+ k = { { "\n.-[=:]", "^.-[=:]" }, "^%s*()().-()%s-()=?[!=<>\\+-\\*]?[=:]" }, --- key textobj
220
+ v = { { "[=:]()%s*().-%s*()[;,]()", "[=:]=?()%s*().*()().$" } }, --- value textobj
221
+ m = gen_ai_spec.number(), --- number(inside string) textobj { '[-+]?()%f[%d]%d+()%.?%d*' }
222
+ x = { '#()%x%x%x%x%x%x()' }, --- hexadecimal textobj
223
+ o = { "%S()%s+()%S" }, --- whitespace textobj
224
+ u = { { '%u[%l%d]+%f[^%l%d]', '%f[%S][%l%d]+%f[^%l%d]', '%f[%P][%l%d]+%f[^%l%d]', '^[%l%d]+%f[^%l%d]', }, '^().*()$' }, --- sub word textobj https://github.com/echasnovski/mini.nvim/blob/main/doc/mini-ai.txt
225
+
226
+ --> https://thevaluable.dev/vim-create-text-objects
227
+ --- select indent by the same or mayor level delimited by blank-lines
228
+ i = function()
229
+ local start_indent = vim.fn.indent(vim.fn.line('.'))
230
+ local prev_line = vim.fn.line('.') - 1
231
+ local next_line = vim.fn.line('.') + 1
232
+
233
+ while vim.fn.indent(prev_line) >= start_indent do prev_line = prev_line - 1 end
234
+ while vim.fn.indent(next_line) >= start_indent do next_line = next_line + 1 end
235
+
236
+ return { from = { line = prev_line + 1, col = 1 }, to = { line = next_line - 1, col = 100 }, vis_mode = 'V' }
237
+ end,
238
+ },
239
+ n_lines = 500, --- search range and required by functions less than 500 LOC
240
+ })
241
+
242
+ require('mini.align').setup()
243
+ require('mini.bracketed').setup({ undo = { suffix = '' } })
244
+ require('mini.jump').setup( --[[{ repeat_jump = ';' }]]) --- ; by default
245
+ require('mini.operators').setup()
246
+ require('mini.splitjoin').setup()
247
+ require('mini.surround').setup()
248
+ require('mini.trailspace').setup()
249
+
250
+ if not vim.g.vscode then
251
+ require('mini.clue').setup({
252
+ triggers = {
253
+ { keys = 'a', mode = { 'o', 'x' } },
254
+ { keys = 'i', mode = { 'o', 'x' } },
255
+ { keys = 'g', mode = { 'o', 'x', 'n' } },
256
+ { keys = 'z', mode = { 'x', 'n' } },
257
+ { keys = "'", mode = { 'x', 'n' } },
258
+ { keys = '"', mode = { 'x', 'n' } },
259
+ { keys = '`', mode = { 'x', 'n' } },
260
+ { keys = '[', mode = { 'x', 'n' } },
261
+ { keys = ']', mode = { 'x', 'n' } },
262
+ { keys = '<c-r>', mode = { 'i', 'c' } },
263
+ { keys = '<C-w>', mode = { 'n' } },
264
+ { keys = '<C-x>', mode = { 'i' } },
265
+ { keys = '<Leader>', mode = { 'x', 'n' } },
266
+ },
267
+ clues = {
268
+ mini_clue.gen_clues.builtin_completion(),
269
+ mini_clue.gen_clues.g(),
270
+ mini_clue.gen_clues.marks(),
271
+ mini_clue.gen_clues.registers(),
272
+ mini_clue.gen_clues.windows(),
273
+ mini_clue.gen_clues.z(),
274
+ { desc = "argument", keys = "aa", mode = { "o", "x" } },
275
+ { desc = "argument", keys = "ia", mode = { "o", "x" } },
276
+ { desc = "braces", keys = "ab", mode = { "o", "x" } },
277
+ { desc = "braces", keys = "ib", mode = { "o", "x" } },
278
+ { desc = "diagnostic", keys = "ad", mode = { "o", "x" } },
279
+ { desc = "dignostic", keys = "id", mode = { "o", "x" } },
280
+ { desc = "line", keys = "ae", mode = { "o", "x" } },
281
+ { desc = "line", keys = "ie", mode = { "o", "x" } },
282
+ { desc = "func_call", keys = "af", mode = { "o", "x" } },
283
+ { desc = "func_call", keys = "if", mode = { "o", "x" } },
284
+ { desc = "html_attrib", keys = "ah", mode = { "o", "x" } },
285
+ { desc = "html_attrib", keys = "ih", mode = { "o", "x" } },
286
+ { desc = "indent", keys = "aI", mode = { "o", "x" } },
287
+ { desc = "indent", keys = "iI", mode = { "o", "x" } },
288
+ { desc = "key", keys = "ak", mode = { "o", "x" } },
289
+ { desc = "key", keys = "ik", mode = { "o", "x" } },
290
+ { desc = "number", keys = "am", mode = { "o", "x" } },
291
+ { desc = "number", keys = "im", mode = { "o", "x" } },
292
+ { desc = "whitespace", keys = "ao", mode = { "o", "x" } },
293
+ { desc = "whitespace", keys = "io", mode = { "o", "x" } },
294
+ { desc = "paragraph", keys = "ap", mode = { "o", "x" } },
295
+ { desc = "paragraph", keys = "ip", mode = { "o", "x" } },
296
+ { desc = "quote", keys = "aq", mode = { "o", "x" } },
297
+ { desc = "quote", keys = "iq", mode = { "o", "x" } },
298
+ { desc = "sentence", keys = "as", mode = { "o", "x" } },
299
+ { desc = "sentence", keys = "is", mode = { "o", "x" } },
300
+ { desc = "tag", keys = "at", mode = { "o", "x" } },
301
+ { desc = "tag", keys = "it", mode = { "o", "x" } },
302
+ { desc = "subword", keys = "au", mode = { "o", "x" } },
303
+ { desc = "subword", keys = "iu", mode = { "o", "x" } },
304
+ { desc = "value", keys = "av", mode = { "o", "x" } },
305
+ { desc = "value", keys = "iv", mode = { "o", "x" } },
306
+ { desc = "word", keys = "aw", mode = { "o", "x" } },
307
+ { desc = "word", keys = "iw", mode = { "o", "x" } },
308
+ { desc = "WORD", keys = "aW", mode = { "o", "x" } },
309
+ { desc = "WORD", keys = "iW", mode = { "o", "x" } },
310
+ { desc = "hexadecimal", keys = "ax", mode = { "o", "x" } },
311
+ { desc = "hexadecimal", keys = "ix", mode = { "o", "x" } },
312
+ { desc = "user_prompt", keys = "a?", mode = { "o", "x" } },
313
+ { desc = "user_prompt", keys = "i?", mode = { "o", "x" } },
314
+ },
315
+ })
316
+
317
+ require('mini.base16').setup({
318
+ --- `:Inspect` to reverse engineering a colorscheme
319
+ --- `:hi <@treesitter>` to view colors of `:Inspect` output
320
+ --- `:Pick hl_groups` to view generated colorscheme
321
+ --> https://github.com/NvChad/base46/tree/v2.5/lua/base46/themes for popular colorscheme palettes
322
+ --> https://github.com/echasnovski/mini.nvim/discussions/36 community palettes
323
+ palette = {
324
+ --- BAT_THEME=base16 --- tokyonight --- description
325
+ base00 = "#000000", -- "#1a1b26", --- default bg
326
+ base01 = "#111111", -- "#16161e", --- line number bg
327
+ base02 = "#2c2c2c", -- "#2f3549", --- statusline bg, selection bg
328
+ base03 = "#444b6a", -- "#444b6a", --- line number fg, comments
329
+ base04 = "#787c99", -- "#787c99", --- statusline fg
330
+ base05 = "#a9b1d6", -- "#a9b1d6", --- default fg, delimiters
331
+ base06 = "#cbccd1", -- "#cbccd1", --- light fg (not often used)
332
+ base07 = "#d5d6db", -- "#d5d6db", --- light bg (not often used)
333
+ base08 = "#5555cc", -- "#7aa2f7", --- variables, tags, Diff delete
334
+ base09 = "#999900", -- "#ff9e64", --- integers, booleans, constants, search fg
335
+ base0A = "#ff0000", -- "#0db9d7", --- classes, search bg
336
+ base0B = "#009900", -- "#73daca", --- strings, Diff insert
337
+ base0C = "#3c3cff", -- "#2ac3de", --- builtins, regex
338
+ base0D = "#5FB3A1", -- "#7aa2f7", --- functions
339
+ base0E = "#8855ff", -- "#bb9af7", --- keywords, Diff changed
340
+ base0F = "#a0a0a0", -- "#7aa2f7", --- punctuation, indentscope
341
+ },
342
+ use_cterm = true, --- required if `nvim -c 'Pick files'`
343
+ })
344
+
345
+ --- neovim terminal colors
346
+ vim.g.terminal_color_0 = "#3c3c3c"
347
+ vim.g.terminal_color_1 = "#990000"
348
+ vim.g.terminal_color_2 = "#009900"
349
+ vim.g.terminal_color_3 = "#999900"
350
+ vim.g.terminal_color_4 = "#5555cc"
351
+ vim.g.terminal_color_5 = "#8855ff"
352
+ vim.g.terminal_color_6 = "#5FB3A1"
353
+ vim.g.terminal_color_7 = "#a0a0a0"
354
+ vim.g.terminal_color_8 = "#6c6c6c"
355
+ vim.g.terminal_color_9 = "#ff0000"
356
+ vim.g.terminal_color_10 = "#00ff00"
357
+ vim.g.terminal_color_11 = "#ffff00"
358
+ vim.g.terminal_color_12 = "#1c1cff"
359
+ vim.g.terminal_color_13 = "#8844bb"
360
+ vim.g.terminal_color_14 = "#5DE4C7"
361
+ vim.g.terminal_color_15 = "#ffffff"
362
+
363
+ --- adding tokyonight transparency
364
+ vim.api.nvim_set_hl(0, "Normal", { fg = "#787c99", bg = "NONE" })
365
+ vim.api.nvim_set_hl(0, "NormalNC", { bg = "NONE" })
366
+ vim.api.nvim_set_hl(0, "NormalFloat", { bg = "NONE" })
367
+ vim.api.nvim_set_hl(0, "FoldColumn", { bg = "NONE" })
368
+ vim.api.nvim_set_hl(0, "NeoCodeiumSuggestion", { fg = "#444b6a" })
369
+ vim.api.nvim_set_hl(0, "SnacksIndentScope", { fg = "#787c99" })
370
+ vim.api.nvim_set_hl(0, "SnacksPickerDir", { fg = "#a9b1d6" })
371
+ vim.api.nvim_set_hl(0, "SnacksPickerDirectory", { fg = "#5555cc" })
372
+ vim.api.nvim_set_hl(0, "Directory", { fg = "#5555cc" })
373
+ -- vim.api.nvim_set_hl(0, "SnacksPickerFile", { fg = "#d5d6db" })
374
+ vim.api.nvim_set_hl(0, "MiniIconsAzure", { fg = "#5555cc" })
375
+ vim.api.nvim_set_hl(0, "MiniStatuslineFilename", { bg = "NONE" })
376
+ vim.api.nvim_set_hl(0, "MiniCursorwordCurrent", { underline = false, bg = "#1c1c2c" })
377
+ vim.api.nvim_set_hl(0, "MiniCursorword", { bg = "#1c1c2c" })
378
+ vim.api.nvim_set_hl(0, "LineNr", { fg = "#506477", bg = "NONE" })
379
+ vim.api.nvim_set_hl(0, "SignColumn", { bg = "NONE" })
380
+ vim.api.nvim_set_hl(0, "Statusline", { bg = "NONE" })
381
+ vim.api.nvim_set_hl(0, "StatuslineNC", { bg = "NONE" })
382
+ vim.api.nvim_set_hl(0, "MiniDiffSignAdd", { fg = "#009900" })
383
+ vim.api.nvim_set_hl(0, "MiniDiffSignChange", { fg = "#3C3CFf" })
384
+ vim.api.nvim_set_hl(0, "MiniDiffSignDelete", { fg = "#990000" })
385
+ vim.api.nvim_set_hl(0, "MiniClueDescGroup", { fg = "#8855ff" })
386
+ vim.api.nvim_set_hl(0, "MiniClueNextKey", { fg = "#5fb3a1" })
387
+ vim.api.nvim_set_hl(0, "MiniClueTitle", { fg = "#5fb3a1" })
388
+ vim.api.nvim_set_hl(0, "MiniClueSeparator", { fg = "#3c3cff" })
389
+ vim.api.nvim_set_hl(0, "diffAdded", { fg = "#009900" })
390
+ vim.api.nvim_set_hl(0, "diffChanged", { fg = "#3C3CFf" })
391
+ vim.api.nvim_set_hl(0, "diffRemoved", { fg = "#ff0000" })
392
+ vim.api.nvim_set_hl(0, "DiffAdd", { fg = "#009900" })
393
+ vim.api.nvim_set_hl(0, "DiffChange", { fg = "#3C3CFf" })
394
+ vim.api.nvim_set_hl(0, "DiffDelete", { fg = "#990000" })
395
+ vim.api.nvim_set_hl(0, "DiffText", { bg = "#3C3CFf", fg = "#ffffff" })
396
+ vim.api.nvim_set_hl(0, "SidekickDiffContext", { bg = "#00003c", blend = 50 }) --- blend for virtual line not suported, SidekickDiffContext = SidekickDiffAdd + SidekickDiffDelete rest of background
397
+ vim.api.nvim_set_hl(0, "SidekickDiffAdd", { bg = "#003c00", blend = 50 }) --- blend for virtual line not suported, uses `Normal` background + foreground if treesitter not available
398
+ vim.api.nvim_set_hl(0, "SidekickDiffDelete", { bg = "#3c0000", blend = 50 }) --- blend for virtual line not suported, doesn't diff well without treesitter
399
+ vim.api.nvim_set_hl(0, "DiagnosticError", { fg = "#db4b4b" })
400
+ vim.api.nvim_set_hl(0, "DiagnosticHint", { fg = "#1abc9c" })
401
+ vim.api.nvim_set_hl(0, "DiagnosticInfo", { fg = "#0db9d7" })
402
+ vim.api.nvim_set_hl(0, "DiagnosticWarn", { fg = "#e0af68" })
403
+ vim.api.nvim_set_hl(0, "DiagnosticSignError", { fg = "#db4b4b" })
404
+ vim.api.nvim_set_hl(0, "DiagnosticSignHint", { fg = "#1abc9c" })
405
+ vim.api.nvim_set_hl(0, "DiagnosticSignInfo", { fg = "#0db9d7" })
406
+ vim.api.nvim_set_hl(0, "DiagnosticSignWarn", { fg = "#e0af68" })
407
+ vim.api.nvim_set_hl(0, "DiagnosticUnderlineError", { underline = true, sp = "#db4b4b" })
408
+ vim.api.nvim_set_hl(0, "DiagnosticUnderlineHint", { underline = true, sp = "#1abc9c" })
409
+ vim.api.nvim_set_hl(0, "DiagnosticUnderlineInfo", { underline = true, sp = "#0db9d7" })
410
+ vim.api.nvim_set_hl(0, "DiagnosticUnderlineWarn", { underline = true, sp = "#e0af68" })
411
+ vim.api.nvim_set_hl(0, "Pmenu", { bg = "NONE" }) --- transparent mini.completion
412
+ vim.api.nvim_set_hl(0, "PmenuSel", { fg = "NONE", bg = "#2c2c2c" })
413
+ vim.api.nvim_set_hl(0, "PmenuMatch", { bold = true, fg = "#3C3CFf" })
414
+ vim.api.nvim_set_hl(0, "Search", { fg = "#c0caf5", bg = "#3d59a1" })
415
+
416
+ --- vim.fn.glob() outputs nil if not found
417
+ --- vim.fn.expand() outputs the same string if not founded
418
+ local vscode_extensions = vim.fn.glob("~/.*/extensions", 0, 1)[1] or ''
419
+ local snippet_path = vim.fn.expand(vscode_extensions .. "/*/snippets", 0, 1)
420
+ local snippet_dirname = vim.tbl_map(vim.fs.dirname, snippet_path)
421
+ vim.opt.rtp:append(snippet_dirname)
422
+
423
+ require('mini.snippets').setup({
424
+ snippets = { require('mini.snippets').gen_loader.from_runtime("*code-snippets") },
425
+ mappings = {
426
+ expand = '<a-.>',
427
+ jump_next = '<a-n>',
428
+ jump_prev = '<a-p>',
429
+ }
430
+ })
431
+
432
+ require('mini.completion').setup()
433
+ require('mini.cursorword').setup()
434
+ require('mini.diff').setup({ view = { style = 'sign', signs = { add = '│', change = '│', delete = '│' } }, options = { wrap_goto = true } })
435
+ require('mini.extra').setup()
436
+ require('mini.cmdline').setup()
437
+ require("mini.hipatterns").setup({ highlighters = { hex_color = require("mini.hipatterns").gen_highlighter.hex_color() } })
438
+ require('mini.icons').setup()
439
+ require('mini.icons').mock_nvim_web_devicons()
440
+ require('mini.icons').tweak_lsp_kind( --[[ "replace" ]])
441
+ require('mini.misc').setup_auto_root()
442
+ require('mini.misc').setup_restore_cursor()
443
+ require('mini.notify').setup({ window = { winblend = 0 } --[[ ,lsp_progress = { enable = false } ]] })
444
+ require('mini.pick').setup()
445
+ require('mini.pairs').setup()
446
+ require('mini.snippets').start_lsp_server()
447
+ require('mini.statusline').setup()
448
+ require('mini.starter').setup()
449
+ require('mini.tabline').setup()
450
+ vim.notify = require('mini.notify').make_notify() --- `vim.print = MiniNotify.make_notify()` conflicts with `:=vim.opt.number`
451
+ vim.opt.completeopt:append('fuzzy') --- it should be after require("mini.completion").setup() otherwise auto trigger first suggestion
452
+ end
453
+
454
+ --- ╭────────────╮
455
+ --- │ Navigation │
456
+ --- ╰────────────╯
457
+
458
+ map({ "i" }, "jk", "<ESC>") --- disabled on visual mode since is slow
459
+ map({ "i" }, "kj", "<ESC>") --- disabled on visual mode since is slow
460
+ map({ "n" }, "J", "10gj")
461
+ map({ "n" }, "K", "10gk")
462
+ map({ "n" }, "H", "10h")
463
+ map({ "n" }, "L", "10l")
464
+ map({ "n" }, "Y", "yg_", { desc = "Yank forward" }) --- "Y" yank forward by default
465
+ map({ "x" }, "Y", "g_y", { desc = "Yank forward" })
466
+ map({ "x" }, "P", "g_P", { desc = "Paste forward" }) --- "P" doesn't change register
467
+ map({ "x" }, "p", '"_c<c-r>+<esc>', { desc = "Paste (dot repeat)(register unchanged)" })
468
+ map({ "n", "x" }, "U", "@:", { desc = "repeat `:command`" }) --> :normal A,jkj --> :normal A,j --->  escape char by pression ctrl+v then escape
469
+ map({ "n", "x", "o" }, "\\", "@q", { desc = "repeat q register/macro" })
470
+ map({ "n", "x", "o" }, "|", "@w", { desc = "repeat w register/macro" })
471
+ map({ "x" }, "<", "<gv", { desc = "continious indent" })
472
+ map({ "x" }, ">", ">gv", { desc = "continious indent" })
473
+ map({ "n" }, "<esc>", "<esc>:nohlsearch<cr>", { desc = "Clear Copilot-suggestion / search-highlight" })
474
+
475
+ if not vim.g.vscode then
476
+ map({ "t" }, "<esc><esc>", "<C-\\><C-n>", { desc = "normal mode inside terminal" })
477
+ map({ "t" }, "<S-esc>", "<C-\\><C-n>", { desc = "normal mode inside terminal" })
478
+ map({ "n" }, "<C-s>", ":%s//g<Left><Left>", { desc = "Replace in Buffer" })
479
+ map({ "x" }, "<C-s>", ":s//g<Left><Left>", { desc = "Replace in Visual_selected" })
480
+ map({ "n" }, "<C-;>", "<C-6>", { desc = "go to last buffer" })
481
+ map({ "n", "t" }, "<C-h>", "<C-\\><C-n><C-w>h", { desc = "left window or [w" })
482
+ map({ "n", "t" }, "<C-j>", "<C-\\><C-n><C-w>j", { desc = "down window or ]w" })
483
+ map({ "n", "t" }, "<C-k>", "<C-\\><C-n><C-w>k", { desc = "up window or [w" })
484
+ map({ "n", "t" }, "<C-l>", "<C-\\><C-n><C-w>l", { desc = "right window or ]w" })
485
+ map({ "n", "x", "t" }, "<C-S-l>", "<cmd>vertical resize -2<cr>", { desc = "vertical shrink" })
486
+ map({ "n", "x", "t" }, "<C-S-h>", "<cmd>vertical resize +2<cr>", { desc = "vertical expand" })
487
+ map({ "n", "x", "t" }, "<C-S-j>", "<cmd>resize -2<cr>", { desc = "horizontal shrink" })
488
+ map({ "n", "x", "t" }, "<C-S-k>", "<cmd>resize +2<cr>", { desc = "horizontal shrink" })
489
+ map({ "n" }, "<right>", "<cmd>bnext<CR>", { desc = "next buffer" })
490
+ map({ "n" }, "<left>", "<cmd>bprevious<CR>", { desc = "prev buffer" })
491
+ map({ "n" }, "<leader>x", "<cmd>bp | bd! #<CR>", { desc = " buffer close" }) --- `bd!` forces closing terminal buffer
492
+
493
+ --> https://github.com/neovim/neovim/issues/9953
494
+ map("c", "<Up>", [[pumvisible() ? "<c-p>" : "<Up>"]], { expr = true, desc = "navigate wildmenu" })
495
+ map("c", "<Down>", [[pumvisible() ? "<c-n>" : "<Down>"]], { expr = true, desc = "navigate wildmenu" })
496
+ map("c", "<c-p>", [[pumvisible() ? "<c-e><c-p>" : "<c-p>"]], { expr = true, desc = "navigate history" })
497
+ map("c", "<c-n>", [[pumvisible() ? "<c-e><c-n>" : "<c-n>"]], { expr = true, desc = "navigate history" })
498
+ map("i", "<Tab>", [[pumvisible() ? "<c-n>" : "<tab>"]], { expr = true, desc = "next completion when no lsp" })
499
+ map("i", "<S-Tab>", [[pumvisible() ? "<c-p>" : "<s-tab>"]], { expr = true, desc = "prev completion when no lsp" })
500
+ end
501
+
502
+ if not vim.g.vscode then
503
+ map({ "n" }, "Q", "<cmd>lua vim.cmd.quit()<cr>")
504
+ map({ "n" }, "R", "<cmd>lua vim.lsp.buf.format{ timeout_ms = 5000 } MiniTrailspace.trim() vim.cmd.write()<cr>")
505
+ else
506
+ map({ "n" }, "Q", function() vscode.call('workbench.action.closeActiveEditor') end)
507
+ map({ "n" }, "R", function()
508
+ vscode.call('editor.action.format')
509
+ vscode.call('workbench.action.files.save')
510
+ end)
511
+ end
512
+
513
+ --- ╭────────────────╮
514
+ --- │ leader keymaps │
515
+ --- ╰────────────────╯
516
+
517
+ ---@format disable
518
+ if not vim.g.vscode then
519
+ ---------------------------------------------------------------------------------------------------------------------
520
+ vim.lsp.config('*', { root_markers = { '.git' } })
521
+
522
+ vim.diagnostic.config({
523
+ update_in_insert = true,
524
+ virtual_text = true,
525
+ signs = {
526
+ text = {
527
+ [vim.diagnostic.severity.ERROR] = "",
528
+ [vim.diagnostic.severity.WARN] = "",
529
+ [vim.diagnostic.severity.HINT] = "",
530
+ [vim.diagnostic.severity.INFO] = "",
531
+ },
532
+ },
533
+ })
534
+
535
+ --> https://www.youtube.com/watch?v=ooTcnx066Do
536
+ local sendSequence = function(sequence, continue_sequence)
537
+ if not continue_sequence then
538
+ vim.cmd.term()
539
+ end
540
+ vim.fn.chansend(vim.bo.channel, { sequence .. '\r' })
541
+ vim.pack.add({{ src = 'https://github.com/neovim/nvim-lspconfig', version = 'v2.10.0' }})
542
+ end
543
+
544
+ --> https://github.com/mason-org/mason-lspconfig.nvim/issues/371
545
+ --> https://github.com/vuejs/language-tools/issues/5381
546
+ vim.lsp.config['ts_ls'] = {
547
+ cmd = { 'typescript-language-server', '--stdio' },
548
+ filetypes = { 'vue', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' },
549
+ init_options = {
550
+ plugins = {
551
+ {
552
+ name = '@vue/typescript-plugin',
553
+ location = vim.env.PNPM_HOME .. "/global/5/node_modules/@vue/language-server/node_modules/@vue/typescript-plugin",
554
+ languages = { 'vue' },
555
+ },
556
+ },
557
+ },
558
+ }
559
+
560
+ --- https://github.com/Hessesian/kmp-lsp/blob/main/docs/editors.md
561
+ vim.lsp.config['kmp-lsp'] = { cmd = { 'kmp-lsp' }, filetypes = { 'kotlin', 'java', 'swift' }, }
562
+
563
+ if vim.fn.executable('biome') == 1 then vim.lsp.enable({ 'biome' }) end
564
+ if vim.fn.executable('oxfmt') == 1 then vim.lsp.enable({ 'oxfmt' }) end
565
+ if vim.fn.executable('ty') == 1 then vim.lsp.enable({ 'ty' }) end ---> uv env ---> required by ty
566
+ if vim.fn.executable('tailwindcss-language-server') == 1 then vim.lsp.enable({ 'tailwindcss' }) end
567
+ if vim.fn.executable('vscode-json-language-server') == 1 then vim.lsp.enable({ 'jsonls' }) end
568
+ if vim.fn.executable('yaml-language-server') == 1 then vim.lsp.enable({ 'yamlls' }) end
569
+
570
+ vim.lsp.enable({ 'bashls', 'clangd', 'copilot', 'cssls', 'dockerls', 'emmet_language_server', 'gopls', 'html', 'kmp-lsp', 'lua_ls', 'neocmake', 'omnisharp', 'phpantom_lsp', 'prismals', 'ruff', 'rust_analyzer', 'sqls', 'taplo', 'terraformls', 'ts_ls' })
571
+
572
+ map("n", "<leader>L", "", { desc = " LSP installer" }) --- relaunch nvim to autostart the new installed lsp
573
+ map("n", "<leader>Lb", function() sendSequence('mise use --global node npm:bash-language-server@5.6.0') end, { desc = " bash" }) --- (no formatter press `=` to format selection)
574
+ map("n", "<leader>Lc", function() sendSequence('mise use --global conda:clang-tools@22.1.8') end, { desc = " c/c++" }) --- (+formatter)
575
+ map("n", "<leader>LC", function() sendSequence('mise x pixi -- pixi g install omnisharp-roslyn=1.39.12') end, { desc = " c#" }) --- (+formatter)
576
+ map("n", "<leader>Ld", function() sendSequence('mise use --global node npm:dockerfile-language-server-nodejs@0.15.0') end, { desc = " docker" }) --- (+formatter)
577
+ map("n", "<leader>Le", function() sendSequence('mise use --global node npm:emmet-language-server@0.1.3') end, { desc = " emmet (autoclose tag)" }) --- suggests <autoclose-this-tag> but not </close-some-open-tag> like vscode-html-language-server
578
+ map("n", "<leader>Lf", function() sendSequence('mise use --global node npm:oxfmt@0.58.0') end, { desc = " oxfmt formatter/eslint" })
579
+ map("n", "<leader>LF", function() sendSequence('mise use --global biome@2.5.3') end, { desc = " biome formatter/eslint" }) --- https://biomejs.dev/internals/language-support/
580
+ map("n", "<leader>Lg", function() sendSequence('mise use --global go@1.26.5 conda:gopls@0.20.0') end, { desc = " go" }) --- (+formatter)
581
+ map("n", "<leader>Lh", function() sendSequence('mise use --global github:phpantom-dev/phpantom_lsp@0.8.0') end, { desc = " php" }) --- (+formatter)
582
+ map("n", "<leader>Lj", function() sendSequence('mise use --global github:hessesian/kmp-lsp@0.24.0') end, { desc = "   java kotlin swift" })
583
+ map("n", "<leader>Ll", function() sendSequence('mise use --global lua-language-server@3.18.2') end, { desc = " lua" }) --- (+formatter)
584
+ map("n", "<leader>LM", function() sendSequence('mise use --global github:neocmakelsp/neocmakelsp@0.10.4') end, { desc = " cmake" }) --- (+formatter +linter)
585
+ map("n", "<leader>Lp", function() sendSequence('mise use --global node npm:@prisma/language-server@31.11.0') end, { desc = " prisma" }) --- (+formatter)
586
+ map("n", "<leader>LP", function() sendSequence('mise use --global ty@0.0.58 ruff@0.15.21') end, { desc = " python" }) --- (-formatter)
587
+ map("n", "<leader>Lr", function() sendSequence('mise use --global rust@1.97.0 rust-analyzer@2026-07-06') end, { desc = " rust" }) --- (+formatter)
588
+ map("n", "<leader>LR", function() sendSequence('mise use --global terraform-ls@0.38.0') end, { desc = " terraform" }) --- (no formatter press `=` to format selection)
589
+ map("n", "<leader>LS", function() sendSequence('mise use --global github:sqls-server/sqls@0.2.45') end, { desc = " sqls" })
590
+ map("n", "<leader>Lt", function() sendSequence('mise use --global node npm:@tailwindcss/language-server@0.14.29') end, { desc = "󱏿 tailwindcss" })
591
+ map("n", "<leader>LT", function() sendSequence('mise use --global taplo@0.10.0') end, { desc = " toml" }) --- (+formatter)
592
+ map("n", "<leader>Lx", function() sendSequence('mise use --global node npm:vscode-langservers-extracted@4.10.0') end, { desc = "   css html json" }) --- (+formatter)
593
+ map("n", "<leader>LX", function() sendSequence('pnpm install -g typescript@6.0.2 typescript-language-server@5.3.0 @vue/typescript-plugin@3.3.7') end, { desc = "   󰡄 " }) --- (+formatter)
594
+ map("n", "<leader>Ly", function() sendSequence('mise use --global node npm:yaml-language-server@1.24.0') end, { desc = " yaml" }) --- (+formatter)
595
+
596
+ ------------------------------------------------------------------------------------------------------------------------
597
+
598
+ map("n", "<leader>l", "", { desc = "󰗊 LSP" })
599
+ map("n", "<leader>la", function() vim.lsp.buf.code_action() end, { desc = " code action" })
600
+ map("n", "<leader>lc", function() vim.lsp.buf.incoming_calls() end, { desc = " incoming calls" })
601
+ map("n", "<leader>lC", function() vim.lsp.buf.outgoing_calls() end, { desc = " outgoing calls" })
602
+ map("n", "<leader>lb", "<cmd>Pick diagnostic<cr>", { desc = " diagnostic curr buffer" })
603
+ map("n", "<leader>ld", "<cmd>Pick lsp scope='definition'<cr>", { desc = " pick definition" })
604
+ map("n", "<leader>lD", "<cmd>Pick lsp scope='declaration'<cr>", { desc = " pick declaration" })
605
+ map("n", "<leader>lF", function() vim.lsp.buf.format({ timeout_ms = 5000 }) end, { desc = "󰉢 format" })
606
+ map("n", "<leader>lh", function() vim.lsp.buf.hover() end, { desc = "󰆽 hover" })
607
+ map("n", "<leader>lH", function() vim.lsp.buf.signature_help() end, { desc = "󰽉 signature" })
608
+ map("n", "<leader>lI", "<cmd>Pick lsp scope='implementation'<cr>", { desc = " pick implementation" })
609
+ map("n", "<leader>lM", function() vim.cmd("checkhealth vim.lsp") end, { desc = " checkhealth lsp" })
610
+ map("n", "<leader>ln", function() vim.diagnostic.jump({ count = 1, float = true }) end, { desc = " diagnostic next" })
611
+ map("n", "<leader>lo", function() vim.diagnostic.open_float() end, { desc = " diagnostic open" })
612
+ map("n", "<leader>lp", function() vim.diagnostic.jump({ count = -1, float = true }) end, { desc = " diagnostic previous" })
613
+ map("n", "<leader>lq", "<cmd>Pick list scope='location'<cr>", { desc = " pick location list" })
614
+ map("n", "<leader>lr", "<cmd>Pick lsp scope='references'<cr>", { desc = " pick references" })
615
+ map("n", "<leader>lR", function() vim.lsp.buf.rename() end, { desc = "󰘎 rename" })
616
+ map("n", "<leader>ls", "<cmd>Pick lsp scope='document_symbol'<cr>", { desc = " pick document symbols" })
617
+ map("n", "<leader>lS", "<cmd>Pick lsp scope='workspace_symbol'<cr>", { desc = " pick workspace symbols" })
618
+ map("n", "<leader>lt", "<cmd>Pick lsp scope='type_definition'<cr>", { desc = " pick typedefinition" })
619
+
620
+ ------------------------------------------------------------------------------------------------------------------------
621
+
622
+ map("n", "<leader>E", "", { desc = " extensions" })
623
+ map(
624
+ "n",
625
+ "<leader>Ef",
626
+ function()
627
+ vim.pack.add({{ src = 'https://github.com/folke/flash.nvim', commit = "v2.1.0"}})
628
+ vim.cmd.restart()
629
+ end,
630
+ { desc = " flash.nvim 󰉁" }
631
+ )
632
+ map(
633
+ "n",
634
+ "<leader>Ek",
635
+ function()
636
+ sendSequence("mise use --global opencode github:github/copilot-language-server-release; exit")
637
+ vim.pack.add({{ src = 'https://github.com/folke/sidekick.nvim', version = 'v2.3.0' }})
638
+ autocmd({ "TermLeave" }, { once = true, command = "lsp enable copilot" })
639
+ require("sidekick").setup({})
640
+ end,
641
+ { desc = " sidekick 󰫣  " }
642
+ )
643
+ map(
644
+ "n",
645
+ "<leader>En",
646
+ function()
647
+ vim.pack.add({{ src = 'https://github.com/rodolfo-arg/neotype', commit = "b7e2bff"}})
648
+ end,
649
+ { desc = " neotype 󰌌 " }
650
+ )
651
+ map(
652
+ "n",
653
+ "<leader>Es",
654
+ function()
655
+ vim.pack.add({{ src = "https://github.com/supermaven-inc/supermaven-nvim", commit = "07d20fce48a5629686aefb0a7cd4b25e33947d50"}})
656
+ vim.cmd.restart("SupermavenUseFree")
657
+ end,
658
+ { desc = " supermaven  " }
659
+ )
660
+ map("n", "<leader>EF", function() vim.pack.del({"flash.nvim"}) vim.cmd.restart() end, { desc = " flash.nvim 󰉁 " })
661
+ map("n", "<leader>EK", function() vim.pack.del({"sidekick.nvim"}) vim.cmd.restart() end, { desc = " sidekick 󰫣  " })
662
+ map("n", "<leader>EN", function() vim.pack.del({"neotype"}) vim.cmd.restart() end, { desc = " neotype 󰌌 " })
663
+ map("n", "<leader>ES", function() vim.pack.del({"supermaven-nvim"}) vim.cmd.restart() end, { desc = " supermaven  " })
664
+ map("n", "<leader>E?", function() vim.print(vim.pack.get()) end, { desc = "󱃔 installed extensions" })
665
+ map("n", "<leader>E!", function() vim.cmd.checkhealth() end, { desc = " checkhealth extensions" })
666
+
667
+ ------------------------------------------------------------------------------------------------------------------------
668
+
669
+ map("n", "<leader>f", "", { desc = " find" })
670
+ map("n", "<leader>fb", "<cmd>Pick buffers<cr>", { desc = "󱙈 buffers" })
671
+ map("n", "<leader>fB", "<cmd>Pick buf_lines<cr>", { desc = "󰺮 ripgrep in buffers" })
672
+ map("n", "<leader>fc", "<cmd>Pick colorscheme<cr>", { desc = " colorscheme" })
673
+ map("n", "<leader>fk", "<cmd>Pick keymaps<cr>", { desc = "󰌌 keymaps" })
674
+ map("n", "<leader>fn", function() require("mini.notify").show_history() end, { desc = "󰍩 notify history" })
675
+ map(
676
+ "n",
677
+ "<leader>ff",
678
+ function()
679
+ vim.cmd.terminal([[ nvim --server $NVIM --remote "$(rg --files --sortr=path | fzf --no-sort --preview-window=nohidden)"]])
680
+ vim.api.nvim_buf_set_name(0, "fzf")
681
+ vim.cmd.set("laststatus=0")
682
+ autocmd("TermClose", { buffer = vim.fn.bufnr(), once = true, command = [[silent! bdelete! fzf | set laststatus=3]] })
683
+ end,
684
+ { desc = " fzf files" }
685
+ )
686
+ map("n", "<leader>ft", "<cmd>Pick grep_live<cr>", { desc = " fzf text" })
687
+ map("n", "<leader>fr", "<cmd>Pick oldfiles<cr>", { desc = "󱋡 recent files" })
688
+ map("n", '<leader>f"', "<cmd>Pick registers<cr>", { desc = '󱛢 register (:help quote)' })
689
+ map("n", "<leader>f'", "<cmd>Pick marks<cr>", { desc = " bookmarks" })
690
+ map("n", "<leader>f;", "<cmd>Pick list scope='jump'<cr>", { desc = " jumps" })
691
+ map("n", "<leader>f:", "q:", { desc = " :commands (U to repeat)" }) --- <cr> to execute command
692
+ map("n", "<leader>f,", "<cmd>buffer #<cr>", { desc = "󰻡 recent buffer" })
693
+ map("n", "<leader>g", "", { desc = "󰊢 git" })
694
+ map(
695
+ "n",
696
+ "<leader>gg",
697
+ function()
698
+ vim.cmd.terminal("lazygit")
699
+ autocmd("TermClose", { pattern = 'term*lazygit', command = [[silent! bdelete! term*lazygit]], once = true })
700
+ end,
701
+ { desc = " lazygit" }
702
+ ) --- `:term lazygit` doesn't work on zsh.exe
703
+ map("n", "<leader>gp", "<cmd>Pick git_hunks<cr>", { desc = " git-hunk preview" })
704
+ map("n", "<leader>gr", "<cmd>lua MiniDiff.textobject() vim.cmd.normal('gH')<cr>", { desc = " git-hunk reset" })
705
+ map("n", "<leader>gs", "<cmd>lua MiniDiff.textobject() vim.cmd.normal('gh')<cr>", { desc = " git-hunk stage" })
706
+ map("n", "<leader>u", "", { desc = "󰨙 UI" })
707
+ map("n", "<leader>ub", function() vim.o.showtabline = vim.o.showtabline == 0 and 2 or 0 end, { desc = "󰔡 bufferline" })
708
+ map("n", "<leader>uc", function() vim.o.number = not vim.o.number end, { desc = "󰔡 statuscolumn" })
709
+ map("n", "<leader>ud", function() vim.diagnostic.enable(not vim.diagnostic.is_enabled()) end, { desc = "󰔡 diagnostic" })
710
+ map("n", "<leader>uf", function() vim.o.foldmethod = vim.o.foldmethod == 'expr' and 'indent' or 'expr' end, { desc = "󰔢 fold by indent or lsp" })
711
+ map("n", "<leader>ul", "<cmd>set cursorline!<cr>", { desc = "󰔢 cursorline" })
712
+ map("n", "<leader>up", "<cmd>popup PopUp<cr>", { desc = "󰔢 mouse-popup" })
713
+ map("n", "<leader>us", function() vim.o.laststatus = vim.o.laststatus == 0 and 3 or 0 end, { desc = "󰔡 statusline" })
714
+ map("n", "<leader>t", "<cmd>term<cr>", { desc = " term tab" })
715
+ map("n", "<leader>v", "<cmd>vsplit | terminal<cr>", { desc = " term horizontal" })
716
+ map("n", "<leader>V", "<cmd>split | terminal<cr>", { desc = " term vertical" })
717
+ map("n", "<leader>w", "", { desc = " window" })
718
+ map("n", "<leader>wv", "<cmd>vsplit<cr>", { desc = " vertical window" })
719
+ map("n", "<leader>wV", "<cmd>split<cr>", { desc = " horizontal window" })
720
+ map(
721
+ "n",
722
+ "<leader>e",
723
+ function()
724
+ --- toggle explorer
725
+ if M.netrw_buf then
726
+ vim.cmd.bdelete(M.netrw_buf)
727
+ M.netrw_buf = nil
728
+ return
729
+ end
730
+
731
+ local path = vim.split(vim.fn.expand('%'),"/")
732
+ vim.cmd.Explore(vim.fn.getcwd()) --- Explore() restores tree at getcwd() which is changed to .git path by mini.misc
733
+ vim.cmd.buffer("#")
734
+ vim.cmd.Vexplore({bang = true})
735
+
736
+ --- https://superuser.com/questions/1531456/how-to-reveal-a-file-in-vim-netrw-treeview
737
+ if M.netrw_cursor then
738
+ vim.schedule(function()
739
+ pcall(vim.api.nvim_win_set_cursor, 0, M.netrw_cursor)
740
+ end)
741
+ else
742
+ for _, dir in ipairs(path) do
743
+ vim.fn.search(dir)
744
+ end
745
+ end
746
+ end,
747
+ { desc = "󰙅 explorer" }
748
+ )
749
+ map(
750
+ "n",
751
+ "<leader>o",
752
+ function()
753
+ local curr_file = vim.fs.normalize(vim.fn.expand('%:p'))
754
+ vim.cmd.terminal(
755
+ 'echo ' .. curr_file .. ' > $HOME/.yazi;' ..
756
+ 'yazi ' .. curr_file .. ' --chooser-file $HOME/.yazi;' ..
757
+ 'nvim --server $NVIM --remote "$(cat $HOME/.yazi)";'
758
+ -- .. 'nvim --server $NVIM --remote-send "<cmd>bdelete! \\#<cr>"'
759
+ )
760
+ vim.cmd.file("yazi")
761
+ vim.cmd.set("laststatus=0")
762
+ autocmd("TermClose", { buffer = vim.fn.bufnr(), command = [[silent! bdelete! ]] .. vim.fn.bufnr() .. [[ | set laststatus=3]], once = true })
763
+ end,
764
+ { desc = "󰙅 yazi" }
765
+ )
766
+ else
767
+ map(
768
+ "n",
769
+ "<leader>o",
770
+ function() return vscode.action("workbench.files.action.focusFilesExplorer") end,
771
+ { desc = "󰙅 explorer/previewer" }
772
+ )
773
+ end
774
+
775
+ ------------------------------------------------------------------------------------------------------------------------
776
+ map({ "n", "x" }, "<leader><leader>", "", { desc = "󰅌 second clipboard" })
777
+ map("n", "<leader><leader>p", '"*p', { desc = "󰨸 paste after" })
778
+ map("n", "<leader><leader>P", '"*P', { desc = "󰨸 paste before" })
779
+ map("x", "<leader><leader>p", '"*p', { desc = "󰨸 paste" }) --- "Paste after (second_clip)"
780
+ map("x", "<leader><leader>P", 'g_"*P', { desc = "󰨸 paste forward" }) --- only works in visual mode
781
+ map("n", "<leader><leader>y", '"*y', { desc = "󰅍 yank" })
782
+ map("n", "<leader><leader>Y", '"*yg_', { desc = "󰅍 yank forward" })
783
+ map("x", "<leader><leader>y", '"*y', { desc = "󰅍 yank" })
784
+ map("x", "<leader><leader>Y", 'g_"*y', { desc = "󰅍 yank forward" })
785
+
786
+ --- ╭───────────────────────────────────╮
787
+ --- │ Operator / Motions / text objects │
788
+ --- ╰───────────────────────────────────╯
789
+
790
+ map({ "o" }, "g\\", [[setreg('q', 'v' . getcharstr() . getcharstr() . '<esc>`>l') ? "" : ":exec 'normal ' . getreg('q')<cr>" ]], { expr = true, remap = true, desc = "textobj end (dot to repeat)" }) --- paragraph textobj needs `>l
791
+ map({ "o" }, "g|", [[setreg('q', 'v' . getcharstr() . getcharstr() . 'o<esc>' ) ? "" : ":exec 'normal ' . getreg('q')<cr>" ]], { expr = true, remap = true, desc = "textobj start (dot to repeat)" }) --- remap=true to detect mini.ai
792
+ map({ "n" }, "g\\", [[setreg('q', 'v' . getcharstr() . getcharstr() . '<esc>`>' ) ? "" : "@q" ]], { expr = true, remap = true, desc = "textobj end (\\ repeats)" }) --- remap=true to detect mini.ai
793
+ map({ "n" }, "g|", [[setreg('w', 'v' . getcharstr() . getcharstr() . '<esc>`<' ) ? "" : "@w" ]], { expr = true, remap = true, desc = "textobj start (| repeats)" }) --- remap=true to detect mini.ai
794
+ map({ "x" }, "g\\", [[setreg('q','<esc>mT`<mS`Tv' . getcharstr() . getcharstr() . 'o`So' ) ? "" : "@q" ]], { expr = true, remap = true, desc = "textobj end (\\ repeats)" }) --- remap=true to detect mini.ai
795
+ map({ "x" }, "g|", [[setreg('w','<esc>mT`>mS`Tv' . getcharstr() . getcharstr() . '`So' ) ? "" : "@w" ]], { expr = true, remap = true, desc = "textobj start (| repeats)" }) --- remap=true to detect mini.ai
796
+ map( "x", "go", [[<cmd>let _=&commentstring | set commentstring={/*\ %s\ */} | normal gc<cr><cmd>let &commentstring=_<cr>]], { desc = "jsx comment" })
797
+ map({ "n", "x" }, "gb", '"_d', { desc = "Blackhole Motion/Selected (dot to repeat)" })
798
+ map({ "n", "x" }, "gB", '"_D', { desc = "Blackhole Linewise (dot to repeat)" })
799
+ map({ "n", "o", "x" }, "g.", "`.", { desc = "go to last change" })
800
+ map({ "n" }, "gy", '"1p', { desc = "Redo register (dot to Paste forward the rest of register)" })
801
+ map({ "n" }, "gY", '"1P', { desc = "Redo register (dot to Paste backward the rest of register)" })
802
+ map({ "n" }, "g<Up>", "<c-a>", { desc = "numbers ascending" })
803
+ map({ "n" }, "g<Down>", "<c-x>", { desc = "numbers descending" })
804
+ map({ "x" }, "g<Up>", "g<c-a>", { desc = "numbers ascending" })
805
+ map({ "x" }, "g<Down>", "g<c-x>", { desc = "numbers descending" })
806
+ map({ "n", "x" }, "g+", "<C-a>", { desc = "Increment number (dot to repeat)" })
807
+ map({ "n", "x" }, "g-", "<C-x>", { desc = "Decrement number (dot to repeat)" })
808
+ map({ "n" }, "vgh", "<cmd>lua require('mini.diff').textobject()<cr>", { desc = "select diff/hunk" })
809
+ map({ "n" }, "vgc", "<cmd>lua require('mini.comment').textobject()<cr>", { desc = "select BlockComment" })
810
+ map({ "n", "o", "x" }, "gC", function() require('mini.comment').textobject() end, { desc = "select BlockComment" })
811
+ map({ "n", "o", "x" }, "gD", function() require('mini.diff').textobject() end, { desc = "select diff/hunk" })
812
+ map({ "o", "x" }, "ii", function() require("mini.ai").select_textobject("i", "i") end, { desc = "indent_noblanks" })
813
+ map({ "o", "x" }, "ai", "<cmd>normal Viioko<cr>", { desc = "indent_noblanks" })