From c9dea9d49ab232acb0b07bc29fe5a49c30b4b482 Mon Sep 17 00:00:00 2001 From: Charles Chiu Date: Mon, 12 Aug 2024 17:43:52 +0800 Subject: [PATCH] fix(core): disable rtp plugins via `lazy.nvim`, #1339 (#1340) * fix(core): disable rtp plugins via `lazy.nvim` * chore(core): add notes for disabled rtp plugins --- lua/core/init.lua | 53 ----------------------------------------------- lua/core/pack.lua | 22 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 53 deletions(-) diff --git a/lua/core/init.lua b/lua/core/init.lua index a5fa32813..85ba8bff3 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -22,58 +22,6 @@ local createdir = function() end end -local disable_distribution_plugins = function() - -- Disable menu loading - vim.g.did_install_default_menus = 1 - vim.g.did_install_syntax_menu = 1 - - -- Comment this if you define your own filetypes in `after/ftplugin` - -- vim.g.did_load_filetypes = 1 - - -- Do not load native syntax completion - vim.g.loaded_syntax_completion = 1 - - -- Do not load spell files - vim.g.loaded_spellfile_plugin = 1 - - -- Whether to load netrw by default - -- vim.g.loaded_netrw = 1 - -- vim.g.loaded_netrwFileHandlers = 1 - -- vim.g.loaded_netrwPlugin = 1 - -- vim.g.loaded_netrwSettings = 1 - -- newtrw liststyle: https://medium.com/usevim/the-netrw-style-options-3ebe91d42456 - vim.g.netrw_liststyle = 3 - - -- Do not load tohtml.vim - vim.g.loaded_2html_plugin = 1 - - -- Do not load zipPlugin.vim, gzip.vim and tarPlugin.vim (all of these plugins are - -- related to reading files inside compressed containers) - vim.g.loaded_gzip = 1 - vim.g.loaded_tar = 1 - vim.g.loaded_tarPlugin = 1 - vim.g.loaded_vimball = 1 - vim.g.loaded_vimballPlugin = 1 - vim.g.loaded_zip = 1 - vim.g.loaded_zipPlugin = 1 - - -- Do not use builtin matchit.vim and matchparen.vim because we're using vim-matchup - vim.g.loaded_matchit = 1 - vim.g.loaded_matchparen = 1 - - -- Disable sql omni completion - vim.g.loaded_sql_completion = 1 - - -- Set this to 0 in order to disable native EditorConfig support - vim.g.editorconfig = 1 - - -- Disable remote plugins - -- NOTE: - -- > Disabling rplugin.vim will make `wilder.nvim` complain about missing rplugins during :checkhealth, - -- > but since it's config doesn't require python rtp (strictly), it's fine to ignore that for now. - -- vim.g.loaded_remote_plugins = 1 -end - local leader_map = function() vim.g.mapleader = " " -- NOTE: @@ -148,7 +96,6 @@ end local load_core = function() createdir() - disable_distribution_plugins() leader_map() gui_config() diff --git a/lua/core/pack.lua b/lua/core/pack.lua index 326bf3df9..d326b15bb 100644 --- a/lua/core/pack.lua +++ b/lua/core/pack.lua @@ -124,6 +124,28 @@ function Lazy:load_lazy() reset = true, -- reset the runtime path to $VIMRUNTIME and the config directory ---@type string[] paths = {}, -- add any custom paths here that you want to include in the rtp + disabled_plugins = { + -- Do not use builtin matchit.vim and matchparen.vim because we're using vim-matchup + "matchit", + "matchparen", + -- Do not load builtin netrw + "netrwPlugin", + -- Do not load tohtml.vim + "tohtml", + -- Do not load zipPlugin.vim, gzip.vim and tarPlugin.vim (all of these plugins are + -- related to reading files inside compressed containers) + "gzip", + "tarPlugin", + "tutor", + "zipPlugin", + -- Disable remote plugins + -- NOTE: + -- > Disabling rplugin.vim will make `wilder.nvim` complain about missing rplugins during :checkhealth, + -- > but since it's config doesn't require python rtp (strictly), it's fine to ignore that for now. + "rplugin", + -- Do not load spell files + "spellfile", + }, }, }, }