Skip to content

Commit 78a027a

Browse files
committed
Updated bracket, cmp and cornelis highlights
1 parent 586ac99 commit 78a027a

File tree

6 files changed

+72
-63
lines changed

6 files changed

+72
-63
lines changed

.screenshots/cmp.jpg

139 KB
Loading

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Screenshots taken with different pywal themes.
1313

1414
### Catpuccin (frappe)
1515

16+
![cmp.lua](.screenshots/cmp.jpg)
1617
![init.lua](.screenshots/colorlua.jpg)
1718

1819
### Apprentice
@@ -42,6 +43,36 @@ return {
4243
}
4344
```
4445

46+
### nvim-cmp configuration
47+
48+
In order to configure cmp to look as in the screenshots, install the
49+
[lspkind](https://github.com/onsails/lspkind.nvim) and add the following
50+
code to your cmp configuration table:
51+
52+
```lua
53+
cmp.setup({
54+
-- ... (other stuff) ...
55+
window = {
56+
completion = {
57+
col_offset = -3,
58+
side_padding = 0,
59+
},
60+
},
61+
formatting = {
62+
fields = { "kind", "abbr", "menu" },
63+
format = function(entry, vim_item)
64+
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
65+
local strings = vim.split(kind.kind, "%s", { trimempty = true })
66+
kind.kind = " " .. (strings[1] or "") .. " "
67+
kind.menu = " (" .. (strings[2] or "") .. ")"
68+
69+
return kind
70+
end,
71+
},
72+
-- ... (other stuff) ...
73+
})
74+
```
75+
4576
## API Quickstart
4677

4778
```lua
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
local M = {}
22

33
M.setup = function(set_hl, get_hl, colors)
4+
set_hl("PMenu", { link = "NormalFloat" })
45
set_hl("CmpGhostText", { fg = colors.bright_black })
5-
set_hl("CmpItemAbbrDeprecated", { strikethrough = true, fg = colors.bright_black, bg = "NONE" })
66

7+
set_hl("CmpItemAbbrDeprecated", { strikethrough = true, bg = colors.bright_black })
78
set_hl("CmpItemAbbrMatch", { fg = colors.blue, bg = "NONE" })
89
set_hl("CmpItemAbbrMatchFuzzy", { fg = colors.blue, bg = "NONE" })
910

10-
set_hl("CmpItemKindVariable", { fg = colors.cyan, bg = "NONE" })
11-
set_hl("CmpItemKindInterface", { fg = colors.cyan, bg = "NONE" })
12-
set_hl("CmpItemKindText", { fg = colors.cyan, bg = "NONE" })
11+
set_hl("CmpItemMenu", { fg = colors.green, italic = true })
1312

14-
set_hl("CmpItemKindFunction", { fg = colors.magenta, bg = "NONE" })
15-
set_hl("CmpItemKindMethod", { fg = colors.magenta, bg = "NONE" })
13+
set_hl("CmpItemKindVariable", { bg = colors.cyan:darkened(0.3) })
14+
set_hl("CmpItemKindInterface", { bg = colors.cyan:darkened(0.3) })
15+
set_hl("CmpItemKindText", { bg = colors.green:darkened(0.2) })
1616

17-
set_hl("CmpItemKindKeyword", { fg = colors.foreground, bg = "NONE" })
18-
set_hl("CmpItemKindProperty", { fg = colors.foreground, bg = "NONE" })
19-
set_hl("CmpItemKindUnit", { fg = colors.foreground, bg = "NONE" })
17+
set_hl("CmpItemKindFunction", { bg = colors.magenta:darkened(0.2) })
18+
set_hl("CmpItemKindMethod", { bg = colors.magenta:darkened(0.2) })
19+
20+
set_hl("CmpItemKindKeyword", { bg = colors.green:darkened(0.1) })
21+
set_hl("CmpItemKindProperty", { bg = colors.cyan:darkened(0.3) })
22+
set_hl("CmpItemKindUnit", { fg = colors.foreground })
23+
24+
set_hl("CmpItemKindSnippet", { bg = colors.green:darkened(0.3) })
25+
set_hl("CmpItemKindCopilot", { bg = colors.red:mixed_hsv(colors.blue):desaturated(0.3):darkened(0.3) })
26+
set_hl("CmpItemKindCodeium", { bg = colors.red:mixed_hsv(colors.blue):desaturated(0.3):darkened(0.3) })
2027
end
2128

