From 4ca8d781cfaf53fcd6fd95933280e62c27574d12 Mon Sep 17 00:00:00 2001 From: siduck Date: Thu, 31 Mar 2022 12:52:23 +0530 Subject: [PATCH] add option to enable inbuilt plugins (#919) (#914) --- lua/core/default_config.lua | 23 +++++++++++++++++++++++ lua/core/options.lua | 22 ++-------------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 4562f6a..80b23a7 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -67,6 +67,29 @@ M.ui = { ---- PLUGIN OPTIONS ---- M.plugins = { + + -- builtin nvim plugins are disabled + builtins = { + "2html_plugin", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "matchit", + "tar", + "tarPlugin", + "rrhelper", + "spellfile_plugin", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + }, + -- enable/disable plugins (false for disable) status = { blankline = true, -- indentline stuff diff --git a/lua/core/options.lua b/lua/core/options.lua index f8436a8..06f669c 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -48,26 +48,7 @@ opt.whichwrap:append "<>[]hl" g.mapleader = options.mapleader -- disable some builtin vim plugins -local disabled_built_ins = { - "2html_plugin", - "getscript", - "getscriptPlugin", - "gzip", - "logipat", - "netrw", - "netrwPlugin", - "netrwSettings", - "netrwFileHandlers", - "matchit", - "tar", - "tarPlugin", - "rrhelper", - "spellfile_plugin", - "vimball", - "vimballPlugin", - "zip", - "zipPlugin", -} +local disabled_built_ins = require("core.utils").load_config().plugins.builtins for _, plugin in pairs(disabled_built_ins) do g["loaded_" .. plugin] = 1 @@ -75,6 +56,7 @@ end --Defer loading shada until after startup_ vim.opt.shadafile = "NONE" + vim.schedule(function() vim.opt.shadafile = require("core.utils").load_config().options.shadafile vim.cmd [[ silent! rsh ]]