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:
parent
1d70d0c649
commit
1d0f47f2e8
1 changed files with 31 additions and 21 deletions
|
@ -7,7 +7,14 @@
|
|||
-- by RRethy (https://github.com/RRethy/nvim-base16)
|
||||
-- {{scheme-name}} scheme by {{scheme-author}}
|
||||
|
||||
require('mini.base16').setup({
|
||||
local function exists(plugin)
|
||||
local status, lib = pcall(require, plugin)
|
||||
if(status) then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
if exists("mini.base16") then
|
||||
require('mini.base16').setup({
|
||||
palette = {
|
||||
base00 = '#{{base00-hex}}',
|
||||
base01 = '#{{base01-hex}}',
|
||||
|
@ -26,7 +33,10 @@ require('mini.base16').setup({
|
|||
base0E = '#{{base0E-hex}}',
|
||||
base0F = '#{{base0F-hex}}'
|
||||
},
|
||||
})
|
||||
require('lualine').setup()
|
||||
})
|
||||
end
|
||||
if exists("lualine") then
|
||||
require("lualine").setup()
|
||||
end
|
||||
|
||||
-- vim: filetype=lua
|
||||
|
|
Loading…
Reference in a new issue