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