Adjust color settings; use get() consistently

This commit is contained in:
Iron_E 2020-06-22 15:00:06 -04:00
parent a38985d366
commit a582a162e9
No known key found for this signature in database
GPG Key ID: B0B37DE7EDC2335F
2 changed files with 8 additions and 5 deletions

View File

@ -3,7 +3,10 @@
-- Clear the highlighting.
vim.cmd('hi clear')
-- Set the background to dark.
vim.o.background = 'dark'
-- Disable automatic coloring for the IndentGuides plugin.
vim.g.indent_guides_auto_colors = 0
-- If the syntax has been enabled, reset it.
@ -12,7 +15,7 @@ if vim.fn.exists('syntax_on') then vim.cmd('syntax reset') end
-- Determine which set of colors to use.
local use_hex_and_256 = string.find(vim.fn.expand('$TERM'), '256')
or vim.g.t_Co >= 256
or vim.fn.has("gui_running")
or vim.fn.has('gui_running')
-- If we aren't using the hex and 256 colorset, then set the &t_Co variable to 16.
if not use_hex_and_256 then vim.g.t_Co = 16 end
@ -66,7 +69,7 @@ local function highlight(highlight_group, attributes) -- {{{ †
-- If we're using hex populate the gui* attr args.
if use_hex_and_256 then highlight_cmd[#highlight_cmd + 1] =
' gui=' .. selected_attributes
' gui=' .. selected_attributes
end
end
@ -102,6 +105,6 @@ return function(name, Normal, highlights, terminal_ansi_colors)
-- Set the terminal colors.
for index, color in ipairs(terminal_ansi_colors) do
vim.g['terminal_color_' .. index] = color[HEX]
vim.g['terminal_color_' .. index] = get(color, HEX)
end
end

View File

@ -202,7 +202,7 @@ local highlights = {
Float = {link='Number' },
--[[ 4.1.2. Identifiers]]
Identifier = {bg=NONE, fg=white, style=NONE},
Identifier = {bg=NONE, fg=FG, style=NONE},
Function = {bg=NONE, fg=purple, style=NONE},
--[[ 4.1.3. Syntax]]
@ -232,7 +232,7 @@ local highlights = {
SpecialChar = {link='Character' },
SpecialKey = {link='Character' },
Tag = {link='Underlined' },
Delimiter = {link='Normal' },
Delimiter = {bg=NONE, fg=white, style=NONE },
SpecialComment = {bg=NONE, fg=gray, style={'bold', 'nocombine'}},
Debug = {link='WarningMsg' },