Skip to content

Commit

Permalink
feat: vimdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Aug 22, 2024
1 parent cacce44 commit 25b3d91
Show file tree
Hide file tree
Showing 5 changed files with 334 additions and 94 deletions.
143 changes: 143 additions & 0 deletions doc/lz.n.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
==============================================================================
*lz.n*

M.register_handler() *M.register_handler*


M.trigger_load({plugins}) *M.trigger_load*
Accepts plugin names (`string | string[]`, when called in another
plugin's hook), or |lz.n.Plugin| items (when called by a |lz.n.Handler|).
If called with a plugin name, it will use the registered
handlers' `lookup` functions to search for a plugin to load
(loading the first one it finds).
Once a plugin has been loaded, it will be removed from all handlers (via `del`).
As a result, calling `trigger_load` with a plugin name is idempotent.

Parameters: ~
{plugins} (string|lz.n.Plugin|string[]|lz.n.Plugin[])


M.load() *M.load*
@overload fun(spec: lz.n.Spec)
@overload fun(import: string)


M.lookup({name}) *M.lookup*
Lookup a plugin that is pending to be loaded by name.

Parameters: ~
{name} (string) @return lz.n.Plugin?


==============================================================================
lz.n type definitions *lz.n.types*

lz.n.PluginBase *lz.n.PluginBase*

Fields: ~
{enabled?} (boolean|fun():boolean)
Whether to enable this plugin. Useful to disable plugins under certain conditions.
{priority?} (number)
Only useful for lazy=false plugins to force loading certain plugins first.
Default priority is 50
{load?} (fun(name:string))
Set this to override the `load` function for an individual plugin.
Defaults to `vim.g.lz_n.load()`, see |lz.n.Config|.


lz.n.Event *lz.n.Event*

Type: ~
{id:string,event:string[]|string,pattern?:string[]|string}


lz.n.EventSpec *lz.n.EventSpec*

Type: ~
string|{event?:string|string[],pattern?:string|string[]}|string[]


lz.n.PluginHooks *lz.n.PluginHooks*

Fields: ~
{beforeAll?} (fun(self:lz.n.Plugin)) Will be run before loading any plugins
{before?} (fun(self:lz.n.Plugin)) Will be run before loading this plugin
{after?} (fun(self:lz.n.Plugin)) Will be executed after loading this plugin


lz.n.PluginHandlers *lz.n.PluginHandlers*

Fields: ~
{event?} (lz.n.Event[])
{keys?} (lz.n.Keys[])
{cmd?} (string[])
{colorscheme?} (string[])


lz.n.PluginSpecHandlers *lz.n.PluginSpecHandlers*

Fields: ~
{event?} (string|lz.n.EventSpec[])
Load a plugin on one or more |autocmd-events|.
{cmd?} (string[]|string)
Load a plugin on one or more |user-commands|.
{ft?} (string[]|string)
Load a plugin on one or more |FileType| events.
{keys?} (string|string[]|lz.n.KeysSpec[])
Load a plugin on one or more |key-mapping|s.
{colorscheme?} (string[]|string)
Load a plugin on one or more |colorscheme| events.


lz.n.KeysBase : vim *lz.n.KeysBase*


lz.n.KeysSpec : lz *lz.n.KeysSpec*


lz.n.Keys : lz *lz.n.Keys*


lz.n.Plugin : lz *lz.n.Plugin*


lz.n.PluginSpec : lz *lz.n.PluginSpec*


lz.n.SpecImport *lz.n.SpecImport*
The plugin name (not its main module), e.g. "sweetie.nvim"
@field [1] string

Fields: ~
{import} (string) spec module to import
{enabled?} (boolean|fun():boolean)


lz.n.Spec *lz.n.Spec*

Type: ~
lz.n.PluginSpec|lz.n.SpecImport|lz.n.Spec[]


lz.n.Config *lz.n.Config*

Fields: ~
{load?} (fun(name:string))
Callback to load a plugin.
Takes the plugin name (not the module name). Defaults to |packadd| if not set.


lz.n.Handler *lz.n.Handler*

Fields: ~
{spec_field} (string)
The |lz.n.PluginSpec| field used to configure this handler.
{add} (fun(plugin:lz.n.Plugin))
Add a plugin to this handler.
{del} (fun(name:string))
Remove a plugin from this handler by name.
{lookup} (fun(name:string):lz.n.Plugin)
Lookup a plugin by name.


vim:tw=78:ts=8:noet:ft=help:norl:
Loading

0 comments on commit 25b3d91

Please sign in to comment.