forked from projekt0n/github-nvim-theme
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmappings.lua
100 lines (86 loc) · 3.65 KB
/
mappings.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
-- Map prettylights colors json to nvim highlight groups. These mappings can be
-- done at ci time, build time, or runtime.
local api = vim.api
---@class github-theme.prettylights.syntax
---@field comment "#6e7781"
---@field constant "#0550ae"
---@field entity "#8250df"
---@field storageModifierImport "#24292f"
---@field entityTag "#116329"
---@field keyword "#cf222e"
---@field string "#0a3069"
---@field variable "#953800"
---@field brackethighlighterUnmatched "#82071e"
---@field invalidIllegalText "#f6f8fa"
---@field invalidIllegalBg "#82071e"
---@field carriageReturnText "#f6f8fa"
---@field carriageReturnBg "#cf222e"
---@field stringRegexp "#116329"
---@field markupList "#3b2300"
---@field markupHeading "#0550ae"
---@field markupItalic "#24292f"
---@field markupBold "#24292f"
---@field markupDeletedText "#82071e"
---@field markupDeletedBg "#ffebe9"
---@field markupInsertedText "#116329"
---@field markupInsertedBg "#dafbe1"
---@field markupChangedText "#953800"
---@field markupChangedBg "#ffd8b5"
---@field markupIgnoredText "#eaeef2"
---@field markupIgnoredBg "#0550ae"
---@field metaDiffRange "#8250df"
---@field brackethighlighterAngle "#57606a"
---@field sublimelinterGutterMark "#8c959f"
---@field constantOtherReferenceLink "#0a3069"
---@type { prettylights: { syntax: github-theme.prettylights.syntax } }
local prim = require('github-theme.palette.primitives.dark')
-- TODO: Handle rgb*() colors
-- TODO: finish this
-- In theory this could be automated instead of filling it out by-hand...but
-- it would probably require alot of work (in particular, resolving the way
-- in which GitHub's colors are mapped to each syntax item per language). Just
-- fill in by-hand for now. These mappings should be the same across different
-- colorschemes/themes, although there may be slight differences across
-- languages that still need to be accounted for (TODO).
local map = {}
map.global = {
Comment = prim.prettylights.syntax.comment,
---Constant any constant
---String a string constant: "this is a string"
---Character a character constant: 'c', '\n'
---Number a number constant: 234, 0xff
---Boolean a boolean constant: TRUE, false
---Float a floating point constant: 2.3e10
Constant = prim.prettylights.syntax.constant,
-- Params. TODO: in nvim, @parameter normally links to Identifier.
-- Prettylights does not have an Identifier group, and its `variable`
-- color is yellowish in dimmed theme and isn't used to highlight actual
-- variables most of the time (rather variables often go un-highlighted;
-- i.e. they have the default foreground color). Should we keep @parameter
-- linked to Identifier and then change Identifier to be un-highlighted?
-- Or, leave Identifier as mapped to `variable` from prettylights, but
-- break the link from `@parmeter` (and `@variable`) to Identifier?
-- ['@parameter'] = 'storageModifierImport',
entityTag = '',
String = prim.prettylights.syntax.string,
--- `@variable` and `@parameter` link to this.
variable = 'Identifier', -- TODO
---For function and method names within function and method declarations.
--`@function` and `@method` link to this.
Function = prim.prettylights.syntax.entity,
---Statement any statement
---Links
---Conditional if, then, else, endif, switch, etc.
---Repeat for, do, while, etc.
---Label case, default, etc.
---Operator "sizeof", "+", "*", etc.
---Keyword any other keyword—@keyword links to this
---Exception try, catch, throw
Statement = prim.prettylights.syntax.keyword,
}
map.c = { Operator = '' }
map.cpp = map.c
local function domap(a, b, c)
for key, value in pairs(assert(prettylights.syntax)) do
end
end