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. -- Clear the highlighting.
vim.cmd('hi clear') vim.cmd('hi clear')
-- Set the background to dark.
vim.o.background = 'dark' vim.o.background = 'dark'
-- Disable automatic coloring for the IndentGuides plugin.
vim.g.indent_guides_auto_colors = 0 vim.g.indent_guides_auto_colors = 0
-- If the syntax has been enabled, reset it. -- 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. -- Determine which set of colors to use.
local use_hex_and_256 = string.find(vim.fn.expand('$TERM'), '256') local use_hex_and_256 = string.find(vim.fn.expand('$TERM'), '256')
or vim.g.t_Co >= 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 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 if not use_hex_and_256 then vim.g.t_Co = 16 end
@ -102,6 +105,6 @@ return function(name, Normal, highlights, terminal_ansi_colors)
-- Set the terminal colors. -- Set the terminal colors.
for index, color in ipairs(terminal_ansi_colors) do 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
end end

View File

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