diff --git a/README.md b/README.md index 1cf5dfb..d11af3c 100644 --- a/README.md +++ b/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 diff --git a/lua/weeheavy/lazy.lua b/lua/weeheavy/lazy.lua index 6f88a1c..63a08ed 100644 --- a/lua/weeheavy/lazy.lua +++ b/lua/weeheavy/lazy.lua @@ -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) diff --git a/lua/weeheavy/plugins/devicons.lua b/lua/weeheavy/plugins/devicons.lua index 7e5b654..e8af518 100644 --- a/lua/weeheavy/plugins/devicons.lua +++ b/lua/weeheavy/plugins/devicons.lua @@ -1,4 +1,5 @@ return { - "nvim-tree/nvim-web-devicons", - lazy = true + "nvim-tree/nvim-web-devicons", + lazy = true, + event = "VeryLazy", } diff --git a/lua/weeheavy/plugins/indent-blankline.lua b/lua/weeheavy/plugins/indent-blankline.lua index 7ba49b3..2a9d50b 100644 --- a/lua/weeheavy/plugins/indent-blankline.lua +++ b/lua/weeheavy/plugins/indent-blankline.lua @@ -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, } diff --git a/lua/weeheavy/plugins/lualine.lua b/lua/weeheavy/plugins/lualine.lua index 89c8286..94726ae 100644 --- a/lua/weeheavy/plugins/lualine.lua +++ b/lua/weeheavy/plugins/lualine.lua @@ -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 = "" }, + }, + }, } diff --git a/lua/weeheavy/plugins/oil.lua b/lua/weeheavy/plugins/oil.lua index a1a0286..f22ad26 100644 --- a/lua/weeheavy/plugins/oil.lua +++ b/lua/weeheavy/plugins/oil.lua @@ -2,6 +2,8 @@ -- https://github.com/stevearc/oil.nvim return { "stevearc/oil.nvim", + lazy = true, + cmd = "Oil", dependencies = { "nvim-tree/nvim-web-devicons", }, diff --git a/lua/weeheavy/plugins/telescope.lua b/lua/weeheavy/plugins/telescope.lua index bf8c8da..506a2db 100644 --- a/lua/weeheavy/plugins/telescope.lua +++ b/lua/weeheavy/plugins/telescope.lua @@ -1,5 +1,8 @@ return { "nvim-telescope/telescope.nvim", + lazy = true, + --event = "VeryLazy", + cmd = "Telescope", tag = "0.1.5", dependencies = { "nvim-lua/plenary.nvim", diff --git a/lua/weeheavy/plugins/which-key.lua b/lua/weeheavy/plugins/which-key.lua index 4c7438a..938cf8a 100644 --- a/lua/weeheavy/plugins/which-key.lua +++ b/lua/weeheavy/plugins/which-key.lua @@ -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. + }, + }, }