lazy loading
This commit is contained in:
parent
a309c7703e
commit
ba56bab172
8 changed files with 77 additions and 67 deletions
20
README.md
20
README.md
|
|
@ -29,30 +29,30 @@ macOS 14.0 (23A344).
|
||||||
|
|
||||||
### Start and open init.lua
|
### Start and open init.lua
|
||||||
|
|
||||||
Around 10% of the plugins are lazy-loaded.
|
Around 25% of the plugins are lazy-loaded.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Startuptime: 79.91ms
|
Startuptime: 100.58ms
|
||||||
|
|
||||||
Based on the actual CPU time of the Neovim process till UIEnter.
|
Based on the actual CPU time of the Neovim process till UIEnter.
|
||||||
This is more accurate than `nvim --startuptime`.
|
This is more accurate than `nvim --startuptime`.
|
||||||
LazyStart 11.53ms
|
LazyStart 11.04ms
|
||||||
LazyDone 46.36ms (+34.83ms)
|
LazyDone 25.69ms (+14.65ms)
|
||||||
UIEnter 79.91ms (+33.55ms)
|
UIEnter 100.58ms (+74.89ms)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Starting with an empty file
|
### Starting with an empty file
|
||||||
|
|
||||||
Around 50% of the plugins are lazy-loaded.
|
Around 75% of the plugins are lazy-loaded.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Startuptime: 47.58ms
|
Startuptime: 32.31ms
|
||||||
|
|
||||||
Based on the actual CPU time of the Neovim process till UIEnter.
|
Based on the actual CPU time of the Neovim process till UIEnter.
|
||||||
This is more accurate than `nvim --startuptime`.
|
This is more accurate than `nvim --startuptime`.
|
||||||
LazyStart 11.16ms
|
LazyStart 10.71ms
|
||||||
LazyDone 41.83ms (+30.67ms)
|
LazyDone 25.36ms (+14.65ms)
|
||||||
UIEnter 47.58ms (+5.75ms)
|
UIEnter 32.31ms (+6.95ms)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Plugins
|
## Plugins
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
-- Lazy package manager
|
-- Lazy package manager
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--filter=blob:none",
|
"--filter=blob:none",
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
"--branch=stable", -- latest stable release
|
"--branch=stable", -- latest stable release
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
return {
|
return {
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
lazy = true
|
lazy = true,
|
||||||
|
event = "VeryLazy",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
return {
|
return {
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
main = "ibl",
|
lazy = true,
|
||||||
opts = {},
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
config = function()
|
main = "ibl",
|
||||||
local indent = require('ibl').setup {
|
opts = {},
|
||||||
-- disable scope highlighting as it requires some tuning
|
config = function()
|
||||||
scope = { enabled = false },
|
local indent = require("ibl").setup({
|
||||||
indent = {
|
-- disable scope highlighting as it requires some tuning
|
||||||
char = '│'
|
scope = { enabled = false },
|
||||||
},
|
indent = {
|
||||||
}
|
char = "│",
|
||||||
end
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,17 @@
|
||||||
-- status line like vim-airline
|
-- status line like vim-airline
|
||||||
return {
|
return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
opts = {
|
lazy = true,
|
||||||
options = {
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
icons_enabled = true,
|
opts = {
|
||||||
theme = 'auto',
|
options = {
|
||||||
--component_separators = '⋮',
|
icons_enabled = true,
|
||||||
component_separators = '⁞',
|
theme = "auto",
|
||||||
--section_separators = { left = '', right = '' },
|
--component_separators = '⋮',
|
||||||
--section_separators = { left = '', right = '' },
|
component_separators = "⁞",
|
||||||
section_separators = { left = '', right = '' },
|
--section_separators = { left = '', right = '' },
|
||||||
},
|
--section_separators = { left = '', right = '' },
|
||||||
},
|
section_separators = { left = "", right = "" },
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
-- https://github.com/stevearc/oil.nvim
|
-- https://github.com/stevearc/oil.nvim
|
||||||
return {
|
return {
|
||||||
"stevearc/oil.nvim",
|
"stevearc/oil.nvim",
|
||||||
|
lazy = true,
|
||||||
|
cmd = "Oil",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
|
lazy = true,
|
||||||
|
--event = "VeryLazy",
|
||||||
|
cmd = "Telescope",
|
||||||
tag = "0.1.5",
|
tag = "0.1.5",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,24 @@
|
||||||
return {
|
return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
event = "VeryLazy",
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
init = function()
|
init = function()
|
||||||
vim.o.timeout = true
|
vim.o.timeout = true
|
||||||
vim.o.timeoutlen = 250
|
vim.o.timeoutlen = 250
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
layout = {
|
layout = {
|
||||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||||
spacing = 3, -- spacing between columns
|
spacing = 3, -- spacing between columns
|
||||||
align = "left", -- align columns left, center or right
|
align = "left", -- align columns left, center or right
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
border = "none", -- none, single, double, shadow
|
border = "none", -- none, single, double, shadow
|
||||||
position = "bottom", -- bottom, top
|
position = "bottom", -- bottom, top
|
||||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size.
|
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size.
|
||||||
padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left]
|
padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left]
|
||||||
winblend = 1, -- value between 0-100 0 for fully opaque and 100 for fully transparent
|
winblend = 1, -- value between 0-100 0 for fully opaque and 100 for fully transparent
|
||||||
zindex = 1000, -- positive value to position WhichKey above other floating windows.
|
zindex = 1000, -- positive value to position WhichKey above other floating windows.
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue