[nvim] Make colors a proper module and call .init() from init.lua

This commit is contained in:
Eryn Wells 2024-06-25 10:09:26 -07:00
parent aeaeca56a3
commit 92418f9ec9
2 changed files with 15 additions and 6 deletions

View file

@ -56,10 +56,12 @@ vim.cmd [[
]] ]]
require "configuration" require "configuration"
require "colors"
require "keys" require "keys"
require "lsp" require "lsp"
local colors = require "colors"
colors.init()
function ErynEnsureMetadataDirectoriesExist() function ErynEnsureMetadataDirectoriesExist()
local paths = { local paths = {
vim.opt.backupdir:get(), vim.opt.backupdir:get(),

View file

@ -1,6 +1,6 @@
-- Eryn Wells <eryn@erynwells.me> -- Eryn Wells <eryn@erynwells.me>
function reloadColorscheme(colorschemeName) local function reloadColorscheme(colorschemeName)
if colorschemeName == nil then if colorschemeName == nil then
vim.cmd [[ vim.cmd [[
highlight clear highlight clear
@ -39,8 +39,15 @@ function reloadColorscheme(colorschemeName)
end end
end end
if vim.env.TERM_PROGRAM == "Apple_Terminal" then local function init()
reloadColorscheme(nil) if vim.env.TERM_PROGRAM == "Apple_Terminal" then
else reloadColorscheme(nil)
reloadColorscheme("dracula") else
reloadColorscheme("dracula")
end
end end
return {
init = init,
reloadColorscheme = reloadColorscheme
}