From cf153808a20641800b8fd0b8f74d326ab0c292b8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 10 Feb 2024 13:27:37 +0100 Subject: [PATCH] nvim: Switch to mini base16 plugin Since we already have the mini library installed in our setup, we don't need to make use of external base16 plugins. It provides the same exact functionality, and seems slim and bug-free. Nothing changes for the user, but we have 1 plugin less to take care of (and it was mis-behaving in new versions anyway). Also set lualine to be reloaded on theme switch so it takes on the colorscheme as well. --- .../templates/nvim/templates/default.mustache | 37 ++++++++++--------- nvim/.config/nvim/lua/plugins/config/mini.lua | 19 ++++++++++ nvim/.config/nvim/lua/plugins/core.lua | 27 +------------- 3 files changed, 40 insertions(+), 43 deletions(-) diff --git a/desktop/.config/flavours/templates/nvim/templates/default.mustache b/desktop/.config/flavours/templates/nvim/templates/default.mustache index 08baf2c..c2cd8de 100644 --- a/desktop/.config/flavours/templates/nvim/templates/default.mustache +++ b/desktop/.config/flavours/templates/nvim/templates/default.mustache @@ -7,23 +7,26 @@ -- by RRethy (https://github.com/RRethy/nvim-base16) -- {{scheme-name}} scheme by {{scheme-author}} -require('base16-colorscheme').setup({ - base00 = '#{{base00-hex}}', - base01 = '#{{base01-hex}}', - base02 = '#{{base02-hex}}', - base03 = '#{{base03-hex}}', - base04 = '#{{base04-hex}}', - base05 = '#{{base05-hex}}', - base06 = '#{{base06-hex}}', - base07 = '#{{base07-hex}}', - base08 = '#{{base08-hex}}', - base09 = '#{{base09-hex}}', - base0A = '#{{base0A-hex}}', - base0B = '#{{base0B-hex}}', - base0C = '#{{base0C-hex}}', - base0D = '#{{base0D-hex}}', - base0E = '#{{base0E-hex}}', - base0F = '#{{base0F-hex}}' +require('mini.base16').setup({ + palette = { + base00 = '#{{base00-hex}}', + base01 = '#{{base01-hex}}', + base02 = '#{{base02-hex}}', + base03 = '#{{base03-hex}}', + base04 = '#{{base04-hex}}', + base05 = '#{{base05-hex}}', + base06 = '#{{base06-hex}}', + base07 = '#{{base07-hex}}', + base08 = '#{{base08-hex}}', + base09 = '#{{base09-hex}}', + base0A = '#{{base0A-hex}}', + base0B = '#{{base0B-hex}}', + base0C = '#{{base0C-hex}}', + base0D = '#{{base0D-hex}}', + base0E = '#{{base0E-hex}}', + base0F = '#{{base0F-hex}}' + }, }) +require('lualine').setup() -- vim: filetype=lua diff --git a/nvim/.config/nvim/lua/plugins/config/mini.lua b/nvim/.config/nvim/lua/plugins/config/mini.lua index 8a9b55c..6275595 100644 --- a/nvim/.config/nvim/lua/plugins/config/mini.lua +++ b/nvim/.config/nvim/lua/plugins/config/mini.lua @@ -1,3 +1,20 @@ +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), +}) + require("mini.ai").setup() require("mini.comment").setup({ hooks = { @@ -8,11 +25,13 @@ require("mini.comment").setup({ }) require("mini.cursorword").setup({ delay = 500 }) require("mini.fuzzy").setup() + require("mini.indentscope").setup({ symbol = "│", draw = { animation = require("mini.indentscope").gen_animation.none() }, options = { indent_at_cursor = false }, }) + require("mini.map").setup() require("mini.move").setup() -- has not hit stable yet require("mini.pairs").setup() diff --git a/nvim/.config/nvim/lua/plugins/core.lua b/nvim/.config/nvim/lua/plugins/core.lua index f317b39..cbcbb23 100644 --- a/nvim/.config/nvim/lua/plugins/core.lua +++ b/nvim/.config/nvim/lua/plugins/core.lua @@ -57,6 +57,7 @@ return { { "echasnovski/mini.nvim", version = "*", + dependencies = { "rktjmp/fwatch.nvim" }, config = function() require("plugins.config.mini") end, @@ -86,32 +87,6 @@ return { { "sP", ":Pythonterm!" }, }, }, - -- colorschemes - { - "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 }, -- make it a little less painful to open really big (>2mb) files by disabling features