2229
return M

lua/wal-colors/colorschemes/mbc-colorscheme/cornelis.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ M.setup = function(set_hl, get_hl, colors)
3333

3434
-- Primitives
3535
set_hl("CornelisPragma", { link = "@macro" })
36-
set_hl("CornelisPostulate", { link = "@keyword" })
36+
set_hl("CornelisPostulate", { link = "@type.abstract" })
3737
set_hl("CornelisPrimitive", { link = "@constant.builtin" })
3838
set_hl("CornelisPrimitiveType", { link = "@type.builtin" })
3939

lua/wal-colors/colorschemes/mbc-colorscheme/init.lua

+9-9
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ M.highlights_base = function(colors)
5353
set_hl("CursorLine", { bg = colors.background:lightened(0.1) })
5454
set_hl("CursorColumn", { bg = colors.background })
5555
set_hl("ColorColumn", { bg = colors.background })
56-
set_hl("NormalFloat", { bg = colors.background:darkened(0.1) })
56+
set_hl("NormalFloat", { bg = colors.background:darkened(0.15) })
5757
set_hl("NormalInactive", { bg = colors.background:lightened(0.1) })
5858
set_hl("Visual", { bg = colors.color1, fg = colors.foreground })
5959
set_hl("VisualNOS", { bg = colors.background })
@@ -64,7 +64,7 @@ M.highlights_base = function(colors)
6464
set_hl("QuickFixLine", { bg = colors.color2 })
6565
set_hl("PmenuSbar", { bg = colors.background })
6666
set_hl("PmenuThumb", { bg = colors.color2 })
67-
set_hl("MatchParen", { fg = colors.color4, bg = colors.background })
67+
set_hl("MatchParen", { fg = colors.background, bg = colors.yellow:desaturated(0.2):lightened(0.2) })
6868
set_hl("Cursor", { fg = colors.foreground, bg = colors.cursor })
6969
set_hl("lCursor", { fg = colors.foreground, bg = colors.cursor })
7070
set_hl("CursorIM", { fg = colors.foreground, bg = colors.cursor })
@@ -130,13 +130,13 @@ M.highlights_base = function(colors)
130130
set_hl("illuminatedCurWord", { bg = colors.foreground })
131131

132132
-- Rainbow brackets
133-
set_hl("rainbowcol1", { fg = colors.color1:darkened(0.3) })
134-
set_hl("rainbowcol2", { fg = colors.color2:darkened(0.3) })
135-
set_hl("rainbowcol3", { fg = colors.color3:darkened(0.3) })
136-
set_hl("rainbowcol4", { fg = colors.color4:darkened(0.3) })
137-
set_hl("rainbowcol5", { fg = colors.color5:darkened(0.3) })
138-
set_hl("rainbowcol6", { fg = colors.color6:darkened(0.3) })
139-
set_hl("rainbowcol7", { fg = colors.color1:lightened(0.3) })
133+
set_hl("rainbowcol1", { fg = colors.color1:saturated(0.2) })
134+
set_hl("rainbowcol2", { fg = colors.color2:saturated(0.2) })
135+
set_hl("rainbowcol3", { fg = colors.color3:saturated(0.2) })
136+
set_hl("rainbowcol4", { fg = colors.color4:saturated(0.2) })
137+
set_hl("rainbowcol5", { fg = colors.color5:saturated(0.2) })
138+
set_hl("rainbowcol6", { fg = colors.color6:saturated(0.2) })
139+
set_hl("rainbowcol7", { fg = colors.color1:darkened(0.2):saturated(0.2) })
140140

