-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy patheditor.lua
More file actions
148 lines (140 loc) · 10.2 KB
/
editor.lua
File metadata and controls
148 lines (140 loc) · 10.2 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
local M = {}
---Set the highlight groups for the editor
---@param theme table
---@return table
function M.groups(theme)
local color = require("onedarkpro.helpers")
local config = require("onedarkpro.config")
return {
Added = { fg = theme.palette.green }, -- For added plugins via vim.pack.add
ColorColumn = { bg = theme.generated.color_column }, -- used for the columns set with 'colorcolumn'
ComplHint = { fg = theme.palette.gray, style = config.styles.virtual_text }, -- completion hint
ComplHintMore = { fg = theme.palette.gray, style = config.styles.virtual_text }, -- completion hint
Conceal = { fg = theme.palette.fg }, -- placeholder characters substituted for concealed text (see 'conceallevel')
Cursor = { bg = theme.palette.purple, fg = theme.palette.bg }, -- character under the cursor
-- lCursor = {}, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
-- CursorIM = {bg = theme.palette.red}, -- like Cursor, but used when in IME mode |CursorIM|
CursorColumn = { bg = theme.palette.gray }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
CursorLine = { bg = config.options.cursorline and theme.generated.cursorline or theme.palette.bg }, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
CursorLineNr = {
bg = config.options.cursorline and theme.generated.cursorline or theme.palette.bg,
fg = theme.palette.purple,
}, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
CursorLineNrNC = { bg = theme.generated.color_column, fg = theme.palette.gray }, -- CursorLineNr for inactive windows
CursorLineNrNCQuickFix = { bg = theme.palette.bg, fg = theme.palette.purple }, -- CursorLineNr for inactive quickfix windows
Directory = { fg = theme.palette.blue }, -- directory names (and other special names in listings)
DiffAdd = { bg = theme.generated.diff_add }, -- Added (inserted) lines |diff.txt|
DiffChange = { bg = theme.generated.diff_change }, -- Changed lines |diff.txt|
DiffDelete = { bg = theme.generated.diff_delete }, -- Deleted lines |diff.txt|
DiffText = { bg = theme.generated.diff_text }, -- Changed text inside a Changed line |diff.txt|
DiffTextDelete = { bg = theme.generated.diff_text_delete }, -- Deleted text inside a Deleted line (custom extension)
EndOfBuffer = { fg = theme.palette.bg }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
ErrorMsg = { fg = theme.palette.red }, -- error messages on the command line
VertSplit = { bg = config.options.transparency and "NONE" or theme.palette.bg, fg = theme.palette.gray }, -- the column separating vertically split windows
Folded = { bg = config.options.transparency and "NONE" or theme.generated.fold, fg = theme.palette.gray }, -- line used for closed folds
FoldedNC = {
bg = config.options.transparency and "NONE" or theme.generated.color_column,
fg = theme.palette.gray,
}, -- Folded for inactive windows
FoldColumn = {
bg = config.options.transparency and "NONE" or theme.palette.bg,
fg = theme.generated.line_number,
}, -- 'foldcolumn'
SignColumn = { bg = config.options.transparency and "NONE" or theme.palette.bg }, -- column where |signs| are displayed
SignColumnNC = {
bg = config.options.transparency and "NONE" or theme.generated.color_column,
fg = theme.palette.gray,
}, -- SignColumn for inactive windows
Substitute = { bg = theme.palette.yellow, fg = theme.palette.bg }, -- |:substitute| replacement text highlighting
LineNr = { bg = config.options.transparency and "NONE" or theme.palette.bg, fg = theme.generated.line_number }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
LineNrNC = {
bg = config.options.transparency and "NONE" or theme.generated.color_column,
fg = theme.generated.line_number,
}, -- LineNr for inactive windows
MatchParen = { fg = theme.palette.cyan }, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
ModeMsg = { link = "Normal" }, -- 'showmode' message (e.g., "-- INSERT -- ")
MsgArea = { link = "ModeMsg" }, -- Area for messages and cmdline
MsgSeparator = { link = "ModeMsg" }, -- Separator for scrolled messages, `msgsep` flag of 'display'
MoreMsg = { fg = theme.palette.green }, -- |more-prompt|
NonText = { bg = config.options.transparency and "NONE" or theme.palette.bg, fg = theme.palette.gray }, -- '@' 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 = { bg = config.options.transparency and "NONE" or theme.palette.bg, fg = theme.palette.fg }, -- normal text
NormalNC = {
bg = config.options.transparency and "NONE"
or config.options.highlight_inactive_windows and theme.generated.color_column
or theme.palette.bg,
fg = theme.palette.fg,
}, -- normal text in non-current windows
NormalFloat = { bg = config.options.transparency and "NONE" or theme.generated.float_bg }, -- Normal text in floating windows.
FloatBorder = {
bg = config.options.transparency and "NONE" or theme.generated.float_bg,
fg = theme.palette.gray,
},
Pmenu = { bg = theme.generated.float_bg }, -- Popup menu: normal item.
PmenuSel = {
bg = (theme.meta.background == "dark" and (theme.meta.name == "onedark_dark" and color.lighten(
theme.palette.bg,
10
) or color.lighten(theme.palette.bg, 3)) or color.darken(theme.palette.bg, 8)),
}, -- Popup menu: selected item.
PmenuSbar = {
bg = (
theme.meta.background == "dark" and color.lighten(theme.palette.bg, 3)
or color.darken(theme.palette.bg, 8)
),
}, -- Popup menu: scrollbar.
PmenuThumb = {
bg = (theme.meta.background == "dark" and color.lighten(theme.palette.bg, 5) or color.darken(
theme.palette.bg,
12
)),
}, -- Popup menu: Thumb of the scrollbar.
Question = { bg = config.options.transparency and "NONE" or theme.palette.bg, fg = theme.palette.gray }, -- |hit-enter| prompt and yes/no questions
QuickFixLine = { bg = config.options.cursorline and theme.generated.cursorline or theme.palette.bg }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
QuickFixLineNC = { bg = theme.palette.bg }, -- QuickFixLine, for inactive windows
Search = { bg = theme.generated.selection, fg = theme.palette.yellow }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
-- SpecialKey = {}, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace| SpellBad Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise. SpellCap Word that should start with a capital. |spell| Combined with the highlighting used otherwise. SpellLocal Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
-- SpellRare = {}, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
IncSearch = { bg = theme.generated.selection, fg = theme.palette.yellow }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
StatusLine = {
bg = config.options.transparency and "NONE" or theme.palette.bg,
fg = theme.palette.fg,
bold = true,
}, -- status line of current window
StatusLineNC = {
bg = config.options.transparency and "NONE"
or config.options.highlight_inactive_windows and theme.generated.color_column
or theme.palette.bg,
fg = theme.palette.fg,
}, -- 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 = { bg = config.options.transparency and "NONE" or theme.palette.bg }, -- tab pages line, not active tab page label
TabLineFill = { bg = config.options.transparency and "NONE" or theme.palette.bg, fg = theme.palette.fg }, -- tab pages line, where there are no labels
TabLineSel = { bg = theme.palette.purple, fg = theme.palette.bg }, -- tab pages line, active tab page label
TermCursor = { bg = theme.palette.purple }, -- cursor in a focused terminal
TermCursorNC = { bg = theme.palette.gray }, -- cursor in an unfocused terminal
Title = { fg = theme.palette.green }, -- titles for output from ":set all", ":autocmd"
Visual = { bg = theme.generated.selection }, -- Visual mode selection
VisualNOS = { link = "Visual" }, -- Visual mode selection when vim is "Not Owning the Selection".
WarningMsg = { fg = theme.palette.yellow }, -- warning messages
WinBar = { bg = config.options.transparency and "NONE" or theme.palette.bg, fg = theme.palette.fg },
WinBarNC = {
bg = config.options.transparency and "NONE"
or config.options.highlight_inactive_windows and theme.generated.color_column
or theme.palette.bg,
fg = theme.palette.fg,
},
WinSeparator = { bg = config.options.transparency and "NONE" or theme.palette.bg, fg = theme.palette.gray }, -- the column separating windows
Whitespace = { fg = theme.palette.gray }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
WildMenu = { bg = theme.palette.blue, fg = theme.palette.black }, -- current match in 'wildmenu' completion
-- Syntax groups
-- Git
diffFile = { fg = theme.generated.git_change },
diffNewFile = { fg = theme.generated.git_change },
diffLine = { fg = theme.palette.blue },
-- Spelling
SpellBad = { fg = theme.palette.red, sp = theme.palette.red, undercurl = true },
SpellCap = { fg = theme.palette.red, sp = theme.palette.red, undercurl = true },
SpellLocal = { fg = theme.palette.red, sp = theme.palette.red, undercurl = true },
SpellRare = { fg = theme.palette.red, sp = theme.palette.red, undercurl = true },
}
end
return M