Rename colors.lua to theme.lua and set colorscheme there

This commit is contained in:
2021-11-18 22:12:19 +03:00
parent 7d95762250
commit 1ccc5a1d99
3 changed files with 28 additions and 12 deletions

View File

@@ -23,18 +23,6 @@ vim.o.signcolumn = "yes"
vim.g.mapleader = " "
vim.cmd([[
let ayucolor = "mirage"
colorscheme ayu
]])
-- Remove highlighting in signcolumn
vim.cmd("highlight clear SignColumn")
vim.cmd([[
highlight DiagnosticVirtualTextError guifg=DarkRed
]])
-- Highlight on yank
vim.api.nvim_exec([[
augroup YankHighlight

27
config/nvim/lua/theme.lua Normal file
View File

@@ -0,0 +1,27 @@
local function set_highlight(group, options)
local bg = options.bg == nil and '' or 'guibg=' .. options.bg
local fg = options.fg == nil and '' or 'guifg=' .. options.fg
local gui = options.gui == nil and '' or 'gui=' .. options.gui
local ctermbg = options.bg == nil and '' or 'guibg=' .. options.bg
local ctermfg = options.fg == nil and '' or 'guifg=' .. options.fg
vim.cmd(string.format('hi %s %s %s %s %s %s', group, bg, fg, gui, ctermbg, ctermfg))
end
vim.cmd([[
let ayucolor = "mirage"
colorscheme ayu
]])
-- Remove highlighting in signcolumn
vim.cmd("highlight clear SignColumn")
-- Autocompletion menu
set_highlight("CmpItemMenu", { fg = "DarkGrey" })
set_highlight("Pmenu", { bg = "#191e2a", fg = "#cbccc6" })
set_highlight("PmenuSel", { bg = "#cbccc6", fg = "#ffa754" })
set_highlight("PmenuThumb", { bg = "#ffa754" })
set_highlight("Comment", { gui = "italic" })
-- Diagnostics
set_highlight("DiagnosticVirtualTextError", { fg = "DarkRed" })