mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
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:
@@ -9,8 +9,6 @@
|
|||||||
-- Copy visual section to a line number -> :'<,'>t15 (copies To line 15)
|
-- Copy visual section to a line number -> :'<,'>t15 (copies To line 15)
|
||||||
|
|
||||||
-- Load keymaps & options: Order matters
|
-- Load keymaps & options: Order matters
|
||||||
require("config.options")
|
|
||||||
require("config.keymaps")
|
|
||||||
require("core.lazy")
|
require("core.lazy")
|
||||||
require("core.lsp")
|
require("core.lsp")
|
||||||
require("config.autocmd")
|
require("config.autocmd")
|
||||||
@@ -25,6 +23,6 @@ require("config.autocmd")
|
|||||||
-- Brew:
|
-- Brew:
|
||||||
-- tools: lazygit
|
-- tools: lazygit
|
||||||
-- lsp: dockerfile-language-server, markdown-toc, markdownlint-cli, marksman, prettier, prettierd, python-lsp-server,
|
-- 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
|
-- taplo, typescript-language-server, vue-language-server, yaml-language-server, yamlfmt
|
||||||
-- Mason: When they aren't found on OS or Brew
|
-- MasonInstallAll to install the rest (./lua/config/autocmd.lua)
|
||||||
-- codelldb, css-lsp, docker-compose-language-service, html-lsp, json-lsp, sqlls
|
-- codelldb, css-lsp, docker-compose-language-service, html-lsp, json-lsp, sqlls
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
-- `:help lazy.nvim.txt` for more info
|
-- `:help lazy.nvim.txt` for more info
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
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({
|
local out = vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--filter=blob:none",
|
"--filter=blob:none",
|
||||||
"--branch=stable",
|
"--branch=stable",
|
||||||
lazyrepo,
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
|
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
{ "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)
|
os.exit(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---@diagnostic disable-next-line: undefined-field
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("config.options")
|
||||||
|
require("config.keymaps")
|
||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
change_detection = {
|
|
||||||
notify = false,
|
|
||||||
},
|
|
||||||
build = {
|
|
||||||
warn_on_override = true,
|
|
||||||
},
|
|
||||||
spec = { { import = "plugins" } },
|
spec = { { import = "plugins" } },
|
||||||
|
checker = { notify = false },
|
||||||
|
change_detection = { notify = false },
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
disabled_plugins = {
|
||||||
|
"gzip",
|
||||||
|
"tarPlugin",
|
||||||
|
"tohtml",
|
||||||
|
"tutor",
|
||||||
|
"zipPlugin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user