FollieHiyuki-dotfiles/home/.config/nvim/lua/util.lua
FollieHiyuki 133dd68322
neovim: update multiple
- nvim-ts-rainbow: move config into 'nvim-treesitter.configs' block
- bufferline.nvim: update lsp diagnostic display, highlight
- gitsigns.nvim: add highlight for line blame info
- nvim-autopairs: update new config
- highlight: no more lazy loading (only 1-2ms faster, and caused some
  glitched highlights at startup due to treesitter group)
- chore: theme.util -> util
2021-10-20 15:05:04 +07:00

14 lines
445 B
Lua

local M = {}
function M.highlight(group, guifg, guibg, attr, guisp)
local fg = guifg ~= '' and 'guifg=' .. guifg or 'guifg=NONE'
local bg = guibg ~= '' and 'guibg=' .. guibg or 'guibg=NONE'
local style = attr ~= '' and 'gui=' .. attr or 'gui=NONE'
local sp = guisp ~= '' and 'guisp=' .. guisp or ''
local hl = 'hi ' .. group .. ' ' .. fg .. ' ' .. bg .. ' ' .. style .. ' ' .. sp
vim.api.nvim_command(hl)
end
return M