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,1752 @@
1
+ --- *mini.base16* Base16 colorscheme creation
2
+ ---
3
+ --- MIT License Copyright (c) 2021 Evgeni Chasnovski
4
+
5
+ --- Fast implementation of [chriskempson/base16](https://github.com/chriskempson/base16)
6
+ --- color scheme (with Copyright (C) 2012 Chris Kempson) adapted for modern Neovim
7
+ --- Lua plugins. Extra features:
8
+ --- - Configurable automatic support of cterm colors (see |highlight-cterm|).
9
+ --- - Opinionated palette generator based only on background and foreground
10
+ --- colors.
11
+ ---
12
+ --- Supported highlight groups:
13
+ --- - Built-in Neovim LSP and diagnostic.
14
+ ---
15
+ --- - Plugins (either with explicit definition or by verification that default
16
+ --- highlighting works appropriately):
17
+ --- - [nvim-mini/mini.nvim](https://nvim-mini.org/mini.nvim)
18
+ --- - [akinsho/bufferline.nvim](https://github.com/akinsho/bufferline.nvim)
19
+ --- - [anuvyklack/hydra.nvim](https://github.com/anuvyklack/hydra.nvim)
20
+ --- - [DanilaMihailov/beacon.nvim](https://github.com/DanilaMihailov/beacon.nvim)
21
+ --- - [folke/lazy.nvim](https://github.com/folke/lazy.nvim)
22
+ --- - [folke/noice.nvim](https://github.com/folke/noice.nvim)
23
+ --- - [folke/snacks.nvim](https://github.com/folke/snacks.nvim)
24
+ --- - [folke/todo-comments.nvim](https://github.com/folke/todo-comments.nvim)
25
+ --- - [folke/trouble.nvim](https://github.com/folke/trouble.nvim)
26
+ --- - [folke/which-key.nvim](https://github.com/folke/which-key.nvim)
27
+ --- - [ggandor/leap.nvim](https://github.com/ggandor/leap.nvim)
28
+ --- - [ggandor/lightspeed.nvim](https://github.com/ggandor/lightspeed.nvim)
29
+ --- - [glepnir/dashboard-nvim](https://github.com/glepnir/dashboard-nvim)
30
+ --- - [glepnir/lspsaga.nvim](https://github.com/glepnir/lspsaga.nvim)
31
+ --- - [HiPhish/rainbow-delimiters.nvim](https://github.com/HiPhish/rainbow-delimiters.nvim)
32
+ --- - [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
33
+ --- - [justinmk/vim-sneak](https://github.com/justinmk/vim-sneak)
34
+ --- - [ibhagwan/fzf-lua](https://github.com/ibhagwan/fzf-lua)
35
+ --- - [kevinhwang91/nvim-bqf](https://github.com/kevinhwang91/nvim-bqf)
36
+ --- - [kevinhwang91/nvim-ufo](https://github.com/kevinhwang91/nvim-ufo)
37
+ --- - [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)
38
+ --- - [lukas-reineke/indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim)
39
+ --- - [MeanderingProgrammer/render-markdown.nvim](https://github.com/MeanderingProgrammer/render-markdown.nvim)
40
+ --- - [neoclide/coc.nvim](https://github.com/neoclide/coc.nvim)
41
+ --- - [NeogitOrg/neogit](https://github.com/NeogitOrg/neogit)
42
+ --- - [nvim-lualine/lualine.nvim](https://github.com/nvim-lualine/lualine.nvim)
43
+ --- - [nvim-neo-tree/neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim)
44
+ --- - [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
45
+ --- - [nvim-tree/nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua)
46
+ --- - [OXY2DEV/helpview.nvim](https://github.com/OXY2DEV/helpview.nvim)
47
+ --- - [OXY2DEV/markview.nvim](https://github.com/OXY2DEV/markview.nvim)
48
+ --- - [phaazon/hop.nvim](https://github.com/phaazon/hop.nvim)
49
+ --- - [rcarriga/nvim-dap-ui](https://github.com/rcarriga/nvim-dap-ui)
50
+ --- - [rcarriga/nvim-notify](https://github.com/rcarriga/nvim-notify)
51
+ --- - [rlane/pounce.nvim](https://github.com/rlane/pounce.nvim)
52
+ --- - [romgrk/barbar.nvim](https://github.com/romgrk/barbar.nvim)
53
+ --- - [saghen/blink.cmp](https://github.com/saghen/blink.cmp)
54
+ --- - [stevearc/aerial.nvim](https://github.com/stevearc/aerial.nvim)
55
+ --- - [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim)
56
+ ---
57
+ --- # Setup ~
58
+ ---
59
+ --- This module needs a setup with `require('mini.base16').setup({})` (replace
60
+ --- `{}` with your `config` table). It will create global Lua table
61
+ --- `MiniBase16` which you can use for scripting or manually (with
62
+ --- `:lua MiniBase16.*`).
63
+ ---
64
+ --- See |MiniBase16.config| for `config` structure and default values.
65
+ ---
66
+ --- This module doesn't have runtime options, so using `vim.b.minibase16_config`
67
+ --- will have no effect here.
68
+ ---
69
+ --- Example: >lua
70
+ ---
71
+ --- require('mini.base16').setup({
72
+ --- palette = {
73
+ --- base00 = '#112641',
74
+ --- base01 = '#3a475e',
75
+ --- base02 = '#606b81',
76
+ --- base03 = '#8691a7',
77
+ --- base04 = '#d5dc81',
78
+ --- base05 = '#e2e98f',
79
+ --- base06 = '#eff69c',
80
+ --- base07 = '#fcffaa',
81
+ --- base08 = '#ffcfa0',
82
+ --- base09 = '#cc7e46',
83
+ --- base0A = '#46a436',
84
+ --- base0B = '#9ff895',
85
+ --- base0C = '#ca6ecf',
86
+ --- base0D = '#42f7ff',
87
+ --- base0E = '#ffc4ff',
88
+ --- base0F = '#00a5c5',
89
+ --- },
90
+ --- use_cterm = true,
91
+ --- plugins = {
92
+ --- default = false,
93
+ --- ['nvim-mini/mini.nvim'] = true,
94
+ --- },
95
+ --- })
96
+ --- <
97
+ --- # Notes ~
98
+ ---
99
+ --- 1. This is used to create some of plugin's color schemes
100
+ --- (see |MiniBase16-color-schemes|).
101
+ --- 2. Using `setup()` doesn't actually create a |:colorscheme|. It basically
102
+ --- creates a coordinated set of |highlight-groups|. To create your own theme:
103
+ --- - Put "myscheme.lua" file (name after your chosen theme name) inside
104
+ --- any "colors" directory reachable from |'runtimepath'| ("colors" inside
105
+ --- your Neovim config directory is usually enough).
106
+ --- - Inside "myscheme.lua" call `require('mini.base16').setup()` with your
107
+ --- palette and only after that set |g:colors_name| to "myscheme".
108
+ ---@tag MiniBase16
109
+
110
+ --- # Base16 colorschemes ~
111
+ ---
112
+ --- This module comes with several pre-built color schemes. Each of them is
113
+ --- a |mini.base16| theme created with faster version of the following Lua code: >lua
114
+ ---
115
+ --- require('mini.base16').setup({ palette = palette, use_cterm = true })
116
+ --- <
117
+ --- Activate them as regular |:colorscheme| (for example, `:colorscheme minischeme`).
118
+ ---
119
+ --- ## minischeme ~
120
+ --- *minischeme*
121
+ ---
122
+ --- Blue and yellow main colors with high contrast and saturation palette.
123
+ --- Palettes are: >lua
124
+ ---
125
+ --- -- For dark 'background':
126
+ --- MiniBase16.mini_palette('#112641', '#e2e98f', 75)
127
+ ---
128
+ --- -- For light 'background':
129
+ --- MiniBase16.mini_palette('#e2e5ca', '#002a83', 75)
130
+ --- <
131
+ --- ## minicyan ~
132
+ --- *minicyan*
133
+ ---
134
+ --- Cyan and grey main colors with moderate contrast and saturation palette.
135
+ --- Palettes are: >lua
136
+ ---
137
+ --- -- For dark 'background':
138
+ --- MiniBase16.mini_palette('#0A2A2A', '#D0D0D0', 50)
139
+ ---
140
+ --- -- For light 'background':
141
+ --- MiniBase16.mini_palette('#C0D2D2', '#262626', 80)
142
+ --- <
143
+ ---@tag MiniBase16-color-schemes
144
+
145
+ -- Module definition ==========================================================
146
+ local MiniBase16 = {}
147
+ local H = {}
148
+
149
+ --- Module setup
150
+ ---
151
+ --- Setup is done by applying base16 palette to enable colorscheme. Highlight
152
+ --- groups make an extended set from original
153
+ --- [base16-vim](https://github.com/chriskempson/base16-vim/) plugin. It is a
154
+ --- good idea to have `config.palette` respect the original [styling
155
+ --- principles](https://github.com/chriskempson/base16/blob/master/styling.md).
156
+ ---
157
+ --- By default only "gui highlighting" (see |highlight-gui| and
158
+ --- |'termguicolors'|) is supported. To support "cterm highlighting" (see
159
+ --- |highlight-cterm|) supply `config.use_cterm` argument in one of the formats:
160
+ --- - `true` to auto-generate from `palette` (as closest colors).
161
+ --- - Table with similar structure to `palette` but having terminal colors
162
+ --- (integers from 0 to 255) instead of hex strings.
163
+ ---
164
+ ---@param config table Module config table. See |MiniBase16.config|.
165
+ ---
166
+ ---@usage >lua
167
+ --- require('mini.base16').setup({}) -- replace {} with your config table
168
+ --- -- needs `palette` field present
169
+ --- <
170
+ MiniBase16.setup = function(config)
171
+ -- TODO: Remove after Neovim=0.9 support is dropped
172
+ if vim.fn.has('nvim-0.10') == 0 then
173
+ vim.notify(
174
+ '(mini.base16) Neovim<0.10 is soft deprecated (module works but is not supported).'
175
+ .. " It will be deprecated after the next 'mini.nvim' release (module might not work)."
176
+ .. ' Please update your Neovim version.'
177
+ )
178
+ end
179
+
180
+ -- Export module
181
+ _G.MiniBase16 = MiniBase16
182
+
183
+ -- Setup config
184
+ config = H.setup_config(config)
185
+
186
+ -- Apply config
187
+ H.apply_config(config)
188
+ end
189
+
190
+ --- Defaults ~
191
+ ---@eval return MiniDoc.afterlines_to_code(MiniDoc.current.eval_section)
192
+ ---@text # Plugin integrations ~
193
+ ---
194
+ --- `config.plugins` defines for which supported plugins highlight groups will
195
+ --- be created. Limiting number of integrations slightly decreases startup time.
196
+ --- It is a table with boolean (`true`/`false`) values which are applied as follows:
197
+ --- - If plugin name (as listed in |mini.base16|) has entry, it is used.
198
+ --- - Otherwise `config.plugins.default` is used.
199
+ ---
200
+ --- Example which will load only "mini.nvim" integration: >lua
201
+ ---
202
+ --- require('mini.base16').setup({
203
+ --- palette = require('mini.base16').mini_palette('#112641', '#e2e98f', 75),
204
+ --- plugins = {
205
+ --- default = false,
206
+ --- ['nvim-mini/mini.nvim'] = true,
207
+ --- }
208
+ --- })
209
+ --- <
210
+ MiniBase16.config = {
211
+ -- Table with names from `base00` to `base0F` and values being strings of
212
+ -- HEX colors with format "#RRGGBB". NOTE: this should be explicitly
213
+ -- supplied in `setup()`.
214
+ palette = nil,
215
+
216
+ -- Whether to support cterm colors. Can be boolean, `nil` (same as
217
+ -- `false`), or table with cterm colors. See `setup()` documentation for
218
+ -- more information.
219
+ use_cterm = nil,
220
+
221
+ -- Plugin integrations. Use `default = false` to disable all integrations.
222
+ -- Also can be set per plugin (see |MiniBase16.config|).
223
+ plugins = { default = true },
224
+ }
225
+ --minidoc_afterlines_end
226
+
227
+ -- Module functionality =======================================================
228
+ --- Create MINI Base16 palette
229
+ ---
230
+ --- Create base16 palette based on the HEX (string `'#RRGGBB'`) colors of main
231
+ --- background and foreground with optional setting of accent chroma (see
232
+ --- details).
233
+ ---
234
+ --- # Algorithm design ~
235
+ ---
236
+ --- - Main operating color space is
237
+ --- [CIELCh(uv)](https://en.wikipedia.org/wiki/CIELUV#Cylindrical_representation_(CIELCh))
238
+ --- which is a cylindrical representation of a perceptually uniform CIELUV
239
+ --- color space. It defines color by three values: lightness L (values from 0
240
+ --- to 100), chroma (positive values), and hue (circular values from 0 to 360
241
+ --- degrees). Useful converting tool: https://www.easyrgb.com/en/convert.php
242
+ --- - There are four important lightness values: background, foreground, focus
243
+ --- (around the middle of background and foreground, leaning towards
244
+ --- foreground), and edge (extreme lightness closest to foreground).
245
+ --- - First four colors have the same chroma and hue as `background` but
246
+ --- lightness progresses from background towards focus.
247
+ --- - Second four colors have the same chroma and hue as `foreground` but
248
+ --- lightness progresses from foreground towards edge in such a way that
249
+ --- `base05` color is main foreground color.
250
+ --- - The rest eight colors are accent colors which are created in pairs
251
+ --- - Each pair has same hue from set of hues "most different" to
252
+ --- background and foreground hues (if respective chorma is positive).
253
+ --- - All colors have the same chroma equal to `accent_chroma` (if not
254
+ --- provided, chroma of foreground is used, as they will appear next
255
+ --- to each other). Note: this means that in case of low foreground
256
+ --- chroma, it is a good idea to set `accent_chroma` manually.
257
+ --- Values from 30 (low chorma) to 80 (high chroma) are common.
258
+ --- - Within pair there is base lightness (equal to foreground
259
+ --- lightness) and alternative (equal to focus lightness). Base
260
+ --- lightness goes to colors which will be used more frequently in
261
+ --- code: base08 (variables), base0B (strings), base0D (functions),
262
+ --- base0E (keywords).
263
+ --- How exactly accent colors are mapped to base16 palette is a result of
264
+ --- trial and error. One rule of thumb was: colors within one hue pair should
265
+ --- be more often seen next to each other. This is because it is easier to
266
+ --- distinguish them and seems to be more visually appealing. That is why
267
+ --- `base0D` and `base0F` have same hues because they usually represent
268
+ --- functions and delimiter (brackets included).
269
+ ---
270
+ ---@param background string Background HEX color (formatted as `#RRGGBB`).
271
+ ---@param foreground string Foreground HEX color (formatted as `#RRGGBB`).
272
+ ---@param accent_chroma number Optional positive number (usually between 0
273
+ --- and 100). Default: chroma of foreground color.
274
+ ---
275
+ ---@return table Table with base16 palette.
276
+ ---
277
+ ---@usage >lua
278
+ --- local p = require('mini.base16').mini_palette('#112641', '#e2e98f', 75)
279
+ --- require('mini.base16').setup({ palette = p })
280
+ --- <
281
+ MiniBase16.mini_palette = function(background, foreground, accent_chroma)
282
+ H.validate_hex(background, 'background')
283
+ H.validate_hex(foreground, 'foreground')
284
+ if accent_chroma and not (type(accent_chroma) == 'number' and accent_chroma >= 0) then
285
+ error('(mini.base16) `accent_chroma` should be a positive number or `nil`.')
286
+ end
287
+ local bg, fg = H.hex2lch(background), H.hex2lch(foreground)
288
+ accent_chroma = accent_chroma or fg.c
289
+
290
+ local palette = {}
291
+
292
+ -- Target lightness values
293
+ -- Justification for skewness towards foreground in focus is mainly because
294
+ -- it will be paired with foreground lightness and used for text.
295
+ local focus_l = 0.4 * bg.l + 0.6 * fg.l
296
+ local edge_l = fg.l > 50 and 99 or 1
297
+
298
+ -- Background colors
299
+ local bg_step = (focus_l - bg.l) / 3
300
+ palette[1] = { l = bg.l + 0 * bg_step, c = bg.c, h = bg.h }
301
+ palette[2] = { l = bg.l + 1 * bg_step, c = bg.c, h = bg.h }
302
+ palette[3] = { l = bg.l + 2 * bg_step, c = bg.c, h = bg.h }
303
+ palette[4] = { l = bg.l + 3 * bg_step, c = bg.c, h = bg.h }
304
+
305
+ -- Foreground colors Possible negative value of `palette[5].l` will be
306
+ -- handled in future conversion to hex.
307
+ local fg_step = (edge_l - fg.l) / 2
308
+ palette[5] = { l = fg.l - 1 * fg_step, c = fg.c, h = fg.h }
309
+ palette[6] = { l = fg.l + 0 * fg_step, c = fg.c, h = fg.h }
310
+ palette[7] = { l = fg.l + 1 * fg_step, c = fg.c, h = fg.h }
311
+ palette[8] = { l = fg.l + 2 * fg_step, c = fg.c, h = fg.h }
312
+
313
+ -- Accent colors
314
+
315
+ -- Only try to avoid color if it has positive chroma, because with zero
316
+ -- chroma hue is meaningless (as in polar coordinates)
317
+ local present_hues = {}
318
+ if bg.c > 0 then table.insert(present_hues, bg.h) end
319
+ if fg.c > 0 then table.insert(present_hues, fg.h) end
320
+ local hues = H.make_different_hues(present_hues, 4)
321
+
322
+ -- stylua: ignore start
323
+ palette[9] = { l = fg.l, c = accent_chroma, h = hues[1] }
324
+ palette[10] = { l = focus_l, c = accent_chroma, h = hues[1] }
325
+ palette[11] = { l = focus_l, c = accent_chroma, h = hues[2] }
326
+ palette[12] = { l = fg.l, c = accent_chroma, h = hues[2] }
327
+ palette[13] = { l = focus_l, c = accent_chroma, h = hues[4] }
328
+ palette[14] = { l = fg.l, c = accent_chroma, h = hues[3] }
329
+ palette[15] = { l = fg.l, c = accent_chroma, h = hues[4] }
330
+ palette[16] = { l = focus_l, c = accent_chroma, h = hues[3] }
331
+ -- stylua: ignore end
332
+
333
+ -- Convert to base16 palette
334
+ local base16_palette = {}
335
+ for i, lch in ipairs(palette) do
336
+ local name = H.base16_names[i]
337
+ -- It is ensured in `lch2hex` that only valid HEX values are produced
338
+ base16_palette[name] = H.lch2hex(lch)
339
+ end
340
+
341
+ return base16_palette
342
+ end
343
+
344
+ --- Converts palette with RGB colors to terminal colors
345
+ ---
346
+ --- Useful for caching `use_cterm` variable to increase speed.
347
+ ---
348
+ ---@param palette table Table with base16 palette (same as in
349
+ --- `MiniBase16.config.palette`).
350
+ ---
351
+ ---@return table Table with base16 palette using |highlight-cterm|.
352
+ MiniBase16.rgb_palette_to_cterm_palette = function(palette)
353
+ H.validate_base16_palette(palette, 'palette')
354
+
355
+ -- Create cterm palette only when it is needed to decrease load time
356
+ H.ensure_cterm_palette()
357
+
358
+ return vim.tbl_map(function(hex) return H.nearest_rgb_id(H.hex2rgb(hex), H.cterm_palette) end, palette)
359
+ end
360
+
361
+ -- Helper data ================================================================
362
+ -- Module default config
363
+ H.default_config = vim.deepcopy(MiniBase16.config)
364
+
365
+ -- Helper functionality =======================================================
366
+ -- Settings -------------------------------------------------------------------
367
+ H.setup_config = function(config)
368
+ H.check_type('config', config, 'table', true)
369
+ config = vim.tbl_deep_extend('force', vim.deepcopy(H.default_config), config or {})
370
+
371
+ -- Validate settings
372
+ H.validate_base16_palette(config.palette, 'config.palette')
373
+ H.validate_use_cterm(config.use_cterm, 'config.use_cterm')
374
+ H.check_type('plugins', config.plugins, 'table')
375
+
376
+ return config
377
+ end
378
+
379
+ H.apply_config = function(config)
380
+ MiniBase16.config = config
381
+
382
+ H.apply_palette(config.palette, config.use_cterm)
383
+ end
384
+
385
+ -- Validators -----------------------------------------------------------------
386
+ H.base16_names = {
387
+ 'base00',
388
+ 'base01',
389
+ 'base02',
390
+ 'base03',
391
+ 'base04',
392
+ 'base05',
393
+ 'base06',
394
+ 'base07',
395
+ 'base08',
396
+ 'base09',
397
+ 'base0A',
398
+ 'base0B',
399
+ 'base0C',
400
+ 'base0D',
401
+ 'base0E',
402
+ 'base0F',
403
+ }
404
+
405
+ H.validate_base16_palette = function(x, x_name)
406
+ if type(x) ~= 'table' then error(string.format('(mini.base16) `%s` is not a table.', x_name)) end
407
+
408
+ for _, color_name in pairs(H.base16_names) do
409
+ local c = x[color_name]
410
+ if c == nil then
411
+ local msg = string.format('(mini.base16) `%s` does not have value %s.', x_name, color_name)
412
+ error(msg)
413
+ end
414
+ H.validate_hex(c, string.format('%s.%s', x_name, color_name))
415
+ end
416
+
417
+ return true
418
+ end
419
+
420
+ H.validate_use_cterm = function(x, x_name)
421
+ if not x or type(x) == 'boolean' then return true end
422
+
423
+ if type(x) ~= 'table' then
424
+ local msg = string.format('(mini.base16) `%s` should be boolean or table with cterm colors.', x_name)
425
+ error(msg)
426
+ end
427
+
428
+ for _, color_name in pairs(H.base16_names) do
429
+ local c = x[color_name]
430
+ if c == nil then
431
+ local msg = string.format('(mini.base16) `%s` does not have value %s.', x_name, color_name)
432
+ error(msg)
433
+ end
434
+ if not (type(c) == 'number' and 0 <= c and c <= 255) then
435
+ local msg = string.format('(mini.base16) `%s.%s` is not a cterm color.', x_name, color_name)
436
+ error(msg)
437
+ end
438
+ end
439
+
440
+ return true
441
+ end
442
+
443
+ H.validate_hex = function(x, x_name)
444
+ local is_hex = type(x) == 'string' and x:len() == 7 and x:sub(1, 1) == '#' and (tonumber(x:sub(2), 16) ~= nil)
445
+
446
+ if not is_hex then
447
+ local msg = string.format('(mini.base16) `%s` is not a HEX color (string "#RRGGBB").', x_name)
448
+ error(msg)
449
+ end
450
+
451
+ return true
452
+ end
453
+
454
+ -- Highlighting ---------------------------------------------------------------
455
+ H.apply_palette = function(palette, use_cterm)
456
+ -- Prepare highlighting application. Notes:
457
+ -- - Clear current highlight only if other theme was loaded previously.
458
+ -- - No need to `syntax reset` because *all* syntax groups are defined later.
459
+ if vim.g.colors_name then vim.cmd('highlight clear') end
460
+ -- As this doesn't create colorscheme, don't store any name. Not doing it
461
+ -- might cause some issues with `syntax on`.
462
+ vim.g.colors_name = nil
463
+
464
+ local p, hi
465
+ if use_cterm then
466
+ p, hi = H.make_compound_palette(palette, use_cterm), H.highlight_both
467
+ else
468
+ p, hi = palette, H.highlight_gui
469
+ end
470
+
471
+ -- NOTE: recommendations for adding new highlight groups:
472
+ -- - Put all related groups (like for new plugin) in single paragraph.
473
+ -- - Sort within group alphabetically (by hl-group name) ignoring case.
474
+ -- - Link all repeated groups within paragraph (lowers execution time).
475
+ -- - Align by commas.
476
+
477
+ -- stylua: ignore start
478
+ -- Builtin highlighting groups. Some groups which are missing in 'base16-vim'
479
+ -- are added based on groups to which they are linked.
480
+ hi('ColorColumn', {fg=nil, bg=p.base01, attr=nil, sp=nil})
481
+ hi('ComplMatchIns', {fg=nil, bg=nil, attr=nil, sp=nil})
482
+ hi('Conceal', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
483
+ hi('CurSearch', {fg=p.base01, bg=p.base09, attr=nil, sp=nil})
484
+ hi('Cursor', {fg=p.base00, bg=p.base05, attr=nil, sp=nil})
485
+ hi('CursorColumn', {fg=nil, bg=p.base01, attr=nil, sp=nil})
486
+ hi('CursorIM', {fg=p.base00, bg=p.base05, attr=nil, sp=nil})
487
+ hi('CursorLine', {fg=nil, bg=p.base01, attr=nil, sp=nil})
488
+ hi('CursorLineFold', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil})
489
+ hi('CursorLineNr', {fg=p.base04, bg=p.base01, attr=nil, sp=nil})
490
+ hi('CursorLineSign', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
491
+ hi('DiffAdd', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil})
492
+ -- Differs from base16-vim, but according to general style guide
493
+ hi('DiffChange', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil})
494
+ hi('DiffDelete', {fg=p.base08, bg=p.base01, attr=nil, sp=nil})
495
+ hi('DiffText', {fg=p.base0D, bg=p.base01, attr=nil, sp=nil})
496
+ hi('DiffTextAdd', {link='DiffAdd'})
497
+ hi('Directory', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
498
+ hi('EndOfBuffer', {fg=p.base03, bg=nil, attr=nil, sp=nil})
499
+ hi('ErrorMsg', {fg=p.base08, bg=nil, attr=nil, sp=nil})
500
+ hi('FloatBorder', {link='NormalFloat'})
501
+ hi('FoldColumn', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil})
502
+ hi('Folded', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
503
+ hi('IncSearch', {fg=p.base01, bg=p.base09, attr=nil, sp=nil})
504
+ hi('lCursor', {fg=p.base00, bg=p.base05, attr=nil, sp=nil})
505
+ hi('LineNr', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
506
+ hi('LineNrAbove', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
507
+ hi('LineNrBelow', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
508
+ -- Slight difference from base16, where `bg=base03` is used. This makes
509
+ -- it possible to comfortably see this highlighting in comments.
510
+ hi('MatchParen', {fg=nil, bg=p.base02, attr=nil, sp=nil})
511
+ hi('ModeMsg', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
512
+ hi('MoreMsg', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
513
+ hi('MsgArea', {link='Normal'})
514
+ hi('MsgSeparator', {fg=p.base02, bg=p.base02, attr=nil, sp=nil})
515
+ hi('NonText', {fg=p.base03, bg=nil, attr=nil, sp=nil})
516
+ hi('Normal', {fg=p.base05, bg=p.base00, attr=nil, sp=nil})
517
+ hi('NormalFloat', {fg=p.base05, bg=p.base01, attr=nil, sp=nil})
518
+ hi('NormalNC', {fg=p.base05, bg=p.base00, attr=nil, sp=nil})
519
+ hi('OkMsg', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
520
+ hi('Pmenu', {fg=p.base05, bg=p.base01, attr=nil, sp=nil})
521
+ hi('PmenuExtra', {link='Pmenu'})
522
+ hi('PmenuExtraSel', {link='PmenuSel'})
523
+ hi('PmenuKind', {link='Pmenu'})
524
+ hi('PmenuKindSel', {link='PmenuSel'})
525
+ hi('PmenuMatch', {fg=p.base05, bg=nil, attr='bold', sp=nil})
526
+ hi('PmenuMatchSel', {fg=p.base05, bg=nil, attr='bold,reverse', sp=nil})
527
+ hi('PmenuSbar', {fg=nil, bg=p.base02, attr=nil, sp=nil})
528
+ hi('PmenuSel', {fg=p.base05, bg=p.base01, attr='reverse', sp=nil})
529
+ hi('PmenuThumb', {fg=nil, bg=p.base07, attr=nil, sp=nil})
530
+ hi('Question', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
531
+ hi('QuickFixLine', {fg=nil, bg=p.base01, attr=nil, sp=nil})
532
+ hi('Search', {fg=p.base01, bg=p.base0A, attr=nil, sp=nil})
533
+ hi('SignColumn', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
534
+ hi('SpecialKey', {fg=p.base03, bg=nil, attr=nil, sp=nil})
535
+ hi('SpellBad', {fg=nil, bg=nil, attr='undercurl', sp=p.base08})
536
+ hi('SpellCap', {fg=nil, bg=nil, attr='undercurl', sp=p.base0D})
537
+ hi('SpellLocal', {fg=nil, bg=nil, attr='undercurl', sp=p.base0C})
538
+ hi('SpellRare', {fg=nil, bg=nil, attr='undercurl', sp=p.base0E})
539
+ hi('StatusLine', {fg=p.base04, bg=p.base02, attr=nil, sp=nil})
540
+ hi('StatusLineNC', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
541
+ hi('StderrMsg', {link='ErrorMsg'})
542
+ hi('StdoutMsg', {link='MsgArea'})
543
+ hi('Substitute', {fg=p.base01, bg=p.base0A, attr=nil, sp=nil})
544
+ hi('TabLine', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
545
+ hi('TabLineFill', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
546
+ hi('TabLineSel', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil})
547
+ hi('TermCursor', {fg=nil, bg=nil, attr='reverse', sp=nil})
548
+ hi('TermCursorNC', {fg=nil, bg=nil, attr='reverse', sp=nil})
549
+ hi('Title', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
550
+ hi('VertSplit', {fg=p.base02, bg=p.base02, attr=nil, sp=nil})
551
+ hi('Visual', {fg=nil, bg=p.base02, attr=nil, sp=nil})
552
+ hi('VisualNOS', {fg=p.base08, bg=nil, attr=nil, sp=nil})
553
+ hi('WarningMsg', {fg=p.base08, bg=nil, attr=nil, sp=nil})
554
+ hi('Whitespace', {fg=p.base03, bg=nil, attr=nil, sp=nil})
555
+ hi('WildMenu', {fg=p.base08, bg=p.base0A, attr=nil, sp=nil})
556
+ hi('WinBar', {fg=p.base04, bg=p.base02, attr=nil, sp=nil})
557
+ hi('WinBarNC', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
558
+ hi('WinSeparator', {fg=p.base02, bg=p.base02, attr=nil, sp=nil})
559
+
560
+ -- Standard syntax (affects treesitter)
561
+ hi('Boolean', {fg=p.base09, bg=nil, attr=nil, sp=nil})
562
+ hi('Character', {fg=p.base08, bg=nil, attr=nil, sp=nil})
563
+ hi('Comment', {fg=p.base03, bg=nil, attr=nil, sp=nil})
564
+ hi('Conditional', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
565
+ hi('Constant', {fg=p.base09, bg=nil, attr=nil, sp=nil})
566
+ hi('Debug', {fg=p.base08, bg=nil, attr=nil, sp=nil})
567
+ hi('Define', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
568
+ hi('Delimiter', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
569
+ hi('Error', {fg=p.base00, bg=p.base08, attr=nil, sp=nil})
570
+ hi('Exception', {fg=p.base08, bg=nil, attr=nil, sp=nil})
571
+ hi('Float', {fg=p.base09, bg=nil, attr=nil, sp=nil})
572
+ hi('Function', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
573
+ hi('Identifier', {fg=p.base08, bg=nil, attr=nil, sp=nil})
574
+ hi('Ignore', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
575
+ hi('Include', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
576
+ hi('Keyword', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
577
+ hi('Label', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
578
+ hi('Macro', {fg=p.base08, bg=nil, attr=nil, sp=nil})
579
+ hi('Number', {fg=p.base09, bg=nil, attr=nil, sp=nil})
580
+ hi('Operator', {fg=p.base05, bg=nil, attr=nil, sp=nil})
581
+ hi('PreCondit', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
582
+ hi('PreProc', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
583
+ hi('Repeat', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
584
+ hi('Special', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
585
+ hi('SpecialChar', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
586
+ hi('SpecialComment', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
587
+ hi('Statement', {fg=p.base08, bg=nil, attr=nil, sp=nil})
588
+ hi('StorageClass', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
589
+ hi('String', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
590
+ hi('Structure', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
591
+ hi('Tag', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
592
+ hi('Todo', {fg=p.base0A, bg=p.base01, attr=nil, sp=nil})
593
+ hi('Type', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
594
+ hi('Typedef', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
595
+
596
+ -- Other from 'base16-vim'
597
+ hi('Bold', {fg=nil, bg=nil, attr='bold', sp=nil})
598
+ hi('Italic', {fg=nil, bg=nil, attr='italic', sp=nil})
599
+ hi('TooLong', {fg=p.base08, bg=nil, attr=nil, sp=nil})
600
+ hi('Underlined', {fg=nil, bg=nil, attr='underline', sp=nil})
601
+
602
+ -- Patch diff
603
+ hi('diffAdded', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
604
+ hi('diffChanged', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
605
+ hi('diffFile', {fg=p.base09, bg=nil, attr=nil, sp=nil})
606
+ hi('diffLine', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
607
+ hi('diffRemoved', {fg=p.base08, bg=nil, attr=nil, sp=nil})
608
+ hi('Added', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
609
+ hi('Changed', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
610
+ hi('Removed', {fg=p.base08, bg=nil, attr=nil, sp=nil})
611
+
612
+ -- Git commit
613
+ hi('gitcommitBranch', {fg=p.base09, bg=nil, attr='bold', sp=nil})
614
+ hi('gitcommitComment', {link='Comment'})
615
+ hi('gitcommitDiscarded', {link='Comment'})
616
+ hi('gitcommitDiscardedFile', {fg=p.base08, bg=nil, attr='bold', sp=nil})
617
+ hi('gitcommitDiscardedType', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
618
+ hi('gitcommitHeader', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
619
+ hi('gitcommitOverflow', {fg=p.base08, bg=nil, attr=nil, sp=nil})
620
+ hi('gitcommitSelected', {link='Comment'})
621
+ hi('gitcommitSelectedFile', {fg=p.base0B, bg=nil, attr='bold', sp=nil})
622
+ hi('gitcommitSelectedType', {link='gitcommitDiscardedType'})
623
+ hi('gitcommitSummary', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
624
+ hi('gitcommitUnmergedFile', {link='gitcommitDiscardedFile'})
625
+ hi('gitcommitUnmergedType', {link='gitcommitDiscardedType'})
626
+ hi('gitcommitUntracked', {link='Comment'})
627
+ hi('gitcommitUntrackedFile', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
628
+
629
+ -- Built-in diagnostic
630
+ hi('DiagnosticError', {fg=p.base08, bg=nil, attr=nil, sp=nil})
631
+ hi('DiagnosticHint', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
632
+ hi('DiagnosticInfo', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
633
+ hi('DiagnosticOk', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
634
+ hi('DiagnosticWarn', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
635
+
636
+ hi('DiagnosticFloatingError', {fg=p.base08, bg=p.base01, attr=nil, sp=nil})
637
+ hi('DiagnosticFloatingHint', {fg=p.base0D, bg=p.base01, attr=nil, sp=nil})
638
+ hi('DiagnosticFloatingInfo', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil})
639
+ hi('DiagnosticFloatingOk', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil})
640
+ hi('DiagnosticFloatingWarn', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil})
641
+
642
+ hi('DiagnosticSignError', {link='DiagnosticFloatingError'})
643
+ hi('DiagnosticSignHint', {link='DiagnosticFloatingHint'})
644
+ hi('DiagnosticSignInfo', {link='DiagnosticFloatingInfo'})
645
+ hi('DiagnosticSignOk', {link='DiagnosticFloatingOk'})
646
+ hi('DiagnosticSignWarn', {link='DiagnosticFloatingWarn'})
647
+
648
+ hi('DiagnosticUnderlineError', {fg=nil, bg=nil, attr='underline', sp=p.base08})
649
+ hi('DiagnosticUnderlineHint', {fg=nil, bg=nil, attr='underline', sp=p.base0D})
650
+ hi('DiagnosticUnderlineInfo', {fg=nil, bg=nil, attr='underline', sp=p.base0C})
651
+ hi('DiagnosticUnderlineOk', {fg=nil, bg=nil, attr='underline', sp=p.base0B})
652
+ hi('DiagnosticUnderlineWarn', {fg=nil, bg=nil, attr='underline', sp=p.base0E})
653
+
654
+ -- Built-in LSP
655
+ hi('LspReferenceText', {fg=nil, bg=p.base02, attr=nil, sp=nil})
656
+ hi('LspReferenceRead', {link='LspReferenceText'})
657
+ hi('LspReferenceWrite', {link='LspReferenceText'})
658
+
659
+ hi('LspSignatureActiveParameter', {link='LspReferenceText'})
660
+
661
+ hi('LspCodeLens', {link='Comment'})
662
+ hi('LspCodeLensSeparator', {link='Comment'})
663
+
664
+ -- Built-in snippets
665
+ hi('SnippetTabstop', {link='Visual'})
666
+ hi('SnippetTabstopActive', {link='SnippetTabstop'})
667
+
668
+ -- Built-in markdown syntax
669
+ hi('markdownH1', {fg=p.base09, bg=nil, attr=nil, sp=nil})
670
+ hi('markdownH2', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
671
+ hi('markdownH3', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
672
+ hi('markdownH4', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
673
+ hi('markdownH5', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
674
+ hi('markdownH6', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
675
+
676
+ -- Tree-sitter
677
+ -- Sources:
678
+ -- - `:h treesitter-highlight-groups`
679
+ -- - https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights
680
+ -- Included only those differing from default links
681
+ hi('@keyword.return', {fg=p.base08, bg=nil, attr=nil, sp=nil})
682
+ hi('@symbol', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
683
+ hi('@variable', {fg=p.base05, bg=nil, attr=nil, sp=nil})
684
+
685
+ hi('@text.strong', {fg=nil, bg=nil, attr='bold', sp=nil})
686
+ hi('@text.emphasis', {fg=nil, bg=nil, attr='italic', sp=nil})
687
+ hi('@text.strike', {fg=nil, bg=nil, attr='strikethrough', sp=nil})
688
+ hi('@text.underline', {link='Underlined'})
689
+
690
+ -- Semantic tokens. Source: `:h lsp-semantic-highlight`.
691
+ -- Included only those differing from default links
692
+ hi('@lsp.type.variable', {fg=p.base05, bg=nil, attr=nil, sp=nil})
693
+ hi('@lsp.mod.deprecated', {fg=p.base08, bg=nil, attr=nil, sp=nil})
694
+
695
+ -- New tree-sitter groups
696
+ if vim.fn.has('nvim-0.10') == 1 then
697
+ -- Source: `:h treesitter-highlight-groups`
698
+ -- Included only those differing from default links
699
+ hi('@markup.strong', {link='@text.strong'})
700
+ hi('@markup.italic', {link='@text.emphasis'})
701
+ hi('@markup.strikethrough', {link='@text.strike'})
702
+ hi('@markup.underline', {link='@text.underline'})
703
+
704
+ hi('@markup.heading.1', {link='markdownH1'})
705
+ hi('@markup.heading.2', {link='markdownH2'})
706
+ hi('@markup.heading.3', {link='markdownH3'})
707
+ hi('@markup.heading.4', {link='markdownH4'})
708
+ hi('@markup.heading.5', {link='markdownH5'})
709
+ hi('@markup.heading.6', {link='markdownH6'})
710
+
711
+ hi('@string.special.vimdoc', {link='SpecialChar'})
712
+ hi('@variable.parameter.vimdoc', {fg=p.base09, bg=nil, attr=nil, sp=nil})
713
+ hi('@markup.heading.4.vimdoc', {link='Title'})
714
+ end
715
+
716
+ -- Plugins
717
+ -- nvim-mini/mini.nvim
718
+ -- TODO: Remove 'echasnovski/mini.nvim' fallback after September 2026
719
+ if H.has_integration('nvim-mini/mini.nvim') or H.has_integration('echasnovski/mini.nvim') then
720
+ hi('MiniAnimateCursor', {fg=nil, bg=nil, attr='reverse,nocombine', sp=nil})
721
+ hi('MiniAnimateNormalFloat', {link='NormalFloat'})
722
+
723
+ hi('MiniClueBorder', {link='FloatBorder'})
724
+ hi('MiniClueDescGroup', {link='DiagnosticFloatingWarn'})
725
+ hi('MiniClueDescSingle', {link='NormalFloat'})
726
+ hi('MiniClueNextKey', {link='DiagnosticFloatingHint'})
727
+ hi('MiniClueNextKeyWithPostkeys', {link='DiagnosticFloatingError'})
728
+ hi('MiniClueSeparator', {link='DiagnosticFloatingInfo'})
729
+ hi('MiniClueTitle', {fg=p.base0D, bg=p.base01, attr='bold', sp=nil})
730
+
731
+ hi('MiniCmdlinePeekBorder', {link='FloatBorder'})
732
+ hi('MiniCmdlinePeekLineNr', {link='DiagnosticSignWarn'})
733
+ hi('MiniCmdlinePeekNormal', {link='NormalFloat'})
734
+ hi('MiniCmdlinePeekSep', {link='SignColumn'})
735
+ hi('MiniCmdlinePeekSign', {link='DiagnosticSignHint'})
736
+ hi('MiniCmdlinePeekTitle', {fg=p.base0D, bg=p.base01, attr='bold', sp=nil})
737
+
738
+ hi('MiniCompletionActiveParameter', {link='LspSignatureActiveParameter'})
739
+ hi('MiniCompletionDeprecated', {link='DiagnosticDeprecated'})
740
+ hi('MiniCompletionInfoBorderOutdated', {link='DiagnosticFloatingWarn'})
741
+
742
+ hi('MiniCursorword', {fg=nil, bg=nil, attr='underline', sp=nil})
743
+ hi('MiniCursorwordCurrent', {fg=nil, bg=nil, attr='underline', sp=nil})
744
+
745
+ hi('MiniDepsChangeAdded', {link='diffAdded'})
746
+ hi('MiniDepsChangeRemoved', {link='diffRemoved'})
747
+ hi('MiniDepsHint', {link='DiagnosticHint'})
748
+ hi('MiniDepsInfo', {link='DiagnosticInfo'})
749
+ hi('MiniDepsMsgBreaking', {link='DiagnosticWarn'})
750
+ hi('MiniDepsPlaceholder', {link='Comment'})
751
+ hi('MiniDepsTitle', {link='Title'})
752
+ hi('MiniDepsTitleError', {link='DiffDelete'})
753
+ hi('MiniDepsTitleSame', {link='DiffText'})
754
+ hi('MiniDepsTitleUpdate', {link='DiffAdd'})
755
+
756
+ hi('MiniDiffSignAdd', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil})
757
+ hi('MiniDiffSignChange', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil})
758
+ hi('MiniDiffSignDelete', {fg=p.base08, bg=p.base01, attr=nil, sp=nil})
759
+ hi('MiniDiffOverAdd', {link='DiffAdd'})
760
+ hi('MiniDiffOverChange', {link='DiffText'})
761
+ hi('MiniDiffOverChangeBuf', {link='MiniDiffOverChange'})
762
+ hi('MiniDiffOverContext', {link='DiffChange'})
763
+ hi('MiniDiffOverContextBuf', {})
764
+ hi('MiniDiffOverDelete', {link='DiffDelete'})
765
+
766
+ hi('MiniFilesBorder', {link='FloatBorder'})
767
+ hi('MiniFilesBorderModified', {link='DiagnosticFloatingWarn'})
768
+ hi('MiniFilesCursorLine', {fg=nil, bg=p.base02, attr=nil, sp=nil})
769
+ hi('MiniFilesDirectory', {link='Directory'})
770
+ hi('MiniFilesFile', {fg=p.base05, bg=nil, attr=nil, sp=nil})
771
+ hi('MiniFilesNormal', {link='NormalFloat'})
772
+ hi('MiniFilesTitle', {fg=p.base0D, bg=p.base01, attr=nil, sp=nil})
773
+ hi('MiniFilesTitleFocused', {fg=p.base0D, bg=p.base01, attr='bold', sp=nil})
774
+
775
+ hi('MiniHipatternsFixme', {fg=p.base00, bg=p.base08, attr='bold', sp=nil})
776
+ hi('MiniHipatternsHack', {fg=p.base00, bg=p.base0E, attr='bold', sp=nil})
777
+ hi('MiniHipatternsNote', {fg=p.base00, bg=p.base0D, attr='bold', sp=nil})
778
+ hi('MiniHipatternsTodo', {fg=p.base00, bg=p.base0C, attr='bold', sp=nil})
779
+
780
+ hi('MiniIconsAzure', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
781
+ hi('MiniIconsBlue', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
782
+ hi('MiniIconsCyan', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
783
+ hi('MiniIconsGreen', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
784
+ hi('MiniIconsGrey', {fg=p.base07, bg=nil, attr=nil, sp=nil})
785
+ hi('MiniIconsOrange', {fg=p.base09, bg=nil, attr=nil, sp=nil})
786
+ hi('MiniIconsPurple', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
787
+ hi('MiniIconsRed', {fg=p.base08, bg=nil, attr=nil, sp=nil})
788
+ hi('MiniIconsYellow', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
789
+
790
+ hi('MiniIndentscopeSymbol', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
791
+ hi('MiniIndentscopeSymbolOff', {fg=p.base08, bg=nil, attr=nil, sp=nil})
792
+
793
+ hi('MiniInputAdded', {link='DiagnosticFloatingOk'})
794
+ hi('MiniInputBorder', {link='FloatBorder'})
795
+ hi('MiniInputCaret', {link='MiniInputPrompt'})
796
+ hi('MiniInputHide', {link='DiagnosticFloatingWarn'})
797
+ hi('MiniInputHint', {link='DiagnosticFloatingHint'})
798
+ hi('MiniInputNormal', {link='NormalFloat'})
799
+ hi('MiniInputPrompt', {link='DiagnosticFloatingInfo'})
800
+ hi('MiniInputSpecial', {link='DiagnosticFloatingWarn'})
801
+
802
+ hi('MiniJump', {link='SpellRare'})
803
+
804
+ hi('MiniJump2dDim', {link='Comment'})
805
+ hi('MiniJump2dSpot', {fg=p.base07, bg=p.base01, attr='bold,nocombine', sp=nil})
806
+ hi('MiniJump2dSpotAhead', {fg=p.base06, bg=p.base00, attr='nocombine', sp=nil})
807
+ hi('MiniJump2dSpotUnique', {link='MiniJump2dSpot'})
808
+
809
+ hi('MiniMapNormal', {fg=p.base05, bg=p.base01, attr=nil, sp=nil})
810
+ hi('MiniMapSymbolCount', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
811
+ hi('MiniMapSymbolLine', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
812
+ hi('MiniMapSymbolView', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
813
+
814
+ hi('MiniNotifyBorder', {link='FloatBorder'})
815
+ hi('MiniNotifyLspProgress', {link='MiniNotifyNormal'})
816
+ hi('MiniNotifyNormal', {link='NormalFloat'})
817
+ hi('MiniNotifyTitle', {link='FloatTitle'})
818
+
819
+ hi('MiniOperatorsExchangeFrom', {link='IncSearch'})
820
+
821
+ hi('MiniPickBorder', {link='FloatBorder'})
822
+ hi('MiniPickBorderBusy', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil})
823
+ hi('MiniPickBorderText', {fg=p.base0D, bg=p.base01, attr='bold', sp=nil})
824
+ hi('MiniPickCursor', {fg=nil, bg=nil, attr='nocombine', sp=nil, blend=100})
825
+ hi('MiniPickIconDirectory', {link='Directory'})
826
+ hi('MiniPickIconFile', {fg=p.base05, bg=nil, attr=nil, sp=nil})
827
+ hi('MiniPickHeader', {link='DiagnosticFloatingHint'})
828
+ hi('MiniPickMatchCurrent', {fg=nil, bg=p.base02, attr=nil, sp=nil})
829
+ hi('MiniPickMatchMarked', {fg=nil, bg=p.base03, attr=nil, sp=nil})
830
+ hi('MiniPickMatchRanges', {link='DiagnosticFloatingHint'})
831
+ hi('MiniPickNormal', {link='NormalFloat'})
832
+ hi('MiniPickPreviewLine', {fg=nil, bg=p.base02, attr=nil, sp=nil})
833
+ hi('MiniPickPreviewRegion', {link='IncSearch'})
834
+ hi('MiniPickPrompt', {link='MiniPickMatchRanges'})
835
+ hi('MiniPickPromptCaret' , {fg=p.base0B, bg=p.base01, attr=nil, sp=nil})
836
+ hi('MiniPickPromptPrefix', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil})
837
+
838
+ hi('MiniSnippetsCurrent', {fg=nil, bg=nil, attr='underdouble', sp=p.base0E})
839
+ hi('MiniSnippetsCurrentReplace', {fg=nil, bg=nil, attr='underdouble', sp=p.base08})
840
+ hi('MiniSnippetsFinal', {fg=nil, bg=nil, attr='underdouble', sp=p.base0B})
841
+ hi('MiniSnippetsUnvisited', {fg=nil, bg=nil, attr='underdouble', sp=p.base0D})
842
+ hi('MiniSnippetsVisited', {fg=nil, bg=nil, attr='underdouble', sp=p.base0C})
843
+
844
+ hi('MiniStarterCurrent', {link='MiniStarterItem'})
845
+ hi('MiniStarterFooter', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
846
+ hi('MiniStarterHeader', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
847
+ hi('MiniStarterInactive', {link='Comment'})
848
+ hi('MiniStarterItem', {fg=p.base05, bg=nil, attr=nil, sp=nil})
849
+ hi('MiniStarterItemBullet', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
850
+ hi('MiniStarterItemPrefix', {fg=p.base08, bg=nil, attr='bold', sp=nil})
851
+ hi('MiniStarterSection', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
852
+ hi('MiniStarterQuery', {fg=p.base0B, bg=nil, attr='bold', sp=nil})
853
+
854
+ hi('MiniStatuslineDevinfo', {fg=p.base04, bg=p.base02, attr=nil, sp=nil})
855
+ hi('MiniStatuslineFileinfo', {link='MiniStatuslineDevinfo'})
856
+ hi('MiniStatuslineFilename', {fg=p.base03, bg=p.base01, attr=nil, sp=nil})
857
+ hi('MiniStatuslineInactive', {link='StatusLineNC'})
858
+ hi('MiniStatuslineModeCommand', {fg=p.base00, bg=p.base08, attr='bold', sp=nil})
859
+ hi('MiniStatuslineModeInsert', {fg=p.base00, bg=p.base0D, attr='bold', sp=nil})
860
+ hi('MiniStatuslineModeNormal', {fg=p.base00, bg=p.base05, attr='bold', sp=nil})
861
+ hi('MiniStatuslineModeOther', {fg=p.base00, bg=p.base03, attr='bold', sp=nil})
862
+ hi('MiniStatuslineModeReplace', {fg=p.base00, bg=p.base0E, attr='bold', sp=nil})
863
+ hi('MiniStatuslineModeVisual', {fg=p.base00, bg=p.base0B, attr='bold', sp=nil})
864
+
865
+ hi('MiniSurround', {link='IncSearch'})
866
+
867
+ hi('MiniTablineCurrent', {fg=p.base05, bg=p.base02, attr='bold', sp=nil})
868
+ hi('MiniTablineFill', {link='Normal'})
869
+ hi('MiniTablineHidden', {fg=p.base04, bg=p.base01, attr=nil, sp=nil})
870
+ hi('MiniTablineModifiedCurrent', {fg=p.base02, bg=p.base05, attr='bold', sp=nil})
871
+ hi('MiniTablineModifiedHidden', {fg=p.base01, bg=p.base04, attr=nil, sp=nil})
872
+ hi('MiniTablineModifiedVisible', {fg=p.base02, bg=p.base04, attr='bold', sp=nil})
873
+ hi('MiniTablineTabpagesection', {fg=p.base01, bg=p.base0A, attr='bold', sp=nil})
874
+ hi('MiniTablineTrunc', {fg=p.base05, bg=p.base01, attr='bold', sp=nil})
875
+ hi('MiniTablineVisible', {fg=p.base05, bg=p.base01, attr='bold', sp=nil})
876
+
877
+ hi('MiniTestEmphasis', {fg=nil, bg=nil, attr='bold', sp=nil})
878
+ hi('MiniTestFail', {fg=p.base08, bg=nil, attr='bold', sp=nil})
879
+ hi('MiniTestPass', {fg=p.base0B, bg=nil, attr='bold', sp=nil})
880
+
881
+ hi('MiniTrailspace', {link='Error'})
882
+ end
883
+
884
+ if H.has_integration('akinsho/bufferline.nvim') then
885
+ hi('BufferLineBuffer', {fg=p.base04, bg=nil, attr=nil, sp=nil})
886
+ hi('BufferLineBufferSelected', {fg=p.base05, bg=nil, attr='bold', sp=nil})
887
+ hi('BufferLineBufferVisible', {fg=p.base05, bg=nil, attr=nil, sp=nil})
888
+ hi('BufferLineCloseButton', {link='BufferLineBackground'})
889
+ hi('BufferLineCloseButtonSelected', {link='BufferLineBufferSelected'})
890
+ hi('BufferLineCloseButtonVisible', {link='BufferLineBufferVisible'})
891
+ hi('BufferLineFill', {link='Normal'})
892
+ hi('BufferLineTab', {fg=p.base00, bg=p.base0A, attr=nil, sp=nil})
893
+ hi('BufferLineTabSelected', {fg=p.base00, bg=p.base0A, attr='bold', sp=nil})
894
+ end
895
+
896
+ if H.has_integration('anuvyklack/hydra.nvim') then
897
+ hi('HydraRed', {fg=p.base08, bg=nil, attr=nil, sp=nil})
898
+ hi('HydraBlue', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
899
+ hi('HydraAmaranth', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
900
+ hi('HydraTeal', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
901
+ hi('HydraPink', {fg=p.base09, bg=nil, attr=nil, sp=nil})
902
+ hi('HydraHint', {link='NormalFloat'})
903
+ end
904
+
905
+ if H.has_integration('DanilaMihailov/beacon.nvim') then
906
+ hi('Beacon', {fg=nil, bg=p.base07, attr=nil, sp=nil})
907
+ end
908
+
909
+ if H.has_integration('folke/lazy.nvim') then
910
+ hi('LazyButton', {fg=nil, bg=p.base01, attr=nil, sp=nil})
911
+ hi('LazyButtonActive', {fg=nil, bg=p.base02, attr=nil, sp=nil})
912
+ hi('LazyDimmed', {link='Comment'})
913
+ hi('LazyH1', {fg=nil, bg=p.base02, attr='bold', sp=nil})
914
+ end
915
+
916
+ if H.has_integration('folke/noice.nvim') then
917
+ hi('NoiceCmdlinePopupBorder', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
918
+ hi('NoiceConfirmBorder', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
919
+ end
920
+
921
+ -- folke/snacks.nvim
922
+ -- Everything works correctly out of the box
923
+
924
+ -- folke/trouble.nvim
925
+ if H.has_integration('folke/trouble.nvim') then
926
+ hi('TroubleCount', {fg=p.base0B, bg=nil, attr='bold', sp=nil})
927
+ hi('TroubleFoldIcon', {fg=p.base05, bg=nil, attr=nil, sp=nil})
928
+ hi('TroubleIndent', {fg=p.base02, bg=nil, attr=nil, sp=nil})
929
+ hi('TroubleLocation', {fg=p.base04, bg=nil, attr=nil, sp=nil})
930
+ hi('TroubleSignError', {link='DiagnosticError'})
931
+ hi('TroubleSignHint', {link='DiagnosticHint'})
932
+ hi('TroubleSignInformation', {link='DiagnosticInfo'})
933
+ hi('TroubleSignOther', {link='DiagnosticInfo'})
934
+ hi('TroubleSignWarning', {link='DiagnosticWarn'})
935
+ hi('TroubleText', {fg=p.base05, bg=nil, attr=nil, sp=nil})
936
+ hi('TroubleTextError', {link='TroubleText'})
937
+ hi('TroubleTextHint', {link='TroubleText'})
938
+ hi('TroubleTextInformation', {link='TroubleText'})
939
+ hi('TroubleTextWarning', {link='TroubleText'})
940
+ end
941
+
942
+ -- folke/todo-comments.nvim
943
+ -- Everything works correctly out of the box
944
+
945
+ if H.has_integration('folke/which-key.nvim') then
946
+ hi('WhichKey', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
947
+ hi('WhichKeyDesc', {fg=p.base05, bg=nil, attr=nil, sp=nil})
948
+ hi('WhichKeyFloat', {fg=p.base05, bg=p.base01, attr=nil, sp=nil})
949
+ hi('WhichKeyGroup', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
950
+ hi('WhichKeySeparator', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil})
951
+ hi('WhichKeyValue', {fg=p.base03, bg=nil, attr=nil, sp=nil})
952
+ end
953
+
954
+ if H.has_integration('ggandor/leap.nvim') then
955
+ hi('LeapMatch', {fg=p.base0E, bg=nil, attr='bold,nocombine,underline', sp=nil})
956
+ hi('LeapLabel', {fg=p.base08, bg=nil, attr='bold,nocombine', sp=nil})
957
+ hi('LeapLabelSelected', {fg=p.base09, bg=nil, attr='bold,nocombine', sp=nil})
958
+ hi('LeapBackdrop', {link='Comment'})
959
+ end
960
+
961
+ if H.has_integration('ggandor/lightspeed.nvim') then
962
+ hi('LightspeedLabel', {fg=p.base0E, bg=nil, attr='bold,underline', sp=nil})
963
+ hi('LightspeedLabelDistant', {fg=p.base0D, bg=nil, attr='bold,underline', sp=nil})
964
+ hi('LightspeedShortcut', {fg=p.base07, bg=nil, attr='bold', sp=nil})
965
+ hi('LightspeedMaskedChar', {fg=p.base04, bg=nil, attr=nil, sp=nil})
966
+ hi('LightspeedUnlabeledMatch', {fg=p.base05, bg=nil, attr='bold', sp=nil})
967
+ hi('LightspeedGreyWash', {link='Comment'})
968
+ hi('LightspeedUniqueChar', {link='LightspeedUnlabeledMatch'})
969
+ hi('LightspeedOneCharMatch', {link='LightspeedShortcut'})
970
+ hi('LightspeedPendingOpArea', {link='IncSearch'})
971
+ hi('LightspeedCursor', {link='Cursor'})
972
+ end
973
+
974
+ if H.has_integration('glepnir/dashboard-nvim') then
975
+ hi('DashboardCenter', {link='Delimiter'})
976
+ hi('DashboardFooter', {link='Title'})
977
+ hi('DashboardHeader', {link='Title'})
978
+ hi('DashboardShortCut', {link='WarningMsg'})
979
+ end
980
+
981
+ if H.has_integration('glepnir/lspsaga.nvim') then
982
+ hi('LspSagaCodeActionBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
983
+ hi('LspSagaCodeActionContent', {fg=p.base05, bg=nil, attr=nil, sp=nil})
984
+ hi('LspSagaCodeActionTitle', {fg=p.base0D, bg=nil, attr='bold', sp=nil})
985
+
986
+ hi('Definitions', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
987
+ hi('DefinitionsIcon', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
988
+ hi('FinderParam', {fg=p.base08, bg=nil, attr=nil, sp=nil})
989
+ hi('FinderVirtText', {fg=p.base09, bg=nil, attr=nil, sp=nil})
990
+ hi('LspSagaAutoPreview', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
991
+ hi('LspSagaFinderSelection', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
992
+ hi('LspSagaLspFinderBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
993
+ hi('References', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
994
+ hi('ReferencesIcon', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
995
+ hi('TargetFileName', {fg=p.base05, bg=nil, attr=nil, sp=nil})
996
+
997
+ hi('FinderSpinner', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
998
+ hi('FinderSpinnerBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
999
+ hi('FinderSpinnerTitle', {link='Title'})
1000
+
1001
+ hi('LspSagaDefPreviewBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1002
+
1003
+ hi('LspSagaHoverBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1004
+
1005
+ hi('LspSagaRenameBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1006
+
1007
+ hi('LspSagaDiagnosticBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1008
+ hi('LspSagaDiagnosticHeader', {link='Title'})
1009
+ hi('LspSagaDiagnosticSource', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1010
+
1011
+ hi('LspSagaBorderTitle', {link='Title'})
1012
+
1013
+ hi('LspSagaSignatureHelpBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1014
+
1015
+ hi('LSOutlinePreviewBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1016
+ hi('OutlineDetail', {fg=p.base03, bg=nil, attr=nil, sp=nil})
1017
+ hi('OutlineFoldPrefix', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1018
+ hi('OutlineIndentEvn', {fg=p.base04, bg=nil, attr=nil, sp=nil})
1019
+ hi('OutlineIndentOdd', {fg=p.base05, bg=nil, attr=nil, sp=nil})
1020
+ end
1021
+
1022
+ if H.has_integration('HiPhish/rainbow-delimiters.nvim') then
1023
+ hi('RainbowDelimiterBlue', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
1024
+ hi('RainbowDelimiterCyan', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
1025
+ hi('RainbowDelimiterGreen', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
1026
+ hi('RainbowDelimiterOrange', {fg=p.base09, bg=nil, attr=nil, sp=nil})
1027
+ hi('RainbowDelimiterRed', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1028
+ hi('RainbowDelimiterViolet', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1029
+ hi('RainbowDelimiterYellow', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
1030
+ end
1031
+
1032
+ if H.has_integration('hrsh7th/nvim-cmp') then
1033
+ hi('CmpItemAbbr', {fg=p.base05, bg=nil, attr=nil, sp=nil})
1034
+ hi('CmpItemAbbrDeprecated', {fg=p.base03, bg=nil, attr=nil, sp=nil})
1035
+ hi('CmpItemAbbrMatch', {fg=p.base0A, bg=nil, attr='bold', sp=nil})
1036
+ hi('CmpItemAbbrMatchFuzzy', {fg=p.base0A, bg=nil, attr='bold', sp=nil})
1037
+ hi('CmpItemKind', {fg=p.base0F, bg=p.base01, attr=nil, sp=nil})
1038
+ hi('CmpItemMenu', {fg=p.base05, bg=p.base01, attr=nil, sp=nil})
1039
+
1040
+ hi('CmpItemKindClass', {link='Type'})
1041
+ hi('CmpItemKindColor', {link='Special'})
1042
+ hi('CmpItemKindConstant', {link='Constant'})
1043
+ hi('CmpItemKindConstructor', {link='Type'})
1044
+ hi('CmpItemKindEnum', {link='Structure'})
1045
+ hi('CmpItemKindEnumMember', {link='Structure'})
1046
+ hi('CmpItemKindEvent', {link='Exception'})
1047
+ hi('CmpItemKindField', {link='Structure'})
1048
+ hi('CmpItemKindFile', {link='Tag'})
1049
+ hi('CmpItemKindFolder', {link='Directory'})
1050
+ hi('CmpItemKindFunction', {link='Function'})
1051
+ hi('CmpItemKindInterface', {link='Structure'})
1052
+ hi('CmpItemKindKeyword', {link='Keyword'})
1053
+ hi('CmpItemKindMethod', {link='Function'})
1054
+ hi('CmpItemKindModule', {link='Structure'})
1055
+ hi('CmpItemKindOperator', {link='Operator'})
1056
+ hi('CmpItemKindProperty', {link='Structure'})
1057
+ hi('CmpItemKindReference', {link='Tag'})
1058
+ hi('CmpItemKindSnippet', {link='Special'})
1059
+ hi('CmpItemKindStruct', {link='Structure'})
1060
+ hi('CmpItemKindText', {link='Statement'})
1061
+ hi('CmpItemKindTypeParameter', {link='Type'})
1062
+ hi('CmpItemKindUnit', {link='Special'})
1063
+ hi('CmpItemKindValue', {link='Identifier'})
1064
+ hi('CmpItemKindVariable', {link='Delimiter'})
1065
+ end
1066
+
1067
+ if H.has_integration('ibhagwan/fzf-lua') then
1068
+ hi('FzfLuaBufFlagAlt', {link='Special'})
1069
+ hi('FzfLuaBufFlagCur', {link='CursorLineNr'})
1070
+ hi('FzfLuaBufNr', {link='DiagnosticHint'})
1071
+ hi('FzfLuaHeaderBind', {link='DiagnosticWarn'})
1072
+ hi('FzfLuaHeaderText', {link='DiagnosticInfo'})
1073
+ hi('FzfLuaLiveSym', {link='DiagnosticHint'})
1074
+ hi('FzfLuaPathColNr', {link='DiagnosticHint'})
1075
+ hi('FzfLuaPathLineNr', {link='DiagnosticInfo'})
1076
+ hi('FzfLuaTabMarker', {link='DiagnosticHint'})
1077
+ hi('FzfLuaTabTitle', {link='Title'})
1078
+ hi('FzfLuaTitle', {link='FloatTitle'})
1079
+ end
1080
+
1081
+ if H.has_integration('justinmk/vim-sneak') then
1082
+ hi('Sneak', {fg=p.base00, bg=p.base0E, attr=nil, sp=nil})
1083
+ hi('SneakScope', {fg=p.base00, bg=p.base07, attr=nil, sp=nil})
1084
+ hi('SneakLabel', {fg=p.base00, bg=p.base0E, attr='bold', sp=nil})
1085
+ end
1086
+
1087
+ -- 'kevinhwang91/nvim-bqf'
1088
+ if H.has_integration('kevinhwang91/nvim-bqf') then
1089
+ hi('BqfPreviewFloat', {link='NormalFloat'})
1090
+ hi('BqfPreviewTitle', {fg=p.base0D, bg=p.base01, attr=nil, sp=nil})
1091
+ hi('BqfSign', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil})
1092
+ end
1093
+
1094
+ -- 'kevinhwang91/nvim-ufo'
1095
+ -- Everything works correctly out of the box
1096
+
1097
+ if H.has_integration('lewis6991/gitsigns.nvim') then
1098
+ hi('GitSignsAdd', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil})
1099
+ hi('GitSignsAddLn', {link='GitSignsAdd'})
1100
+ hi('GitSignsAddInline', {link='GitSignsAdd'})
1101
+
1102
+ hi('GitSignsChange', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil})
1103
+ hi('GitSignsChangeLn', {link='GitSignsChange'})
1104
+ hi('GitSignsChangeInline', {link='GitSignsChange'})
1105
+
1106
+ hi('GitSignsDelete', {fg=p.base08, bg=p.base01, attr=nil, sp=nil})
1107
+ hi('GitSignsDeleteLn', {link='GitSignsDelete'})
1108
+ hi('GitSignsDeleteInline', {link='GitSignsDelete'})
1109
+
1110
+ hi('GitSignsUntracked', {fg=p.base0D, bg=p.base01, attr=nil, sp=nil})
1111
+ hi('GitSignsUntrackedLn', {link='GitSignsUntracked'})
1112
+ hi('GitSignsUntrackedInline', {link='GitSignsUntracked'})
1113
+ end
1114
+
1115
+ if H.has_integration('lukas-reineke/indent-blankline.nvim') then
1116
+ hi('IndentBlanklineChar', {fg=p.base02, bg=nil, attr='nocombine', sp=nil})
1117
+ hi('IndentBlanklineContextChar', {fg=p.base0F, bg=nil, attr='nocombine', sp=nil})
1118
+ hi('IndentBlanklineContextStart', {fg=nil, bg=nil, attr='underline,nocombine', sp=p.base0F})
1119
+ hi('IndentBlanklineIndent1', {fg=p.base08, bg=nil, attr='nocombine', sp=nil})
1120
+ hi('IndentBlanklineIndent2', {fg=p.base09, bg=nil, attr='nocombine', sp=nil})
1121
+ hi('IndentBlanklineIndent3', {fg=p.base0A, bg=nil, attr='nocombine', sp=nil})
1122
+ hi('IndentBlanklineIndent4', {fg=p.base0B, bg=nil, attr='nocombine', sp=nil})
1123
+ hi('IndentBlanklineIndent5', {fg=p.base0C, bg=nil, attr='nocombine', sp=nil})
1124
+ hi('IndentBlanklineIndent6', {fg=p.base0D, bg=nil, attr='nocombine', sp=nil})
1125
+ hi('IndentBlanklineIndent7', {fg=p.base0E, bg=nil, attr='nocombine', sp=nil})
1126
+ hi('IndentBlanklineIndent8', {fg=p.base0F, bg=nil, attr='nocombine', sp=nil})
1127
+ end
1128
+
1129
+ if H.has_integration('MeanderingProgrammer/render-markdown.nvim') then
1130
+ hi('RenderMarkdownBullet', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1131
+ hi('RenderMarkdownChecked', {link='DiagnosticOk'})
1132
+ hi('RenderMarkdownCode', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1133
+ hi('RenderMarkdownCodeInline', {link='Normal'})
1134
+ hi('RenderMarkdownDash', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1135
+ hi('RenderMarkdownH1', {fg=p.base09, bg=nil, attr=nil, sp=nil})
1136
+ hi('RenderMarkdownH1Bg', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1137
+ hi('RenderMarkdownH2', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
1138
+ hi('RenderMarkdownH2Bg', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1139
+ hi('RenderMarkdownH3', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
1140
+ hi('RenderMarkdownH3Bg', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1141
+ hi('RenderMarkdownH4', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
1142
+ hi('RenderMarkdownH4Bg', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1143
+ hi('RenderMarkdownH5', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
1144
+ hi('RenderMarkdownH5Bg', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1145
+ hi('RenderMarkdownH6', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1146
+ hi('RenderMarkdownH6Bg', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1147
+ hi('RenderMarkdownTodo', {link='Todo'})
1148
+ hi('RenderMarkdownUnchecked', {link='DiagnosticWarn'})
1149
+ end
1150
+
1151
+ if H.has_integration('neoclide/coc.nvim') then
1152
+ hi('CocCodeLens', {link='LspCodeLens'})
1153
+ hi('CocDisabled', {link='Comment'})
1154
+ hi('CocFadeOut', {link='Comment'})
1155
+ hi('CocMarkdownLink', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1156
+ hi('CocMenuSel', {fg=nil, bg=p.base02, attr=nil, sp=nil})
1157
+ hi('CocNotificationProgress', {link='CocMarkdownLink'})
1158
+ hi('CocPumVirtualText', {link='CocMarkdownLink'})
1159
+ hi('CocSearch', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
1160
+ hi('CocSelectedText', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1161
+ end
1162
+
1163
+ -- NeogitOrg/neogit
1164
+ if H.has_integration('NeogitOrg/neogit') then
1165
+ hi('NeogitCommitViewHeader', {link='Special'})
1166
+ hi('NeogitDiffAddHighlight', {link='DiffAdd'})
1167
+ hi('NeogitDiffAdd', {link='DiffAdd'})
1168
+ hi('NeogitDiffDeleteHighlight', {link='DiffDelete'})
1169
+ hi('NeogitDiffDelete', {link='DiffDelete'})
1170
+ hi('NeogitFold', {link='FoldColumn'})
1171
+ hi('NeogitHunkHeader', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
1172
+ hi('NeogitHunkHeaderHighlight', {fg=p.base0D, bg=nil, attr='bold', sp=nil})
1173
+ hi('NeogitNotificationError', {link='DiagnosticError'})
1174
+ hi('NeogitNotificationInfo', {link='DiagnosticInfo'})
1175
+ hi('NeogitNotificationWarning', {link='DiagnosticWarn'})
1176
+ end
1177
+
1178
+ -- nvim-lualine/lualine.nvim
1179
+ -- Everything works correctly out of the box
1180
+
1181
+ if H.has_integration('nvim-neo-tree/neo-tree.nvim') then
1182
+ hi('NeoTreeDimText', {fg=p.base03, bg=nil, attr=nil, sp=nil})
1183
+ hi('NeoTreeDotfile', {fg=p.base04, bg=nil, attr=nil, sp=nil})
1184
+ hi('NeoTreeFadeText1', {link='NeoTreeDimText'})
1185
+ hi('NeoTreeFadeText2', {fg=p.base02, bg=nil, attr=nil, sp=nil})
1186
+ hi('NeoTreeGitAdded', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
1187
+ hi('NeoTreeGitConflict', {fg=p.base08, bg=nil, attr='bold', sp=nil})
1188
+ hi('NeoTreeGitDeleted', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1189
+ hi('NeoTreeGitModified', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1190
+ hi('NeoTreeGitUnstaged', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1191
+ hi('NeoTreeGitUntracked', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
1192
+ hi('NeoTreeMessage', {fg=p.base05, bg=p.base01, attr=nil, sp=nil})
1193
+ hi('NeoTreeModified', {fg=p.base07, bg=nil, attr=nil, sp=nil})
1194
+ hi('NeoTreeRootName', {fg=p.base0D, bg=nil, attr='bold', sp=nil})
1195
+ hi('NeoTreeTabInactive', {fg=p.base04, bg=nil, attr=nil, sp=nil})
1196
+ hi('NeoTreeTabSeparatorActive', {fg=p.base03, bg=p.base02, attr=nil, sp=nil})
1197
+ hi('NeoTreeTabSeparatorInactive', {fg=p.base01, bg=p.base01, attr=nil, sp=nil})
1198
+ end
1199
+
1200
+ if H.has_integration('nvim-telescope/telescope.nvim') then
1201
+ hi('TelescopeBorder', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1202
+ hi('TelescopeMatching', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
1203
+ hi('TelescopeMultiSelection', {fg=nil, bg=p.base01, attr='bold', sp=nil})
1204
+ hi('TelescopeSelection', {fg=nil, bg=p.base01, attr='bold', sp=nil})
1205
+ end
1206
+
1207
+ if H.has_integration('nvim-tree/nvim-tree.lua') then
1208
+ hi('NvimTreeExecFile', {fg=p.base0B, bg=nil, attr='bold', sp=nil})
1209
+ hi('NvimTreeFolderIcon', {fg=p.base03, bg=nil, attr=nil, sp=nil})
1210
+ hi('NvimTreeGitDeleted', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1211
+ hi('NvimTreeGitDirty', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1212
+ hi('NvimTreeGitMerge', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
1213
+ hi('NvimTreeGitNew', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
1214
+ hi('NvimTreeGitRenamed', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1215
+ hi('NvimTreeGitStaged', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
1216
+ hi('NvimTreeImageFile', {fg=p.base0E, bg=nil, attr='bold', sp=nil})
1217
+ hi('NvimTreeIndentMarker', {link='NvimTreeFolderIcon'})
1218
+ hi('NvimTreeOpenedFile', {link='NvimTreeExecFile'})
1219
+ hi('NvimTreeRootFolder', {link='NvimTreeGitRenamed'})
1220
+ hi('NvimTreeSpecialFile', {fg=p.base0D, bg=nil, attr='bold,underline', sp=nil})
1221
+ hi('NvimTreeSymlink', {fg=p.base0F, bg=nil, attr='bold', sp=nil})
1222
+ hi('NvimTreeWindowPicker', {fg=p.base05, bg=p.base01, attr="bold", sp=nil})
1223
+ end
1224
+
1225
+ if H.has_integration('OXY2DEV/helpview.nvim') then
1226
+ hi('HelpviewHeading1', {link='markdownH1'})
1227
+ hi('HelpviewHeading2', {link='markdownH2'})
1228
+ hi('HelpviewHeading3', {link='markdownH3'})
1229
+ hi('HelpviewHeading4', {link='markdownH4'})
1230
+ hi('HelpviewMentionlink', {fg=nil, bg=nil, attr='underline', sp=nil})
1231
+ hi('HelpviewOptionlink', {fg=p.base0D, bg=nil, attr='underline', sp=nil})
1232
+ hi('HelpviewTaglink', {fg=p.base0A, bg=nil, attr='bold', sp=nil})
1233
+ hi('HelpviewTitle', {link='Title'})
1234
+ end
1235
+
1236
+ if H.has_integration('OXY2DEV/markview.nvim') then
1237
+ hi('MarkviewPalette0', {fg=p.base0E, bg=p.base00, attr=nil, sp=nil})
1238
+ hi('MarkviewPalette0Fg', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1239
+ hi('MarkviewPalette0Bg', {fg=nil, bg=p.base00, attr=nil, sp=nil})
1240
+ hi('MarkviewPalette0Sign', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1241
+ hi('MarkviewPalette1', {fg=p.base08, bg=p.base00, attr=nil, sp=nil})
1242
+ hi('MarkviewPalette1Fg', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1243
+ hi('MarkviewPalette1Bg', {fg=nil, bg=p.base00, attr=nil, sp=nil})
1244
+ hi('MarkviewPalette1Sign', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1245
+ hi('MarkviewPalette2', {fg=p.base09, bg=p.base00, attr=nil, sp=nil})
1246
+ hi('MarkviewPalette2Fg', {fg=p.base09, bg=nil, attr=nil, sp=nil})
1247
+ hi('MarkviewPalette2Bg', {fg=nil, bg=p.base00, attr=nil, sp=nil})
1248
+ hi('MarkviewPalette2Sign', {fg=p.base09, bg=nil, attr=nil, sp=nil})
1249
+ hi('MarkviewPalette3', {fg=p.base0A, bg=p.base00, attr=nil, sp=nil})
1250
+ hi('MarkviewPalette3Fg', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
1251
+ hi('MarkviewPalette3Bg', {fg=nil, bg=p.base00, attr=nil, sp=nil})
1252
+ hi('MarkviewPalette3Sign', {fg=p.base0A, bg=nil, attr=nil, sp=nil})
1253
+ hi('MarkviewPalette4', {fg=p.base0B, bg=p.base00, attr=nil, sp=nil})
1254
+ hi('MarkviewPalette4Fg', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
1255
+ hi('MarkviewPalette4Bg', {fg=nil, bg=p.base00, attr=nil, sp=nil})
1256
+ hi('MarkviewPalette4Sign', {fg=p.base0B, bg=nil, attr=nil, sp=nil})
1257
+ hi('MarkviewPalette5', {fg=p.base0C, bg=p.base00, attr=nil, sp=nil})
1258
+ hi('MarkviewPalette5Fg', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
1259
+ hi('MarkviewPalette5Bg', {fg=nil, bg=p.base00, attr=nil, sp=nil})
1260
+ hi('MarkviewPalette5Sign', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
1261
+ hi('MarkviewPalette6', {fg=p.base0D, bg=p.base00, attr=nil, sp=nil})
1262
+ hi('MarkviewPalette6Fg', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
1263
+ hi('MarkviewPalette6Bg', {fg=nil, bg=p.base00, attr=nil, sp=nil})
1264
+ hi('MarkviewPalette6Sign', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
1265
+ hi('MarkviewPalette7', {fg=p.base0F, bg=p.base00, attr=nil, sp=nil})
1266
+ hi('MarkviewPalette7Fg', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1267
+ hi('MarkviewPalette7Bg', {fg=nil, bg=p.base00, attr=nil, sp=nil})
1268
+ hi('MarkviewPalette7Sign', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1269
+ end
1270
+
1271
+ if H.has_integration('phaazon/hop.nvim') then
1272
+ hi('HopNextKey', {fg=p.base0E, bg=nil, attr='bold,nocombine', sp=nil})
1273
+ hi('HopNextKey1', {fg=p.base08, bg=nil, attr='bold,nocombine', sp=nil})
1274
+ hi('HopNextKey2', {fg=p.base04, bg=nil, attr='bold,nocombine', sp=nil})
1275
+ hi('HopPreview', {fg=p.base09, bg=nil, attr='bold,nocombine', sp=nil})
1276
+ hi('HopUnmatched', {link='Comment'})
1277
+ end
1278
+
1279
+ if H.has_integration('rcarriga/nvim-dap-ui') then
1280
+ hi('DapUIScope', {link='Title'})
1281
+ hi('DapUIType', {link='Type'})
1282
+ hi('DapUIModifiedValue', {fg=p.base0E, bg=nil, attr='bold', sp=nil})
1283
+ hi('DapUIDecoration', {link='Title'})
1284
+ hi('DapUIThread', {link='String'})
1285
+ hi('DapUIStoppedThread', {link='Title'})
1286
+ hi('DapUISource', {link='Directory'})
1287
+ hi('DapUILineNumber', {link='Title'})
1288
+ hi('DapUIFloatBorder', {link='SpecialChar'})
1289
+ hi('DapUIWatchesEmpty', {link='ErrorMsg'})
1290
+ hi('DapUIWatchesValue', {link='String'})
1291
+ hi('DapUIWatchesError', {link='DiagnosticError'})
1292
+ hi('DapUIBreakpointsPath', {link='Directory'})
1293
+ hi('DapUIBreakpointsInfo', {link='DiagnosticInfo'})
1294
+ hi('DapUIBreakpointsCurrentLine', {fg=p.base0B, bg=nil, attr='bold', sp=nil})
1295
+ hi('DapUIBreakpointsDisabledLine', {link='Comment'})
1296
+ end
1297
+
1298
+ if H.has_integration('rcarriga/nvim-notify') then
1299
+ hi('NotifyDEBUGBorder', {fg=p.base03, bg=nil, attr=nil, sp=nil})
1300
+ hi('NotifyDEBUGIcon', {link='NotifyDEBUGBorder'})
1301
+ hi('NotifyDEBUGTitle', {link='NotifyDEBUGBorder'})
1302
+ hi('NotifyERRORBorder', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1303
+ hi('NotifyERRORIcon', {link='NotifyERRORBorder'})
1304
+ hi('NotifyERRORTitle', {link='NotifyERRORBorder'})
1305
+ hi('NotifyINFOBorder', {fg=p.base0C, bg=nil, attr=nil, sp=nil})
1306
+ hi('NotifyINFOIcon', {link='NotifyINFOBorder'})
1307
+ hi('NotifyINFOTitle', {link='NotifyINFOBorder'})
1308
+ hi('NotifyTRACEBorder', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
1309
+ hi('NotifyTRACEIcon', {link='NotifyTRACEBorder'})
1310
+ hi('NotifyTRACETitle', {link='NotifyTRACEBorder'})
1311
+ hi('NotifyWARNBorder', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
1312
+ hi('NotifyWARNIcon', {link='NotifyWARNBorder'})
1313
+ hi('NotifyWARNTitle', {link='NotifyWARNBorder'})
1314
+ end
1315
+
1316
+ if H.has_integration('rlane/pounce.nvim') then
1317
+ hi('PounceMatch', {fg=p.base00, bg=p.base05, attr='bold,nocombine', sp=nil})
1318
+ hi('PounceGap', {fg=p.base00, bg=p.base03, attr='bold,nocombine', sp=nil})
1319
+ hi('PounceAccept', {fg=p.base00, bg=p.base08, attr='bold,nocombine', sp=nil})
1320
+ hi('PounceAcceptBest', {fg=p.base00, bg=p.base0B, attr='bold,nocombine', sp=nil})
1321
+ end
1322
+
1323
+ if H.has_integration('romgrk/barbar.nvim') then
1324
+ hi('BufferCurrent', {fg=p.base05, bg=p.base02, attr='bold', sp=nil})
1325
+ hi('BufferCurrentIcon', {fg=nil, bg=p.base02, attr=nil, sp=nil})
1326
+ hi('BufferCurrentIndex', {link='BufferCurrentIcon'})
1327
+ hi('BufferCurrentMod', {fg=p.base08, bg=p.base02, attr='bold', sp=nil})
1328
+ hi('BufferCurrentSign', {link='BufferCurrent'})
1329
+ hi('BufferCurrentTarget', {fg=p.base0E, bg=p.base02, attr='bold', sp=nil})
1330
+
1331
+ hi('BufferInactive', {fg=p.base04, bg=p.base01, attr=nil, sp=nil})
1332
+ hi('BufferInactiveIcon', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1333
+ hi('BufferInactiveIndex', {link='BufferInactiveIcon'})
1334
+ hi('BufferInactiveMod', {fg=p.base08, bg=p.base01, attr=nil, sp=nil})
1335
+ hi('BufferInactiveSign', {link='BufferInactive'})
1336
+ hi('BufferInactiveTarget', {fg=p.base0E, bg=p.base01, attr='bold', sp=nil})
1337
+
1338
+ hi('BufferOffset', {link='Normal'})
1339
+ hi('BufferTabpages', {fg=p.base01, bg=p.base0A, attr='bold', sp=nil})
1340
+ hi('BufferTabpageFill', {link='Normal'})
1341
+
1342
+ hi('BufferVisible', {fg=p.base05, bg=p.base01, attr='bold', sp=nil})
1343
+ hi('BufferVisibleIcon', {fg=nil, bg=p.base01, attr=nil, sp=nil})
1344
+ hi('BufferVisibleIndex', {link='BufferVisibleIcon'})
1345
+ hi('BufferVisibleMod', {fg=p.base08, bg=p.base01, attr='bold', sp=nil})
1346
+ hi('BufferVisibleSign', {link='BufferVisible'})
1347
+ hi('BufferVisibleTarget', {fg=p.base0E, bg=p.base01, attr='bold', sp=nil})
1348
+ end
1349
+
1350
+ if H.has_integration('saghen/blink.cmp') then
1351
+ hi('BlinkCmpLabelDeprecated', {fg=p.base03, bg=nil, attr=nil, sp=nil})
1352
+ hi('BlinkCmpLabelMatch', {fg=p.base0A, bg=nil, attr='bold', sp=nil})
1353
+
1354
+ hi('BlinkCmpKindClass', {link='Type'})
1355
+ hi('BlinkCmpKindColor', {link='Special'})
1356
+ hi('BlinkCmpKindConstant', {link='Constant'})
1357
+ hi('BlinkCmpKindConstructor', {link='Type'})
1358
+ hi('BlinkCmpKindEnum', {link='Structure'})
1359
+ hi('BlinkCmpKindEnumMember', {link='Structure'})
1360
+ hi('BlinkCmpKindEvent', {link='Exception'})
1361
+ hi('BlinkCmpKindField', {link='Structure'})
1362
+ hi('BlinkCmpKindFile', {link='Tag'})
1363
+ hi('BlinkCmpKindFolder', {link='Directory'})
1364
+ hi('BlinkCmpKindFunction', {link='Function'})
1365
+ hi('BlinkCmpKindInterface', {link='Structure'})
1366
+ hi('BlinkCmpKindKeyword', {link='Keyword'})
1367
+ hi('BlinkCmpKindMethod', {link='Function'})
1368
+ hi('BlinkCmpKindModule', {link='Structure'})
1369
+ hi('BlinkCmpKindOperator', {link='Operator'})
1370
+ hi('BlinkCmpKindProperty', {link='Structure'})
1371
+ hi('BlinkCmpKindReference', {link='Tag'})
1372
+ hi('BlinkCmpKindSnippet', {link='Special'})
1373
+ hi('BlinkCmpKindStruct', {link='Structure'})
1374
+ hi('BlinkCmpKindText', {link='Statement'})
1375
+ hi('BlinkCmpKindTypeParameter', {link='Type'})
1376
+ hi('BlinkCmpKindUnit', {link='Special'})
1377
+ hi('BlinkCmpKindValue', {link='Identifier'})
1378
+ hi('BlinkCmpKindVariable', {link='Delimiter'})
1379
+ end
1380
+
1381
+ -- stevearc/aerial.nvim
1382
+ -- Everything works correctly out of the box
1383
+
1384
+ if H.has_integration('williamboman/mason.nvim') then
1385
+ hi('MasonError', {fg=p.base08, bg=nil, attr=nil, sp=nil})
1386
+ hi('MasonHeader', {fg=p.base00, bg=p.base0D, attr='bold', sp=nil})
1387
+ hi('MasonHeaderSecondary', {fg=p.base00, bg=p.base0F, attr='bold', sp=nil})
1388
+ hi('MasonHeading', {link='Bold'})
1389
+ hi('MasonHighlight', {fg=p.base0F, bg=nil, attr=nil, sp=nil})
1390
+ hi('MasonHighlightBlock', {fg=p.base00, bg=p.base0F, attr=nil, sp=nil})
1391
+ hi('MasonHighlightBlockBold', {link='MasonHeaderSecondary'})
1392
+ hi('MasonHighlightBlockBoldSecondary', {link='MasonHeader'})
1393
+ hi('MasonHighlightBlockSecondary', {fg=p.base00, bg=p.base0D, attr=nil, sp=nil})
1394
+ hi('MasonHighlightSecondary', {fg=p.base0D, bg=nil, attr=nil, sp=nil})
1395
+ hi('MasonLink', {link='MasonHighlight'})
1396
+ hi('MasonMuted', {link='Comment'})
1397
+ hi('MasonMutedBlock', {fg=p.base00, bg=p.base03, attr=nil, sp=nil})
1398
+ hi('MasonMutedBlockBold', {fg=p.base00, bg=p.base03, attr='bold', sp=nil})
1399
+ end
1400
+ -- stylua: ignore end
1401
+
1402
+ -- Terminal colors
1403
+ vim.g.terminal_color_0 = palette.base00
1404
+ vim.g.terminal_color_1 = palette.base08
1405
+ vim.g.terminal_color_2 = palette.base0B
1406
+ vim.g.terminal_color_3 = palette.base0A
1407
+ vim.g.terminal_color_4 = palette.base0D
1408
+ vim.g.terminal_color_5 = palette.base0E
1409
+ vim.g.terminal_color_6 = palette.base0C
1410
+ vim.g.terminal_color_7 = palette.base05
1411
+ vim.g.terminal_color_8 = palette.base03
1412
+ vim.g.terminal_color_9 = palette.base08
1413
+ vim.g.terminal_color_10 = palette.base0B
1414
+ vim.g.terminal_color_11 = palette.base0A
1415
+ vim.g.terminal_color_12 = palette.base0D
1416
+ vim.g.terminal_color_13 = palette.base0E
1417
+ vim.g.terminal_color_14 = palette.base0C
1418
+ vim.g.terminal_color_15 = palette.base07
1419
+ end
1420
+
1421
+ H.has_integration = function(name)
1422
+ local entry = MiniBase16.config.plugins[name]
1423
+ if entry == nil then return MiniBase16.config.plugins.default end
1424
+ return entry
1425
+ end
1426
+
1427
+ H.highlight_gui = function(group, args)
1428
+ -- NOTE: using `string.format` instead of gradually growing string with `..`
1429
+ -- is faster. Crude estimate for this particular case: whole colorscheme
1430
+ -- loading decreased from ~3.6ms to ~3.0ms, i.e. by about 20%.
1431
+ local command
1432
+ if args.link ~= nil then
1433
+ command = string.format('highlight! link %s %s', group, args.link)
1434
+ else
1435
+ command = string.format(
1436
+ 'highlight %s guifg=%s guibg=%s gui=%s guisp=%s blend=%s',
1437
+ group,
1438
+ args.fg or 'NONE',
1439
+ args.bg or 'NONE',
1440
+ args.attr or 'NONE',
1441
+ args.sp or 'NONE',
1442
+ args.blend or 'NONE'
1443
+ )
1444
+ end
1445
+ vim.cmd(command)
1446
+ end
1447
+
1448
+ H.highlight_both = function(group, args)
1449
+ local command
1450
+ if args.link ~= nil then
1451
+ command = string.format('highlight! link %s %s', group, args.link)
1452
+ else
1453
+ command = string.format(
1454
+ 'highlight %s guifg=%s ctermfg=%s guibg=%s ctermbg=%s gui=%s cterm=%s guisp=%s blend=%s',
1455
+ group,
1456
+ args.fg and args.fg.gui or 'NONE',
1457
+ args.fg and args.fg.cterm or 'NONE',
1458
+ args.bg and args.bg.gui or 'NONE',
1459
+ args.bg and args.bg.cterm or 'NONE',
1460
+ args.attr or 'NONE',
1461
+ args.attr or 'NONE',
1462
+ args.sp and args.sp.gui or 'NONE',
1463
+ args.blend or 'NONE'
1464
+ )
1465
+ end
1466
+ vim.cmd(command)
1467
+ end
1468
+
1469
+ -- Compound (gui and cterm) palette -------------------------------------------
1470
+ H.make_compound_palette = function(palette, use_cterm)
1471
+ local cterm_table = use_cterm
1472
+ if type(use_cterm) == 'boolean' then cterm_table = MiniBase16.rgb_palette_to_cterm_palette(palette) end
1473
+
1474
+ local res = {}
1475
+ for name, _ in pairs(palette) do
1476
+ res[name] = { gui = palette[name], cterm = cterm_table[name] }
1477
+ end
1478
+ return res
1479
+ end
1480
+
1481
+ -- Optimal scales. Make a set of equally spaced hues which are as different to
1482
+ -- present hues as possible
1483
+ H.make_different_hues = function(present_hues, n)
1484
+ local max_offset = math.floor(360 / n + 0.5)
1485
+
1486
+ local dist, best_dist = nil, -math.huge
1487
+ local best_hues, new_hues
1488
+
1489
+ for offset = 0, max_offset - 1, 1 do
1490
+ new_hues = H.make_hue_scale(n, offset)
1491
+
1492
+ -- Compute distance as usual 'minimum distance' between two sets
1493
+ dist = H.dist_circle_set(new_hues, present_hues)
1494
+
1495
+ -- Decide if it is the best
1496
+ if dist > best_dist then
1497
+ best_hues, best_dist = new_hues, dist
1498
+ end
1499
+ end
1500
+
1501
+ return best_hues
1502
+ end
1503
+
1504
+ H.make_hue_scale = function(n, offset)
1505
+ local step = math.floor(360 / n + 0.5)
1506
+ local res = {}
1507
+ for i = 0, n - 1, 1 do
1508
+ table.insert(res, (offset + i * step) % 360)
1509
+ end
1510
+ return res
1511
+ end
1512
+
1513
+ -- Terminal colors ------------------------------------------------------------
1514
+ -- Sources:
1515
+ -- - https://github.com/shawncplus/Vim-toCterm/blob/master/lib/Xterm.php
1516
+ -- - https://gist.github.com/MicahElliott/719710
1517
+ -- stylua: ignore start
1518
+ H.cterm_first16 = {
1519
+ { r = 0, g = 0, b = 0 },
1520
+ { r = 205, g = 0, b = 0 },
1521
+ { r = 0, g = 205, b = 0 },
1522
+ { r = 205, g = 205, b = 0 },
1523
+ { r = 0, g = 0, b = 238 },
1524
+ { r = 205, g = 0, b = 205 },
1525
+ { r = 0, g = 205, b = 205 },
1526
+ { r = 229, g = 229, b = 229 },
1527
+ { r = 127, g = 127, b = 127 },
1528
+ { r = 255, g = 0, b = 0 },
1529
+ { r = 0, g = 255, b = 0 },
1530
+ { r = 255, g = 255, b = 0 },
1531
+ { r = 92, g = 92, b = 255 },
1532
+ { r = 255, g = 0, b = 255 },
1533
+ { r = 0, g = 255, b = 255 },
1534
+ { r = 255, g = 255, b = 255 },
1535
+ }
1536
+ -- stylua: ignore end
1537
+
1538
+ H.cterm_basis = { 0, 95, 135, 175, 215, 255 }
1539
+
1540
+ H.cterm2rgb = function(i)
1541
+ if i < 16 then return H.cterm_first16[i + 1] end
1542
+ if 16 <= i and i <= 231 then
1543
+ i = i - 16
1544
+ local r = H.cterm_basis[math.floor(i / 36) % 6 + 1]
1545
+ local g = H.cterm_basis[math.floor(i / 6) % 6 + 1]
1546
+ local b = H.cterm_basis[i % 6 + 1]
1547
+ return { r = r, g = g, b = b }
1548
+ end
1549
+ if 232 <= i and i <= 255 then
1550
+ local c = 8 + (i - 232) * 10
1551
+ return { r = c, g = c, b = c }
1552
+ end
1553
+ end
1554
+
1555
+ H.ensure_cterm_palette = function()
1556
+ if H.cterm_palette then return end
1557
+ H.cterm_palette = {}
1558
+ for i = 0, 255 do
1559
+ H.cterm_palette[i] = H.cterm2rgb(i)
1560
+ end
1561
+ end
1562
+
1563
+ -- Color conversion -----------------------------------------------------------
1564
+ -- Source: https://www.easyrgb.com/en/math.php
1565
+ -- Accuracy is usually around 2-3 decimal digits, which should be fine
1566
+
1567
+ -- HEX <-> CIELCh(uv)
1568
+ H.hex2lch = function(hex)
1569
+ local res = hex
1570
+ for _, f in pairs({ H.hex2rgb, H.rgb2xyz, H.xyz2luv, H.luv2lch }) do
1571
+ res = f(res)
1572
+ end
1573
+ return res
1574
+ end
1575
+
1576
+ H.lch2hex = function(lch)
1577
+ local res = lch
1578
+ for _, f in pairs({ H.lch2luv, H.luv2xyz, H.xyz2rgb, H.rgb2hex }) do
1579
+ res = f(res)
1580
+ end
1581
+ return res
1582
+ end
1583
+
1584
+ -- HEX <-> RGB
1585
+ H.hex2rgb = function(hex)
1586
+ local dec = tonumber(hex:sub(2), 16)
1587
+
1588
+ local b = math.fmod(dec, 256)
1589
+ local g = math.fmod((dec - b) / 256, 256)
1590
+ local r = math.floor(dec / 65536)
1591
+
1592
+ return { r = r, g = g, b = b }
1593
+ end
1594
+
1595
+ H.rgb2hex = function(rgb)
1596
+ -- Round and trim values
1597
+ local t = vim.tbl_map(function(x)
1598
+ x = math.min(math.max(x, 0), 255)
1599
+ return math.floor(x + 0.5)
1600
+ end, rgb)
1601
+
1602
+ return '#' .. string.format('%02x', t.r) .. string.format('%02x', t.g) .. string.format('%02x', t.b)
1603
+ end
1604
+
1605
+ -- RGB <-> XYZ
1606
+ H.rgb2xyz = function(rgb)
1607
+ local t = vim.tbl_map(function(c)
1608
+ c = c / 255
1609
+ if c > 0.04045 then
1610
+ c = ((c + 0.055) / 1.055) ^ 2.4
1611
+ else
1612
+ c = c / 12.92
1613
+ end
1614
+ return 100 * c
1615
+ end, rgb)
1616
+
1617
+ -- Source of better matrix: http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
1618
+ local x = 0.41246 * t.r + 0.35757 * t.g + 0.18043 * t.b
1619
+ local y = 0.21267 * t.r + 0.71515 * t.g + 0.07217 * t.b
1620
+ local z = 0.01933 * t.r + 0.11919 * t.g + 0.95030 * t.b
1621
+ return { x = x, y = y, z = z }
1622
+ end
1623
+
1624
+ H.xyz2rgb = function(xyz)
1625
+ -- Source of better matrix: http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
1626
+ -- stylua: ignore start
1627
+ local r = 3.24045 * xyz.x - 1.53713 * xyz.y - 0.49853 * xyz.z
1628
+ local g = -0.96927 * xyz.x + 1.87601 * xyz.y + 0.04155 * xyz.z
1629
+ local b = 0.05564 * xyz.x - 0.20403 * xyz.y + 1.05722 * xyz.z
1630
+ -- stylua: ignore end
1631
+
1632
+ return vim.tbl_map(function(c)
1633
+ c = c / 100
1634
+ if c > 0.0031308 then
1635
+ c = 1.055 * (c ^ (1 / 2.4)) - 0.055
1636
+ else
1637
+ c = 12.92 * c
1638
+ end
1639
+ return 255 * c
1640
+ end, {
1641
+ r = r,
1642
+ g = g,
1643
+ b = b,
1644
+ })
1645
+ end
1646
+
1647
+ -- XYZ <-> CIELuv
1648
+ -- Using white reference for D65 and 2 degrees
1649
+ H.ref_u = (4 * 95.047) / (95.047 + (15 * 100) + (3 * 108.883))
1650
+ H.ref_v = (9 * 100) / (95.047 + (15 * 100) + (3 * 108.883))
1651
+
1652
+ H.xyz2luv = function(xyz)
1653
+ local x, y, z = xyz.x, xyz.y, xyz.z
1654
+ if x + y + z == 0 then return { l = 0, u = 0, v = 0 } end
1655
+
1656
+ local var_u = 4 * x / (x + 15 * y + 3 * z)
1657
+ local var_v = 9 * y / (x + 15 * y + 3 * z)
1658
+ local var_y = y / 100
1659
+ if var_y > 0.008856 then
1660
+ var_y = var_y ^ (1 / 3)
1661
+ else
1662
+ var_y = (7.787 * var_y) + (16 / 116)
1663
+ end
1664
+
1665
+ local l = (116 * var_y) - 16
1666
+ local u = 13 * l * (var_u - H.ref_u)
1667
+ local v = 13 * l * (var_v - H.ref_v)
1668
+ return { l = l, u = u, v = v }
1669
+ end
1670
+
1671
+ H.luv2xyz = function(luv)
1672
+ if luv.l == 0 then return { x = 0, y = 0, z = 0 } end
1673
+
1674
+ local var_y = (luv.l + 16) / 116
1675
+ if var_y ^ 3 > 0.008856 then
1676
+ var_y = var_y ^ 3
1677
+ else
1678
+ var_y = (var_y - 16 / 116) / 7.787
1679
+ end
1680
+
1681
+ local var_u = luv.u / (13 * luv.l) + H.ref_u
1682
+ local var_v = luv.v / (13 * luv.l) + H.ref_v
1683
+
1684
+ local y = var_y * 100
1685
+ local x = -(9 * y * var_u) / ((var_u - 4) * var_v - var_u * var_v)
1686
+ local z = (9 * y - 15 * var_v * y - var_v * x) / (3 * var_v)
1687
+ return { x = x, y = y, z = z }
1688
+ end
1689
+
1690
+ -- CIELuv <-> CIELCh(uv)
1691
+ H.tau = 2 * math.pi
1692
+
1693
+ H.luv2lch = function(luv)
1694
+ local c = math.sqrt(luv.u ^ 2 + luv.v ^ 2)
1695
+ local h
1696
+ if c == 0 then
1697
+ h = 0
1698
+ else
1699
+ -- Convert [-pi, pi] radians to [0, 360] degrees
1700
+ h = (math.atan2(luv.v, luv.u) % H.tau) * 360 / H.tau
1701
+ end
1702
+ return { l = luv.l, c = c, h = h }
1703
+ end
1704
+
1705
+ H.lch2luv = function(lch)
1706
+ local angle = lch.h * H.tau / 360
1707
+ local u = lch.c * math.cos(angle)
1708
+ local v = lch.c * math.sin(angle)
1709
+ return { l = lch.l, u = u, v = v }
1710
+ end
1711
+
1712
+ -- Distances ------------------------------------------------------------------
1713
+ H.dist_circle = function(x, y)
1714
+ local d = math.abs(x - y) % 360
1715
+ return d > 180 and (360 - d) or d
1716
+ end
1717
+
1718
+ H.dist_circle_set = function(set1, set2)
1719
+ -- Minimum distance between all pairs
1720
+ local dist = math.huge
1721
+ local d
1722
+ for _, x in pairs(set1) do
1723
+ for _, y in pairs(set2) do
1724
+ d = H.dist_circle(x, y)
1725
+ if dist > d then dist = d end
1726
+ end
1727
+ end
1728
+ return dist
1729
+ end
1730
+
1731
+ H.nearest_rgb_id = function(rgb_target, rgb_palette)
1732
+ local best_dist = math.huge
1733
+ local best_id, dist
1734
+ for id, rgb in pairs(rgb_palette) do
1735
+ dist = math.abs(rgb_target.r - rgb.r) + math.abs(rgb_target.g - rgb.g) + math.abs(rgb_target.b - rgb.b)
1736
+ if dist < best_dist then
1737
+ best_id, best_dist = id, dist
1738
+ end
1739
+ end
1740
+
1741
+ return best_id
1742
+ end
1743
+
1744
+ -- Utilities ------------------------------------------------------------------
1745
+ H.error = function(msg) error('(mini.base16) ' .. msg, 0) end
1746
+
1747
+ H.check_type = function(name, val, ref, allow_nil)
1748
+ if type(val) == ref or (ref == 'callable' and vim.is_callable(val)) or (allow_nil and val == nil) then return end
1749
+ H.error(string.format('`%s` should be %s, not %s', name, ref, type(val)))
1750
+ end
1751
+
1752
+ return MiniBase16