From a5fee8959f0d9424ccd8f239cb71d3201304fc54 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 26 Dec 2023 10:08:08 +0100 Subject: [PATCH] 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. --- nvim/.config/nvim/lua/core/init.lua | 1 - nvim/.config/nvim/lua/core/look.lua | 17 --------------- nvim/.config/nvim/lua/plugins/core.lua | 29 +++++++++++++++++++------- 3 files changed, 21 insertions(+), 26 deletions(-) delete mode 100644 nvim/.config/nvim/lua/core/look.lua diff --git a/nvim/.config/nvim/lua/core/init.lua b/nvim/.config/nvim/lua/core/init.lua index 035fe11..f13b09e 100644 --- a/nvim/.config/nvim/lua/core/init.lua +++ b/nvim/.config/nvim/lua/core/init.lua @@ -3,7 +3,6 @@ for _, source in ipairs({ "core.lazy", "core.autocmds", "core.mappings", - "core.look", }) do local status_ok, fault = pcall(require, source) if not status_ok then diff --git a/nvim/.config/nvim/lua/core/look.lua b/nvim/.config/nvim/lua/core/look.lua deleted file mode 100644 index 8622ada..0000000 --- a/nvim/.config/nvim/lua/core/look.lua +++ /dev/null @@ -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), -}) diff --git a/nvim/.config/nvim/lua/plugins/core.lua b/nvim/.config/nvim/lua/plugins/core.lua index 8bfcc71..f317b39 100644 --- a/nvim/.config/nvim/lua/plugins/core.lua +++ b/nvim/.config/nvim/lua/plugins/core.lua @@ -90,17 +90,30 @@ return { { "RRethy/nvim-base16", lazy = false, + commit = "96e3089", priority = 1000, 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, .. - { - "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 - { - "LunarVim/bigfile.nvim", - lazy = false, - }, + { "LunarVim/bigfile.nvim", lazy = false }, }