Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: generated vimdoc #383

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions doc/legendary.txt
Original file line number Diff line number Diff line change
@@ -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*
Expand Down Expand Up @@ -58,6 +58,9 @@ FEATURES *legendary-features*
`legendary.nvim`
- Integration with which-key.nvim <https://github.com/folke/which-key.nvim>,
use your existing `which-key.nvim` tables with `legendary.nvim`
- Integration with lazy.nvim <https://github.com/folke/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
Expand Down Expand Up @@ -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' }
}
Expand All @@ -142,7 +153,43 @@ With `vim-plug`:
QUICKSTART *legendary-quickstart*


Register keymaps through setup:
If you use lazy.nvim <https://github.com/folke/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({
Expand Down Expand Up @@ -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
Expand Down