refactor(neovim): Better lazy.nvim setup

- Load options & keymaps right before loading lazy
- Bring back lazy suggested `disable_plugins` for performance
This commit is contained in:
Pratik Tripathy
2025-10-13 19:35:50 +05:30
parent 31659e55eb
commit cbb80fd205
2 changed files with 20 additions and 14 deletions

View File

@@ -9,8 +9,6 @@
-- Copy visual section to a line number -> :'<,'>t15 (copies To line 15)
-- Load keymaps & options: Order matters
require("config.options")
require("config.keymaps")
require("core.lazy")
require("core.lsp")
require("config.autocmd")
@@ -25,6 +23,6 @@ require("config.autocmd")
-- Brew:
-- tools: lazygit
-- lsp: dockerfile-language-server, markdown-toc, markdownlint-cli, marksman, prettier, prettierd, python-lsp-server,
-- shellharden, taplo, typescript-language-server, vue-language-server, yaml-language-server, yamlfmt
-- Mason: When they aren't found on OS or Brew
-- taplo, typescript-language-server, vue-language-server, yaml-language-server, yamlfmt
-- MasonInstallAll to install the rest (./lua/config/autocmd.lua)
-- codelldb, css-lsp, docker-compose-language-service, html-lsp, json-lsp, sqlls

View File

@@ -1,15 +1,15 @@
-- `:help lazy.nvim.txt` for more info
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--branch=stable",
lazyrepo,
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
@@ -20,16 +20,24 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
os.exit(1)
end
end
---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)
require("config.options")
require("config.keymaps")
require("lazy").setup({
change_detection = {
notify = false,
},
build = {
warn_on_override = true,
},
spec = { { import = "plugins" } },
checker = { notify = false },
change_detection = { notify = false },
performance = {
rtp = {
disabled_plugins = {
"gzip",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})