nvim: Move base16 functionality to plugin config

Moved loading and setting up file watching to the loading of the plugin itself.
Will make it a little more self-contained and not crash or complain if we are
missing the plugin.

HACK
At the same time, reverted back to pinned base16 commit since the new one did
not work again. Gotta figure it out at some point but no time now.
This commit is contained in:
Marty Oehme 2023-12-26 10:08:08 +01:00
parent df10d40510
commit a5fee8959f
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
3 changed files with 21 additions and 26 deletions

View file

@ -3,7 +3,6 @@ for _, source in ipairs({
"core.lazy", "core.lazy",
"core.autocmds", "core.autocmds",
"core.mappings", "core.mappings",
"core.look",
}) do }) do
local status_ok, fault = pcall(require, source) local status_ok, fault = pcall(require, source)
if not status_ok then if not status_ok then

View file

@ -1,17 +0,0 @@
local colorsfile = vim.fn.stdpath("state") .. "/colorscheme.lua"
local function source_colors()
if vim.fn.filereadable(colorsfile) == 1 then
vim.cmd("source " .. colorsfile)
end
end
-- set on startup
source_colors()
-- continuously watch colors file for changes
local fwatch = require("fwatch")
fwatch.watch(colorsfile, {
on_event = vim.schedule_wrap(function()
source_colors()
end),
})

View file

@ -90,17 +90,30 @@ return {
{ {
"RRethy/nvim-base16", "RRethy/nvim-base16",
lazy = false, lazy = false,
commit = "96e3089",
priority = 1000, priority = 1000,
dependencies = { "rktjmp/fwatch.nvim" }, dependencies = { "rktjmp/fwatch.nvim" },
config = function()
local colorsfile = vim.fn.stdpath("state") .. "/colorscheme.lua"
local function source_colors()
if vim.fn.filereadable(colorsfile) == 1 then
vim.cmd("source " .. colorsfile)
end
end
-- set on startup
source_colors()
-- continuously watch colors file for changes
local fwatch = require("fwatch")
fwatch.watch(colorsfile, {
on_event = vim.schedule_wrap(function()
source_colors()
end),
})
end,
}, },
-- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, .. -- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, ..
{ { "stevearc/stickybuf.nvim", config = true },
"stevearc/stickybuf.nvim",
config = true,
},
-- make it a little less painful to open really big (>2mb) files by disabling features -- make it a little less painful to open really big (>2mb) files by disabling features
{ { "LunarVim/bigfile.nvim", lazy = false },
"LunarVim/bigfile.nvim",
lazy = false,
},
} }