[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 "colors"
require "keys"
require "lsp"
local colors = require "colors"
colors.init()
function ErynEnsureMetadataDirectoriesExist()
local paths = {
vim.opt.backupdir:get(),

View file

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