-
-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy patheditor.lua
116 lines (97 loc) · 8.27 KB
/
editor.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
local C = require('github-theme.lib.color')
local M = {}
function M.get(spec, config)
local dark_sb = config.darken.sidebars.enabled
local hide_eof = config.hide_end_of_buffer
local inactive = config.dim_inactive
local inv = config.inverse
local trans = config.transparent
local sb_bg
if trans then
sb_bg = 'NONE'
elseif dark_sb then
sb_bg = spec.bg0
else
sb_bg = spec.bg1
end
local c = spec.palette
local sts_bg = C.from_hex(spec.bg0):blend(C.from_hex(c.blue.base), 0.7):to_css()
-- stylua: ignore start
local groups = {
ColorColumn = { bg = spec.bg2 }, -- used for the columns set with 'colorcolumn'
Conceal = { fg = spec.bg4 }, -- placeholder characters substituted for concealed text (see 'conceallevel')
Cursor = { fg = spec.bg1, bg = spec.fg1 }, -- character under the cursor
lCursor = { link = 'Cursor' }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
CursorIM = { link = 'Cursor' }, -- like Cursor, but used when in IME mode |CursorIM|
CursorColumn = { link = 'CursorLine' }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
CursorLine = { bg = spec.bg3 }, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
Directory = { fg = spec.syntax.func }, -- directory names (and other special names in listings)
DiffAdd = { bg = spec.diff.add }, -- diff mode: Added line |diff.txt|
DiffChange = { bg = spec.diff.change }, -- diff mode: Changed line |diff.txt|
DiffDelete = { bg = spec.diff.delete }, -- diff mode: Deleted line |diff.txt|
DiffText = { bg = spec.diff.text }, -- diff mode: Changed text within a changed line |diff.txt|
EndOfBuffer = { fg = hide_eof and spec.bg1 or spec.fg0 }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
-- TermCursor = {}, -- cursor in a focused terminal
-- TermCursorNC = {}, -- cursor in an unfocused terminal
ErrorMsg = { fg = spec.diag.error }, -- error messages on the command line
VertSplit = { fg = c.border.default }, -- the column separating vertically split windows
WinSeparator = { fg = c.border.default }, -- (nvim >= 0.10) the column separating vertically split windows
Folded = { fg = spec.fg3, bg = spec.bg2 }, -- line used for closed folds
FoldColumn = { fg = spec.fg3 }, -- 'foldcolumn'
SignColumn = { fg = spec.fg3 }, -- column where |signs| are displayed
SignColumnSB = { link = 'SignColumn' }, -- column where |signs| are displayed
Substitute = { fg = spec.bg1, bg = spec.diag.error }, -- |:substitute| replacement text highlighting
LineNr = { fg = spec.fg0 }, -- Line number for ':number' and ':#' commands, and when 'number' or 'relativenumber' option is set.
CursorLineNr = { fg = spec.fg1 }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
MatchParen = { fg = spec.fg1, bg = c.accent.muted, style = inv.match_paren and 'reverse,bold' or 'bold' }, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
ModeMsg = { fg = spec.diag.warn, style = 'bold' }, -- 'showmode' message (e.g., '-- INSERT -- ')
-- NOTE: This was commented out as there is an issue with setting this highlight group see issue #98
-- MsgArea = { fg = spec.fg2 }, -- Area for messages and cmdline
-- MsgSeparator = {}, -- Separator for scrolled messages, `msgsep` flag of 'display'
MoreMsg = { fg = spec.diag.info, style = 'bold' }, -- |more-prompt|
NonText = { fg = spec.bg4 }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., '>' displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
Normal = { fg = spec.fg1, bg = trans and 'NONE' or spec.bg1 }, -- normal text
NormalSB = { fg = spec.fg1, bg = sb_bg }, -- normal text
NormalNC = { fg = spec.fg1, bg = (inactive and spec.bg0) or (trans and 'NONE') or spec.bg1 }, -- normal text in non-current windows
NormalFloat = { fg = spec.fg1, bg = config.darken.floats and spec.bg0 or spec.bg1 }, -- Normal text in floating windows.
FloatBorder = { fg = c.border.default }, -- TODO
Pmenu = { fg = spec.fg1, bg = spec.bg0 }, -- Popup menu: normal item.
PmenuSel = { bg = spec.sel1 }, -- Popup menu: selected item.
PmenuSbar = { link = 'Pmenu' }, -- Popup menu: scrollbar.
PmenuThumb = { bg = spec.sel0 }, -- Popup menu: Thumb of the scrollbar.
Question = { link = 'MoreMsg' }, -- |hit-enter| prompt and yes/no questions
QuickFixLine = { link = 'CursorLine' }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
Search = inv.search and { style = 'reverse' } or { bg = spec.sel2 }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
IncSearch = inv.search and { style = 'reverse' } or { fg = c.black.bright, bg = c.orange }, -- 'incsearch' highlighting; also used for the text replaced with ':s///c'
CurSearch = { link = 'IncSearch'}, -- Search result under cursor (available since neovim >0.7.0 (https://github.com/neovim/neovim/commit/b16afe4d556af7c3e86b311cfffd1c68a5eed71f)).
SpecialKey = { link = 'NonText' }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
SpellBad = { sp = spec.diag.error, style = 'undercurl' }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
SpellCap = { sp = spec.diag.warn, style = 'undercurl' }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
SpellLocal = { sp = spec.diag.info, style = 'undercurl' }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
SpellRare = { sp = spec.diag.info, style = 'undercurl' }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
StatusLine = { fg = spec.bg0, bg = sts_bg }, -- status line of current window
StatusLineNC = { fg = spec.fg3, bg = spec.bg0 }, -- status lines of not-current windows Note: if this is equal to 'StatusLine' Vim will use '^^^' in the status line of the current window.
TabLine = { fg = spec.fg2, bg = spec.bg2 }, -- tab pages line, not active tab page label
TabLineFill = { bg = spec.bg0 }, -- tab pages line, where there are no labels
TabLineSel = { fg = spec.bg1, bg = spec.fg3 }, -- tab pages line, active tab page label
Title = { fg = spec.syntax.builtin2, style = 'bold' }, -- titles for output from ':set all', ':autocmd' etc.
Visual = inv.visual and { style = 'reverse' } or { bg = spec.sel0 }, -- Visual mode selection
VisualNOS = inv.visual and { style = 'reverse' } or { link = 'visual' }, -- Visual mode selection when vim is 'Not Owning the Selection'.
WarningMsg = { fg = spec.diag.warn }, -- warning messages
Whitespace = { fg = spec.bg3 }, -- 'nbsp', 'space', 'tab' and 'trail' in 'listchars'
WildMenu = { link = 'Pmenu' }, -- current match in 'wildmenu' completion
WinBar = { fg = spec.fg3, bg = trans and 'NONE' or spec.bg1, style = 'bold' }, -- Window bar of current window.
WinBarNC = { fg = spec.fg3, bg = trans and 'NONE' or inactive and spec.bg0 or spec.bg1, style = 'bold' }, --Window bar of not-current windows.
-- qfLineNr = {},
-- qfFileName = {},
-- debugPC = {}, -- used for highlighting the current line in terminal-debug
-- debugBreakpoint = {}, -- used for breakpoint colors in terminal-debug
}
-- stylua: ignore end
if config.hide_nc_statusline then
groups.StatusLineNC =
{ fg = spec.bg1, bg = spec.bg1, sp = spec.bg0, style = 'Underline' }
end
return groups
end
return M