lazy loading

This commit is contained in:
Oliver Ladner 2024-01-24 08:28:20 +01:00
commit ba56bab172
8 changed files with 77 additions and 67 deletions

View file

@ -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

View file

@ -1,4 +1,5 @@
return { return {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
lazy = true lazy = true,
event = "VeryLazy",
} }

View file

@ -1,14 +1,16 @@
return { return {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
lazy = true,
event = { "BufReadPre", "BufNewFile" },
main = "ibl", main = "ibl",
opts = {}, opts = {},
config = function() config = function()
local indent = require('ibl').setup { local indent = require("ibl").setup({
-- disable scope highlighting as it requires some tuning -- disable scope highlighting as it requires some tuning
scope = { enabled = false }, scope = { enabled = false },
indent = { indent = {
char = '' char = "",
}, },
} })
end end,
} }

View file

@ -1,15 +1,17 @@
-- status line like vim-airline -- status line like vim-airline
return { return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
lazy = true,
event = { "BufReadPre", "BufNewFile" },
opts = { opts = {
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = 'auto', theme = "auto",
--component_separators = '⋮', --component_separators = '⋮',
component_separators = '', component_separators = "",
--section_separators = { left = '', right = '' }, --section_separators = { left = '', right = '' },
--section_separators = { left = '', right = '' }, --section_separators = { left = '', right = '' },
section_separators = { left = '', right = '' }, section_separators = { left = "", right = "" },
}, },
}, },
} }

View file

@ -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",
}, },

View file

@ -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",

View file

@ -1,6 +1,6 @@
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
@ -20,5 +20,5 @@ return {
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.
}, },
} },
} }