From 7d10d909fac3c09a1b9fd69abc2a3e47a6fd4d9d Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Wed, 17 Apr 2024 09:46:59 +0700 Subject: [PATCH] docs(vim): Note for myself on how to do lazy loading --- .config/nvim/lua/null/plug.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/null/plug.lua b/.config/nvim/lua/null/plug.lua index 17bab1a..f2a614f 100644 --- a/.config/nvim/lua/null/plug.lua +++ b/.config/nvim/lua/null/plug.lua @@ -1,3 +1,4 @@ +-- << Getting lazy.nvim for the first time local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ @@ -10,6 +11,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then }) end vim.opt.rtp:prepend(lazypath) +-- >> require("lazy").setup({ { @@ -17,5 +19,11 @@ require("lazy").setup({ opts = {}, dependencies = { "nvim-tree/nvim-web-devicons" }, }, - "tpope/vim-commentary", -- shortcut to comment a line + { + "tpope/vim-commentary", -- shortcut to comment a line + cmd = "StartupTime", -- Note to self: lazy load on command + init = function() + -- Note to self: init is called during startup. Configuration for vim plugins typically should be set in an init function + end, + }, })