Closed MrZLeo closed 1 year ago
Lazy.nvim can lazy load plugins with various methods, cmd is just one of it. You can set lazy = true
to lazy load plugin by lua modules, which means it's only loaded with you call require
.
Also note that if you don't want to change the default configs, you don't need to call setup at all.
{ "cshuaimin/ssr.nvim", lazy = true },
Lazy.nvim can lazy load plugins with various methods, cmd is just one of it. You can set
lazy = true
to lazy load plugin by lua modules, which means it's only loaded with you callrequire
.Also note that if you don't want to change the default configs, you don't need to call setup at all.
{ "cshuaimin/ssr.nvim", lazy = true },
Yes, I choose lazy = true
right now. But, as far as I am concerned, I need to :Lazy load ssr.nvim
to activate the plugin. What I truly want is load this at some point that I really use ssr.nvim
.
You don’t need to call “:Lazy load”, the plugin will be loaded when you require it in keymap function.
vim.keymap.set({ "n", "x" }, "<leader>sr", function() require("ssr").open() end)
You don’t need to call “:Lazy load”, the plugin will be loaded when you require it in keymap function.
vim.keymap.set({ "n", "x" }, "<leader>sr", function() require("ssr").open() end)
Understand! It's good to know: ) Thanks!
I think I need a command like
Lazy
orMason
forssr.nvim
in order to lazy load this plugin withlazy.nvim
.This is what I want to do:
cmd
is the event that trigger loading of this plugin, so I can load it when I need it.Please consider it as a feature. Thanks!