From 3bec8ea93188d25e0b176c1ba62080ecf28a032f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <> Date: Fri, 23 Jun 2023 11:09:21 +0000 Subject: [PATCH] chore: generated vimdoc --- doc/legendary.txt | 56 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/doc/legendary.txt b/doc/legendary.txt index 58d17aa6..18d3176b 100644 --- a/doc/legendary.txt +++ b/doc/legendary.txt @@ -1,4 +1,4 @@ -*legendary.txt* Last change: 2023 June 01 +*legendary.txt* Last change: 2023 June 23 ============================================================================== Table of Contents *legendary-table-of-contents* @@ -58,6 +58,9 @@ FEATURES *legendary-features* `legendary.nvim` - Integration with which-key.nvim , use your existing `which-key.nvim` tables with `legendary.nvim` +- Integration with lazy.nvim , + automatically load keymaps defined via `lazy.nvim`'s `keys` property on + plugin specs - Execute normal, insert, and visual mode keymaps, commands, autocommands, and Lua functions when you select them - Show your most recently executed items at the top when triggered via @@ -116,12 +119,20 @@ With `lazy.nvim`: { 'mrjones2014/legendary.nvim', version = 'v2.1.0', + -- since legendary.nvim handles all your keymaps/commands, + -- its recommended to load legendary.nvim before other plugins + priority = 10000, + lazy = false, -- sqlite is only needed if you want to use frecency sorting -- dependencies = { 'kkharji/sqlite.lua' } } -- or, to get rolling updates { 'mrjones2014/legendary.nvim', + -- since legendary.nvim handles all your keymaps/commands, + -- its recommended to load legendary.nvim before other plugins + priority = 10000, + lazy = false, -- sqlite is only needed if you want to use frecency sorting -- dependencies = { 'kkharji/sqlite.lua' } } @@ -142,7 +153,43 @@ With `vim-plug`: QUICKSTART *legendary-quickstart* -Register keymaps through setup: +If you use lazy.nvim for your plugin +manager, `legendary.nvim` can automatically register keymaps defined via the +`keys` property of `lazy.nvim` plugin specs. This lets you keep your +plugin-specific keymaps where you define the plugin, and `legendary.nvim` +automatically detects them. For example: + +>lua + -- in a plugin spec: + { + 'folke/flash.nvim', + keys = { + { + 's', + function() + require('flash').jump() + end, + mode = { 'n', 'x', 'o' }, + desc = 'Jump forwards', + }, + { + 'S', + function() + require('flash').jump({ search = { forward = false } }) + end, + mode = { 'n', 'x', 'o' }, + desc = 'Jump backwards', + }, + }, + } + + -- where you set up legendary.nvim + -- now the keymaps from the `flash.nvim` plugin spec will be automatically loaded + require('legendary').setup({ lazy_nvim = { auto_register = true } }) +< +Otherwise, register keymaps, commands, autocmds, and functions through setup, +including opting into _extensions_ which can automatically load keymaps and +commands from other plugins: >lua require('legendary').setup({ @@ -413,6 +460,11 @@ doc/table_structures/README.md <./doc/table_structures/README.md>. max_timestamps = 10, }, }, + lazy_nvim = { + -- Automatically register keymaps that are defined on lazy.nvim plugin specs + -- using the `keys = {}` property. + auto_register = false, + }, which_key = { -- Automatically add which-key tables to legendary -- see ./doc/WHICH_KEY.md for more details