1010==============================================================================
1111Introduction *lua-plugin*
1212
13- This document provides guidance for developing Nvim ( Lua) plugins:
13+ This document provides guidance for developing Nvim Lua plugins.
1414
1515See | lua-guide | for guidance on using Lua to configure and operate Nvim.
1616See | luaref | and | lua-concepts | for details on the Lua programming language.
@@ -19,7 +19,7 @@ See |luaref| and |lua-concepts| for details on the Lua programming language.
1919Creating your first plugin *lua-plugin-new*
2020
2121Any Vimscript or Lua code file that lives in the right directory,
22- automatically is a "plugin". There's no maniest or "registration" required .
22+ automatically is a "plugin". There's no manifest or "registration" step .
2323
2424You can try it right now:
2525
@@ -35,7 +35,7 @@ You can try it right now:
3535
3636Besides `plugin /foo.lua ` , which is always run at startup, you can define Lua
3737modules in the `lua /` directory. Those modules aren't loaded until your
38- `plugin /foo.lua ` , the user, calls `require (…)` .
38+ `plugin /foo.lua ` , or the user, calls `require (…)` .
3939
4040==============================================================================
4141Type safety *lua-plugin-type-safety*
@@ -108,11 +108,11 @@ In your plugin:
108108>lua
109109 vim.keymap.set('n', '<Plug> (SayHello)', function()
110110 print('Hello from normal mode')
111- end, { noremap = true } )
111+ end)
112112
113113 vim.keymap.set('v', '<Plug> (SayHello)', function()
114114 print('Hello from visual mode')
115- end, { noremap = true } )
115+ end)
116116<
117117In the user's config:
118118>lua
@@ -176,7 +176,9 @@ For example, instead of:
176176 local foo = require('foo' )
177177 vim.api.nvim_create_user_command('MyCommand', function()
178178 foo.do_something()
179- end, { -- ... })
179+ end, {
180+ -- ...
181+ })
180182<
181183which calls `require (' foo' )` as soon as the module is loaded, you can
182184lazy-load it by moving the `require` into the command's implementation:
@@ -227,7 +229,7 @@ A plugin tailored to Rust development might have initialization in
227229 -- e.g. add a | <Plug> | mapping or create a command
228230 vim.keymap.set('n', '<Plug> (MyPluginBufferAction)', function()
229231 print('Hello')
230- end, { noremap = true, buffer = bufnr, })
232+ end, { buffer = bufnr, })
231233<
232234==============================================================================
233235Configuration *lua-plugin-config*
@@ -274,7 +276,7 @@ Versioning and releases *lua-plugin-versioning*
274276Consider:
275277
276278- Use | vim.deprecate() | or a `--- @d eprecate` annotation when you need to
277- communicate a (future) breaking change or discourged practice.
279+ communicate a (future) breaking change or discouraged practice.
278280- Using SemVer https://semver.org/ tags and releases to properly communicate
279281 bug fixes, new features, and breaking changes.
280282- Automating versioning and releases in CI.
@@ -299,7 +301,9 @@ VERSIONING TOOLS
299301Documentation *lua-plugin-doc*
300302
301303Provide vimdoc (see | help-writing | ), so that users can read your plugin's
302- documentation in Nvim, by entering `:h {plugin} ` in | command-mode | .
304+ documentation in Nvim, by entering `:h {plugin} ` in | command-mode | . The
305+ help-tags (the right-aligned "search keywords" in the help documents) are
306+ regenerated using the | :helptags | command.
303307
304308DOCUMENTATION TOOLS
305309
0 commit comments