141141
-- diff
142142
set_hl("diffAdded", { fg = colors.color4 })

lua/wal-colors/colorschemes/mbc-colorscheme/treesitter.lua

+15-44
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,31 @@
11
local M = {}
22

33
M.setup = function(set_hl, get_hl, colors)
4-
-- treesitter
5-
6-
-- These groups are for the neovim tree-sitter highlights.
7-
-- As of writing, tree-sitter support is a WIP, group names may color5.
8-
-- By default, most of these groups link to an appropriate Vim group,
9-
-- @error -> Error for example, so you do not have to define these unless
10-
-- you explicitly want to support Treesitter's improved syntax awareness.
11-
12-
-- @annotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information.
13-
-- @attribute = { }; -- (unstable) TODO: docs
14-
-- @boolean = { }; -- For booleans.
15-
-- @character = { }; -- For characters.
16-
local var = 5
174
set_hl("@note", { fg = colors.background, bg = colors.color5 })
185

196
set_hl("@comment", { fg = colors.color8 })
207
set_hl("@comment.documentation", { fg = colors.color8:lightened(0.2), italic = true }) -- e.g. javadoc
218

229
set_hl("@warning", { fg = colors.background, bg = colors.color5 })
2310
set_hl("@danger", { fg = colors.background, bg = colors.color3 })
24-
set_hl("@constructor", { fg = colors.color6 }) -- For constructor calls and definitions: `= { }` in Lua, and Java constructors)
25-
set_hl("@conditional", { fg = colors.color2 }) -- For keywords related to conditionnals)
11+
set_hl("@constructor", { fg = colors.color6 }) -- For constructor calls and definitions: `= { }` in Lua, and Java constructors)
12+
set_hl("@conditional", { fg = colors.color2 }) -- For keywords related to conditionnals)
2613
set_hl("@constant", { fg = colors.color6:darkened(), bold = true })
27-
-- @constBuiltin = { }; -- For constant that are built in the language: `nil` in Lua.
28-
-- @constMacro = { }; -- For constants that are defined by macros: `NULL` in C.
29-
-- @error = { }; -- For syntax/parser errors.
30-
-- @exception = { }; -- For exception related keywords.
31-
set_hl("@field", { fg = colors.cyan:darkened() }) -- For fields
32-
set_hl("@function", { fg = colors.blue, bold = true }) -- For function (calls and definitions))
33-
-- @funcBuiltin = { }; -- For builtin functions: `table.insert` in Lua.
34-
-- @funcMacro = { }; -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust.
35-
-- @include = { }; -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua.
14+
set_hl("@field", { fg = colors.cyan:darkened() }) -- For fields
15+
set_hl("@function", { fg = colors.blue, bold = true }) -- For function (calls and definitions))
3616
set_hl("@keyword", { fg = colors.color2, bold = true }) -- For keywords that don't fall in previous categories.
3717
set_hl("@keyword.function", { fg = colors.color2:darkened(0.2), bold = true, italic = true }) -- For keywords used to define a fuction.
3818
set_hl("@label", { fg = colors.color7 }) -- For labels: `label:` in C and `:label:` in Lua.
3919
set_hl("@method", { fg = colors.cyan, bold = true }) -- For function (calls and definitions))
4020
set_hl("@namespace", { fg = colors.color6, bold = true }) -- For identifiers referring to modules and namespaces.
41-
-- @none = { };
4221
set_hl("@number", { fg = colors.red:lightened() }) -- For all numbers
4322
set_hl("@float", { fg = colors.red:mixed_hsv(colors.cyan) }) -- For all numbers
4423
set_hl("@operator", { fg = colors.color3 }) -- For any operator: `+`, but also `->` and `*` in C.
4524
set_hl("@operator", { fg = colors.color3, bold = true }) -- For keyword operators: `not`, but also `in` and `is` in Python.
4625
set_hl("@parameter", { fg = colors.blue }) -- For parameters of a function.
47-
-- @parameterReference= { }; -- For references to parameters of a function.
4826
set_hl("@property", { fg = colors.cyan:darkened() }) -- Same as `@field`.
49-
set_hl("@punctuation.delimiter", { fg = colors.color3:darkened(0.2) }) -- For delimiters ie: `.`
50-
set_hl("@punctuation.bracket", { fg = colors.foreground }) -- For brackets and parens.
27+
set_hl("@punctuation.delimiter", { fg = colors.yellow:darkened(0.2) }) -- For delimiters ie: `.`
28+
set_hl("@punctuation.bracket", { fg = colors.yellow:desaturated(0.2):lightened(0.2) }) -- For brackets and parens.
5129
set_hl("@punctuation.special", { fg = colors.color3 }) -- For special punctutation that does not fall in the catagories before.
5230
set_hl("@repeat", { fg = colors.color2 }) -- For keywords related to loops.
5331
set_hl("@string", { fg = colors.color1 }) -- For strings.
@@ -59,22 +37,15 @@ M.setup = function(set_hl, get_hl, colors)
5937
set_hl("@type.builtin", { fg = colors.color2:darkened() })
6038
set_hl("@variable", { fg = colors.blue:mixed_rgb(colors.cyan):desaturated() }) -- Variable names that are defined by the languages, like `this` or `self`.
6139
set_hl("@variable.builtin", { fg = colors.color11 }) -- Variable names that are defined by the languages, like `this` or `self`.
62-
63-
-- @tag = { }; -- Tags like html tag names.
64-
-- @tagDelimiter = { }; -- Tag delimiter like `<` `>` `/`
65-
66-
-- Text
67-
-- [x] Complete
68-
-- [ ] Assigned
69-
set_hl("@text", { fg = colors.foreground:darkened() }) -- For strings considered text in a markup language.
70-
set_hl("@text.emphasis", { italic = true }) -- For text to be represented strong.
71-
set_hl("@text.strong", { bold = true }) -- For text to be represented with emphasis.
72-
set_hl("@text.underline", { underline = true }) -- For text to be represented with an underline.
73-
set_hl("@text.strike", { strikethrough = true }) -- For strikethrough text.
74-
set_hl("@text.title", { bold = true }) -- Text that is part of a title.
75-
set_hl("@text.literal", nil) -- Literal text.
76-
set_hl("@text.uri", { fg = colors.color4:darkened(0.3), underline = true }) -- Any URI like a link or email.
77-
set_hl("@text.math", { fg = colors.color1 }) -- For latex math
40+
set_hl("@text", { fg = colors.foreground:darkened() }) -- For strings considered text in a markup language.
41+
set_hl("@text.emphasis", { italic = true }) -- For text to be represented strong.
42+
set_hl("@text.strong", { bold = true }) -- For text to be represented with emphasis.
43+
set_hl("@text.underline", { underline = true }) -- For text to be represented with an underline.
44+
set_hl("@text.strike", { strikethrough = true }) -- For strikethrough text.
45+
set_hl("@text.title", { bold = true }) -- Text that is part of a title.
46+
set_hl("@text.literal", nil) -- Literal text.
47+
set_hl("@text.uri", { fg = colors.color4:darkened(0.3), underline = true }) -- Any URI like a link or email.
48+
set_hl("@text.math", { fg = colors.color1 }) -- For latex math
7849
set_hl("@text.reference", { fg = colors.color8 })
7950
set_hl("@text.environment", { fg = colors.color6 })
8051
set_hl("@text.environment.name", { fg = colors.color6 })

0 commit comments

Comments
 (0)