docs: update lazy.plugins syntax

This commit is contained in:
Pei Yang Ching 2024-10-17 17:17:18 +02:00
commit 256a8cf62c

View file

@ -136,30 +136,29 @@ plugins are managed by `lz.n`.
let let
cfg = config.vim.your-plugin; cfg = config.vim.your-plugin;
in { in {
vim.lazy.plugins = [ vim.lazy.plugins.your-plugin = {
{ # instead of vim.startPlugins, use this:
# instead of vim.startPlugins, use this: package = "your-plugin";
package = "your-plugin";
# if your plugin uses the `require('your-plugin').setup{...}` pattern # if your plugin uses the `require('your-plugin').setup{...}` pattern
setupModule = "your-plugin"; setupModule = "your-plugin";
inherit (cfg) setupOpts; inherit (cfg) setupOpts;
# events that trigger this plugin to be loaded # events that trigger this plugin to be loaded
events = ["DirChanged"]; events = ["DirChanged"];
cmd = ["YourPluginCommand"]; cmd = ["YourPluginCommand"];
# keymaps # keymaps
keys = [ keys = [
# we'll cover this in detail in the keymaps section # we'll cover this in detail in the keymaps section
{ {
key = "<leader>d"; key = "<leader>d";
mode = "n"; mode = "n";
action = ":YourPluginCommand"; action = ":YourPluginCommand";
} }
] ];
} };
]; ;
} }
``` ```