|
| 1 | +{ |
| 2 | + empty = { |
| 3 | + plugins.colorful-menu.enable = true; |
| 4 | + }; |
| 5 | + |
| 6 | + defaults = { |
| 7 | + plugins.colorful-menu = { |
| 8 | + enable = true; |
| 9 | + |
| 10 | + settings = { |
| 11 | + ls = { |
| 12 | + lua_ls = { |
| 13 | + arguments_hl = "@comment"; |
| 14 | + }; |
| 15 | + gopls = { |
| 16 | + add_colon_before_type = false; |
| 17 | + align_type_to_right = true; |
| 18 | + preserve_type_when_truncate = true; |
| 19 | + }; |
| 20 | + ts_ls = { |
| 21 | + extra_info_hl = "@comment"; |
| 22 | + }; |
| 23 | + vtsls = { |
| 24 | + extra_info_hl = "@comment"; |
| 25 | + }; |
| 26 | + zls = { |
| 27 | + align_type_to_right = true; |
| 28 | + }; |
| 29 | + rust-analyzer = { |
| 30 | + extra_info_hl = "@comment"; |
| 31 | + align_type_to_right = true; |
| 32 | + preserve_type_when_truncate = true; |
| 33 | + }; |
| 34 | + clangd = { |
| 35 | + extra_info_hl = "@comment"; |
| 36 | + import_dot_hl = "@comment"; |
| 37 | + align_type_to_right = true; |
| 38 | + preserve_type_when_truncate = true; |
| 39 | + }; |
| 40 | + roslyn = { |
| 41 | + extra_info_hl = "@comment"; |
| 42 | + }; |
| 43 | + basedpyright = { |
| 44 | + extra_info_hl = "@comment"; |
| 45 | + }; |
| 46 | + dartls = { |
| 47 | + extra_info_hl = "@comment"; |
| 48 | + }; |
| 49 | + fallback = true; |
| 50 | + fallback_extra_info_hl = "@comment"; |
| 51 | + }; |
| 52 | + fallback_highlight = "@variable"; |
| 53 | + max_width = 60; |
| 54 | + }; |
| 55 | + }; |
| 56 | + }; |
| 57 | + |
| 58 | + withCmp = { |
| 59 | + plugins = { |
| 60 | + colorful-menu.enable = true; |
| 61 | + |
| 62 | + cmp = { |
| 63 | + enable = true; |
| 64 | + settings.formatting.format.__raw = '' |
| 65 | + function(entry, vim_item) |
| 66 | + local highlights_info = require("colorful-menu").cmp_highlights(entry) |
| 67 | +
|
| 68 | + -- highlight_info is nil means we are missing the ts parser, it's |
| 69 | + -- better to fallback to use default `vim_item.abbr`. What this plugin |
| 70 | + -- offers is two fields: `vim_item.abbr_hl_group` and `vim_item.abbr`. |
| 71 | + if highlights_info ~= nil then |
| 72 | + vim_item.abbr_hl_group = highlights_info.highlights |
| 73 | + vim_item.abbr = highlights_info.text |
| 74 | + end |
| 75 | +
|
| 76 | + return vim_item |
| 77 | + end |
| 78 | + ''; |
| 79 | + }; |
| 80 | + }; |
| 81 | + }; |
| 82 | + |
| 83 | + example = { |
| 84 | + plugins.colorful-menu = { |
| 85 | + enable = true; |
| 86 | + |
| 87 | + settings = { |
| 88 | + ls = { |
| 89 | + lua_ls.arguments_hl = "@comment"; |
| 90 | + pyright.extra_info_hl = "@comment"; |
| 91 | + fallback = true; |
| 92 | + }; |
| 93 | + fallback_highlight = "@variable"; |
| 94 | + max_width = 60; |
| 95 | + }; |
| 96 | + }; |
| 97 | + }; |
| 98 | +} |
0 commit comments