mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
tune startup time
This commit is contained in:
parent
b7de30e431
commit
a745438e75
8 changed files with 126 additions and 95 deletions
|
@ -12,7 +12,6 @@
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||||
"code_runner.nvim": { "branch": "main", "commit": "a010649236fe245eaab2641a13228cd601499715" },
|
"code_runner.nvim": { "branch": "main", "commit": "a010649236fe245eaab2641a13228cd601499715" },
|
||||||
"dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" },
|
"dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "688b4fec4517650e29c3e63cfbb6e498b3112ba1" },
|
|
||||||
"friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" },
|
"friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
|
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
|
||||||
"impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" },
|
"impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" },
|
||||||
|
@ -20,10 +19,11 @@
|
||||||
"jaq-nvim": { "branch": "master", "commit": "236296aae555657487d1bb4d066cbde9d79d8cd4" },
|
"jaq-nvim": { "branch": "master", "commit": "236296aae555657487d1bb4d066cbde9d79d8cd4" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" },
|
"lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" },
|
||||||
"live-server": { "branch": "main", "commit": "ecd7c1418823b65dd2bca710587c80afe42c973e" },
|
"live-server": { "branch": "main", "commit": "ecd7c1418823b65dd2bca710587c80afe42c973e" },
|
||||||
|
"lsp-progress.nvim": { "branch": "main", "commit": "3efe705b2e91693be92aa32d9b41bcb9027393ef" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
|
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a31e011135a79d63c71254c250c9158e1056a1cb" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "a31e011135a79d63c71254c250c9158e1056a1cb" },
|
||||||
"mason-null-ls.nvim": { "branch": "main", "commit": "29ce60f9a16fef3de682a9365ef635f24ae92bf9" },
|
"mason-null-ls.nvim": { "branch": "main", "commit": "29ce60f9a16fef3de682a9365ef635f24ae92bf9" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "add6d1d63d8b86af951ba64b4157fe6b0af173d4" },
|
"mason.nvim": { "branch": "main", "commit": "bb307c339d14afaaefe624f784e3cf25451817e4" },
|
||||||
"mini.animate": { "branch": "main", "commit": "b0c717ed5513b5f23e7c48615449c7dc9fabd05b" },
|
"mini.animate": { "branch": "main", "commit": "b0c717ed5513b5f23e7c48615449c7dc9fabd05b" },
|
||||||
"mini.indentscope": { "branch": "main", "commit": "7998edc970610c05598c7aea3d21ece8dd87ed52" },
|
"mini.indentscope": { "branch": "main", "commit": "7998edc970610c05598c7aea3d21ece8dd87ed52" },
|
||||||
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },
|
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },
|
||||||
|
|
|
@ -31,7 +31,7 @@ vim.g.pcode_transparent_mode = 0
|
||||||
-- 0 disable progress
|
-- 0 disable progress
|
||||||
-- 1 lualine lsp progress
|
-- 1 lualine lsp progress
|
||||||
-- 2 fidget progress
|
-- 2 fidget progress
|
||||||
vim.g.pcode_progress = 2
|
vim.g.pcode_progress = 1
|
||||||
|
|
||||||
-- style
|
-- style
|
||||||
-- 0 = default
|
-- 0 = default
|
||||||
|
|
|
@ -5,8 +5,6 @@ return {
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
},
|
||||||
-- event = "BufWinEnter",
|
-- event = "BufWinEnter",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
@ -21,6 +19,12 @@ return {
|
||||||
progress = {
|
progress = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
|
hover = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
signature = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
|
@ -97,7 +101,8 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/cmp-cmdline",
|
"hrsh7th/cmp-cmdline",
|
||||||
event = "BufWinEnter",
|
-- event = "BufWinEnter",
|
||||||
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local mapping = {
|
local mapping = {
|
||||||
|
|
|
@ -2,7 +2,7 @@ return {
|
||||||
-- animations
|
-- animations
|
||||||
{
|
{
|
||||||
"echasnovski/mini.animate",
|
"echasnovski/mini.animate",
|
||||||
event = "VeryLazy",
|
event = "BufRead",
|
||||||
opts = function()
|
opts = function()
|
||||||
-- don't use animate when scrolling with the mouse
|
-- don't use animate when scrolling with the mouse
|
||||||
local mouse_scrolled = false
|
local mouse_scrolled = false
|
||||||
|
|
|
@ -10,91 +10,101 @@ if data_exists then
|
||||||
lspghost_text = custom_cmp.lspghost_text
|
lspghost_text = custom_cmp.lspghost_text
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
"hrsh7th/nvim-cmp",
|
{ "hrsh7th/cmp-nvim-lsp", event = "BufRead" },
|
||||||
version = false, -- last release is way too old
|
{ "hrsh7th/cmp-buffer", event = "BufRead" },
|
||||||
event = "InsertEnter",
|
{ "hrsh7th/cmp-path", event = "BufRead" },
|
||||||
dependencies = {
|
{ "saadparwaiz1/cmp_luasnip", event = "BufRead" },
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
{ "hrsh7th/cmp-nvim-lua", event = "BufRead" },
|
||||||
"hrsh7th/cmp-buffer",
|
{ "lukas-reineke/cmp-rg", enabled = cmprg }, -- experimental
|
||||||
"hrsh7th/cmp-path",
|
{ "hrsh7th/cmp-calc", enabled = cmpcalc }, -- experimental
|
||||||
"saadparwaiz1/cmp_luasnip",
|
{ "quangnguyen30192/cmp-nvim-tags", enabled = cmptag }, -- experimental
|
||||||
"hrsh7th/cmp-nvim-lua",
|
{
|
||||||
{ "lukas-reineke/cmp-rg", enabled = cmprg }, -- experimental
|
"hrsh7th/nvim-cmp",
|
||||||
{ "hrsh7th/cmp-calc", enabled = cmpcalc }, -- experimental
|
version = false, -- last release is way too old
|
||||||
{ "quangnguyen30192/cmp-nvim-tags", enabled = cmptag }, -- experimental
|
event = "InsertEnter",
|
||||||
},
|
-- dependencies = {
|
||||||
opts = function()
|
-- "hrsh7th/cmp-nvim-lsp",
|
||||||
local cmp = require("cmp")
|
-- "hrsh7th/cmp-buffer",
|
||||||
local luasnip = require("luasnip")
|
-- "hrsh7th/cmp-path",
|
||||||
|
-- "saadparwaiz1/cmp_luasnip",
|
||||||
|
-- "hrsh7th/cmp-nvim-lua",
|
||||||
|
-- { "lukas-reineke/cmp-rg", enabled = cmprg }, -- experimental
|
||||||
|
-- { "hrsh7th/cmp-calc", enabled = cmpcalc }, -- experimental
|
||||||
|
-- { "quangnguyen30192/cmp-nvim-tags", enabled = cmptag }, -- experimental
|
||||||
|
-- },
|
||||||
|
opts = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
local check_backspace = function()
|
local check_backspace = function()
|
||||||
local col = vim.fn.col(".") - 1
|
local col = vim.fn.col(".") - 1
|
||||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = "menu,menuone,noinsert",
|
completeopt = "menu,menuone,noinsert",
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
require("luasnip").lsp_expand(args.body)
|
require("luasnip").lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.expandable() then
|
elseif luasnip.expandable() then
|
||||||
luasnip.expand()
|
luasnip.expand()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
elseif check_backspace() then
|
elseif check_backspace() then
|
||||||
fallback()
|
fallback()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, {
|
end, {
|
||||||
"i",
|
"i",
|
||||||
"s",
|
"s",
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
sources = cmp.config.sources({
|
||||||
sources = cmp.config.sources({
|
{ name = "nvim_lsp" },
|
||||||
{ name = "nvim_lsp" },
|
{ name = "luasnip" },
|
||||||
{ name = "luasnip" },
|
{ name = "buffer" },
|
||||||
{ name = "buffer" },
|
{ name = "path" },
|
||||||
{ name = "path" },
|
{ name = "nvim_lua" },
|
||||||
{ name = "nvim_lua" },
|
{ name = "rg" }, -- experimental
|
||||||
{ name = "rg" }, -- experimental
|
{ name = "calc" }, -- experimental
|
||||||
{ name = "calc" }, -- experimental
|
{ name = "tags" }, --experimental
|
||||||
{ name = "tags" }, --experimental
|
}),
|
||||||
}),
|
formatting = {
|
||||||
formatting = {
|
fields = { "kind", "abbr", "menu" },
|
||||||
fields = { "kind", "abbr", "menu" },
|
format = function(entry, vim_item)
|
||||||
format = function(entry, vim_item)
|
vim_item.kind = string.format("%s", require("user.icons")["kind"][vim_item.kind])
|
||||||
vim_item.kind = string.format("%s", require("user.icons")["kind"][vim_item.kind])
|
vim_item.menu = ({
|
||||||
vim_item.menu = ({
|
nvim_lsp = "(LSP)",
|
||||||
nvim_lsp = "(LSP)",
|
luasnip = "(Snippet)",
|
||||||
luasnip = "(Snippet)",
|
buffer = "(Buffer)",
|
||||||
buffer = "(Buffer)",
|
path = "(Path)",
|
||||||
path = "(Path)",
|
})[entry.source.name]
|
||||||
})[entry.source.name]
|
return vim_item
|
||||||
return vim_item
|
end,
|
||||||
end,
|
},
|
||||||
},
|
window = {
|
||||||
window = {
|
completion = cmp.config.window.bordered(),
|
||||||
completion = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered(),
|
},
|
||||||
},
|
experimental = {
|
||||||
experimental = {
|
ghost_text = lspghost_text,
|
||||||
ghost_text = lspghost_text,
|
native_menu = false,
|
||||||
native_menu = false,
|
},
|
||||||
},
|
}
|
||||||
}
|
end,
|
||||||
end,
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = "BufWinEnter",
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
},
|
},
|
||||||
|
@ -247,7 +247,7 @@ return {
|
||||||
-- for resize screen
|
-- for resize screen
|
||||||
{
|
{
|
||||||
"mrjones2014/smart-splits.nvim",
|
"mrjones2014/smart-splits.nvim",
|
||||||
event = "BufWinEnter",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("user.smartspit")
|
require("user.smartspit")
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -12,7 +12,7 @@ return {
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
-- dependencies = { "kyazdani42/nvim-web-devicons", opt = true },
|
-- dependencies = { "kyazdani42/nvim-web-devicons", opt = true },
|
||||||
event = "BufWinEnter",
|
event = "BufRead",
|
||||||
config = function()
|
config = function()
|
||||||
require("user.lualine")
|
require("user.lualine")
|
||||||
end,
|
end,
|
||||||
|
@ -48,7 +48,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
event = "BufWinEnter",
|
event = "BufRead",
|
||||||
config = function()
|
config = function()
|
||||||
require("user.bufferline")
|
require("user.bufferline")
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -13,3 +13,19 @@ if data_exists then
|
||||||
else
|
else
|
||||||
require("user.startify")
|
require("user.startify")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Disable statusline in dashboard
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "alpha",
|
||||||
|
callback = function()
|
||||||
|
-- store current statusline value and use that
|
||||||
|
local old_laststatus = vim.opt.laststatus
|
||||||
|
vim.api.nvim_create_autocmd("BufUnload", {
|
||||||
|
buffer = 0,
|
||||||
|
callback = function()
|
||||||
|
vim.opt.laststatus = old_laststatus
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.opt.laststatus = 0
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue