nvim(lazy): improving performance

This commit is contained in:
thek4n 2024-04-18 09:51:32 +03:00
parent ac7a0df836
commit e0281b7ac0
13 changed files with 26 additions and 9 deletions

View File

@ -1 +1 @@
require("base") require("core")

View File

@ -1,2 +0,0 @@
require("base.mappings.mappings")
require("base.mappings.run-scripts")

View File

@ -1,7 +1,7 @@
for _, source in ipairs({ for _, source in ipairs({
"base.options", "core.options",
"base.mappings", "core.mappings",
"base.lazy", "core.lazy",
}) })
do do
local status_ok, fault = pcall(require, source) local status_ok, fault = pcall(require, source)

View File

@ -18,5 +18,14 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup( require("lazy").setup(
"plugins", "plugins",
{ lockfile = vim.fn.stdpath("data") .. "/lazy-lock.json" } {
change_detection = { enabled = false },
lockfile = vim.fn.stdpath("data") .. "/lazy-lock.json",
ui = { border = "rounded" },
performance = {
cache = {
enabled = true,
}
}
}
) )

View File

@ -0,0 +1,2 @@
require("core.mappings.mappings")
require("core.mappings.run-scripts")

View File

@ -1,5 +1,6 @@
return { return {
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
event = "BufReadPost",
enabled = vim.fn.executable "git" == 1, enabled = vim.fn.executable "git" == 1,
config = function() config = function()
require("gitsigns").setup({ require("gitsigns").setup({

View File

@ -24,6 +24,7 @@ end
return { return {
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
event = "VeryLazy",
config = function() config = function()
require("lualine").setup({ require("lualine").setup({
options = { options = {

View File

@ -15,7 +15,6 @@ return {
}, },
{ {
"kylechui/nvim-surround", "kylechui/nvim-surround",
version = "*",
event = "VeryLazy", event = "VeryLazy",
config = function() config = function()
require("nvim-surround").setup() require("nvim-surround").setup()
@ -29,6 +28,7 @@ return {
}, },
{ {
'numToStr/Comment.nvim', 'numToStr/Comment.nvim',
keys = { { "gc" }, { "gc", mode = "v" } },
config = function() config = function()
require("Comment").setup() require("Comment").setup()
end end
@ -42,6 +42,7 @@ return {
{ {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate', build = ':TSUpdate',
event = "BufReadPost",
config = function() config = function()
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
ensure_installed = {"python", "lua", "vim", "html", "rust", "markdown"}, ensure_installed = {"python", "lua", "vim", "html", "rust", "markdown"},

View File

@ -65,6 +65,7 @@ end
return { return {
{ {
'L3MON4D3/LuaSnip', 'L3MON4D3/LuaSnip',
event = "InsertEnter",
build = "make install_jsregexp", build = "make install_jsregexp",
dependencies = { dependencies = {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
@ -95,6 +96,7 @@ return {
}, },
{ {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
event = "InsertEnter",
dependencies = { dependencies = {
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
@ -108,5 +110,6 @@ return {
}, },
{ {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
event = "InsertEnter",
}, },
} }

View File

@ -1,10 +1,12 @@
return { return {
{ {
'kana/vim-textobj-lastpat', -- text-object i/, operate under finding 'kana/vim-textobj-lastpat', -- text-object i/, operate under finding
event = "InsertEnter",
dependencies = { 'kana/vim-textobj-user' } dependencies = { 'kana/vim-textobj-user' }
}, },
{ {
'sgur/vim-textobj-parameter', 'sgur/vim-textobj-parameter',
event = "InsertEnter",
dependencies = { 'kana/vim-textobj-user' } dependencies = { 'kana/vim-textobj-user' }
} }
} }