dotfiles/config/nvim/lua/colors.lua

45 lines
1.3 KiB
Lua
Raw Normal View History

-- Eryn Wells <eryn@erynwells.me>
function reloadColorscheme(colorschemeName)
2023-06-17 12:52:45 -07:00
if colorschemeName == nil then
vim.cmd [[
2023-06-17 12:52:45 -07:00
highlight clear
]]
2023-06-17 12:52:45 -07:00
else
vim.cmd {
cmd = "colorscheme",
args = {colorschemeName},
}
end
2023-06-17 12:52:45 -07:00
-- Make some bespoke adjustments for my cursor and line length highlights
vim.cmd [[
highlight ColorColumn cterm=NONE ctermbg=Black
highlight CursorColumn cterm=NONE ctermbg=Black
highlight CursorLine cterm=NONE ctermbg=Black
highlight CursorLineNr cterm=bold ctermfg=White ctermbg=Black
highlight LineNr ctermfg=DarkGray
]]
-- Allow using GUI style colors (#RRGGBB hex codes) in color terminals if we
-- know it can do it. This is required for most modern color themes.
vim.g.termguicolors = vim.env.TERM_PROGRAM == "Apple_Terminal"
if vim.g.colors_name == "witchhazel" then
vim.cmd [[
highlight! default link LineNr CursorLineNr
highlight! default link CursorLineNr CursorLine
]]
elseif vim.g.colors_name == "dracula" then
vim.cmd [[
highlight CursorLineNr guibg=#44475a
]]
end
end
if vim.env.TERM_PROGRAM == "Apple_Terminal" then
reloadColorscheme(nil)
else
reloadColorscheme("dracula")
end