You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
911 B
36 lines
911 B
local M = require('module'):new()
|
|
|
|
function M:run()
|
|
self:configureUi(self.config.tui)
|
|
end
|
|
|
|
function M:gui()
|
|
self:configureUi(self.config.gui)
|
|
end
|
|
|
|
function M:configureUi(config)
|
|
-- Set the font if set
|
|
if (config.font ~= nil and config.font.family ~= nil and config.font.size ~= nil) then
|
|
vim.o.guifont = config.font.family..':h'..config.font.size
|
|
end
|
|
|
|
-- Set the color scheme if set
|
|
if (config.theme ~= nil) then
|
|
vim.cmd('colorscheme '..config.theme)
|
|
end
|
|
|
|
if (config.show_whitespace) then
|
|
vim.o.listchars = "tab:>-,trail:.,extends:.,precedes:.,space:."
|
|
vim.o.list = true
|
|
-- used to be 22, changed to not perfectly match the line highlight or cursor
|
|
if (config.show_whitespace == true) then
|
|
guifg = 'gray30'
|
|
else
|
|
guifg = config.show_whitespace
|
|
end
|
|
-- vim.highlight.create('Whitespace', { guifg = guifg })
|
|
vim.api.nvim_set_hl(0, 'Whitespace', { fg = guifg })
|
|
end
|
|
end
|
|
|
|
return M
|
|
|