-
-
Notifications
You must be signed in to change notification settings - Fork 302
Expand file tree
/
Copy pathhighlight.lua
More file actions
95 lines (87 loc) · 3.06 KB
/
highlight.lua
File metadata and controls
95 lines (87 loc) · 3.06 KB
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
local api = vim.api
local kind = require('lspsaga.lspkind').kind
local function hi_define()
return {
-- general
SagaPrefix = { link = 'Prefix' },
SagaTitle = { link = 'Title' },
SagaBorder = { link = 'FloatBorder' },
SagaNormal = { link = 'NormalFloat' },
SagaToggle = { link = 'Comment' },
SagaBeacon = { bg = '#c43963' },
SagaVirtLine = { fg = '#444a4d' },
SagaSpinnerTitle = { link = 'Statement' },
SagaSpinner = { link = 'Statement' },
SagaText = { link = 'Comment' },
SagaSelect = { link = 'String' },
SagaSearch = { link = 'Search' },
SagaFinderFname = { link = 'Function' },
SagaDetail = { link = 'Comment' },
SagaInCurrent = { link = 'KeyWord' },
SagaCount = { bg = 'gray', fg = 'white', bold = true },
SagaSep = { link = 'Comment' },
-- code action
ActionPreviewNormal = { link = 'SagaNormal' },
ActionPreviewBorder = { link = 'SagaBorder' },
ActionPreviewTitle = { link = 'Title' },
CodeActionText = { link = '@variable' },
CodeActionNumber = { link = 'DiffAdd' },
CodeActionCursorLine = { link = 'CursorLine' },
-- hover
HoverNormal = { link = 'SagaNormal' },
HoverBorder = { link = 'SagaBorder' },
-- rename
RenameBorder = { link = 'SagaBorder' },
RenameNormal = { link = 'Statement' },
RenameMatch = { link = 'Search' },
-- diagnostic
DiagnosticBorder = { link = 'SagaBorder' },
DiagnosticNormal = { link = 'SagaNormal' },
DiagnosticText = {},
DiagnosticShowNormal = { link = 'SagaNormal' },
DiagnosticShowBorder = { link = '@property' },
-- lightbulb
SagaLightBulb = { link = 'DiagnosticSignHint' },
-- Float term
TerminalBorder = { link = 'SagaBorder' },
TerminalNormal = { link = 'SagaNormal' },
-- Implement
SagaImpIcon = { link = 'PreProc' },
--Winbar
SagaWinbarSep = { link = 'Operator' },
SagaWinbarFileName = { link = 'SagaFileName' },
SagaWinbarFolderName = { link = 'SagaFolderName' },
SagaWinbarFolder = { link = 'SagaFolder' },
-- deprecated
SagaFileName = { link = 'Comment' },
SagaFolderName = { link = 'Comment' },
}
end
local function init_highlight()
for group, conf in pairs(hi_define()) do
api.nvim_set_hl(0, group, vim.tbl_extend('keep', conf, { default = true }))
end
for _, item in pairs(kind) do
api.nvim_set_hl(0, 'Saga' .. item[1], { link = item[3], default = true })
end
for _, v in ipairs(vim.diagnostic.severity) do
local color = api.nvim_get_hl(0, { name = 'Diagnostic' .. v })
if color.link then
color = api.nvim_get_hl(0, { name = color.link })
end
api.nvim_set_hl(0, 'Diagnostic' .. v .. 'Reverse', {
bg = color.fg,
fg = 'Black',
default = true,
})
end
local hint_conf = api.nvim_get_hl(0, { name = 'DiagnosticHint' })
if hint_conf.link then
hint_conf = api.nvim_get_hl(0, { name = hint_conf.link })
end
api.nvim_set_hl(0, 'SagaButton', { fg = hint_conf.fg })
api.nvim_set_hl(0, 'SagaActionTitle', { fg = 'Black', bg = hint_conf.fg })
end
return {
init_highlight = init_highlight,
}