docs(vim): Note for myself on how to do lazy loading

This commit is contained in:
Ahmad Ansori Palembani 2024-04-17 09:46:59 +07:00
parent 57e226d2db
commit 7d10d909fa
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -1,3 +1,4 @@
-- << Getting lazy.nvim for the first time
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
@ -10,6 +11,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
}) })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
-- >>
require("lazy").setup({ require("lazy").setup({
{ {
@ -17,5 +19,11 @@ require("lazy").setup({
opts = {}, opts = {},
dependencies = { "nvim-tree/nvim-web-devicons" }, 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,
},
}) })