flavours: Check for nvim plugin existence in template

Checks that mini.base16 plugin exists before executing its setup,
and checks that lualine exists before executing its setup.
This commit is contained in:
Marty Oehme 2024-02-15 08:47:50 +01:00
parent 1d70d0c649
commit 1d0f47f2e8
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -7,26 +7,36 @@
-- by RRethy (https://github.com/RRethy/nvim-base16) -- by RRethy (https://github.com/RRethy/nvim-base16)
-- {{scheme-name}} scheme by {{scheme-author}} -- {{scheme-name}} scheme by {{scheme-author}}
require('mini.base16').setup({ local function exists(plugin)
palette = { local status, lib = pcall(require, plugin)
base00 = '#{{base00-hex}}', if(status) then return true end
base01 = '#{{base01-hex}}', return false
base02 = '#{{base02-hex}}', end
base03 = '#{{base03-hex}}',
base04 = '#{{base04-hex}}', if exists("mini.base16") then
base05 = '#{{base05-hex}}', require('mini.base16').setup({
base06 = '#{{base06-hex}}', palette = {
base07 = '#{{base07-hex}}', base00 = '#{{base00-hex}}',
base08 = '#{{base08-hex}}', base01 = '#{{base01-hex}}',
base09 = '#{{base09-hex}}', base02 = '#{{base02-hex}}',
base0A = '#{{base0A-hex}}', base03 = '#{{base03-hex}}',
base0B = '#{{base0B-hex}}', base04 = '#{{base04-hex}}',
base0C = '#{{base0C-hex}}', base05 = '#{{base05-hex}}',
base0D = '#{{base0D-hex}}', base06 = '#{{base06-hex}}',
base0E = '#{{base0E-hex}}', base07 = '#{{base07-hex}}',
base0F = '#{{base0F-hex}}' base08 = '#{{base08-hex}}',
}, base09 = '#{{base09-hex}}',
}) base0A = '#{{base0A-hex}}',
require('lualine').setup() base0B = '#{{base0B-hex}}',
base0C = '#{{base0C-hex}}',
base0D = '#{{base0D-hex}}',
base0E = '#{{base0E-hex}}',
base0F = '#{{base0F-hex}}'
},
})
end
if exists("lualine") then
require("lualine").setup()
end
-- vim: filetype=lua -- vim: filetype=lua