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 #387

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
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
52 changes: 32 additions & 20 deletions doc/legendary-lua-api.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
*legendary-lua-api.txt* Last change: 2022 December 17
*legendary-lua-api.txt* Last change: 2023 June 27

==============================================================================
Table of Contents *legendary-lua-api-table-of-contents*

Binding Keymaps, Commands, Autocmds, and Functions |legendary-lua-api-binding-keymaps,-commands,-autocmds,-and-functions|
Repeat Last Item ........................ |legendary-lua-api-repeat-last-item|
Converting Keymaps From Vimscript |legendary-lua-api-converting-keymaps-from-vimscript|

==============================================================================
Expand Down Expand Up @@ -106,19 +107,32 @@ BINDING KEYMAPS, COMMANDS, AUTOCMDS, AND FUNCTIONS*legendary-lua-api-binding-key
})
-- filter keymaps by normal mode
require('legendary').find({
filters = require('legendary.filters').mode('n')
filters = require('legendary.filters').mode('n'),
})
-- filter keymaps by normal mode and that start with <leader>
require('legendary').find({
filters = {
require('legendary.filters').mode('n'),
function(item)
return require('legendary.toolbox').is_keymap(item) and vim.startswith(item[1], '<leader>')
end
}
end,
},
})
<

------------------------------------------------------------------------------
REPEAT LAST ITEM *legendary-lua-api-repeat-last-item*


You can repeat the previous item selected from `legendary.nvim`'s finder. By
default, it only executes the item if the previous set of item filters used to
select the item still returns `true`. You can ignore this with a parameter.

>lua
require('legendary').repeat_previous()
require('legendary').repeat_previous(--[[ ignore_filters: ]] true)
<

------------------------------------------------------------------------------
CONVERTING KEYMAPS FROM VIMSCRIPT*legendary-lua-api-converting-keymaps-from-vimscript*

Expand All @@ -130,22 +144,20 @@ Keymaps can be parsed from Vimscript commands (e.g. `vnoremap <silent>
-- Function signature
require('legendary.toolbox').table_from_vimscript(vimscript_str, description)
-- For example
require('legendary.toolbox').table_from_vimscript(
':vnoremap <silent> <expr> <leader>f :SomeCommand<CR>',
'Description of my keymap'
)
-- Returns the following table
{
'<leader>f',
':SomeCommand<CR>',
description = 'Description of my keymap',
mode = 'v',
opts = {
silent = true,
expr = true,
remap = false,
},
}
require('legendary.toolbox')
.table_from_vimscript(':vnoremap <silent> <expr> <leader>f :SomeCommand<CR>', 'Description of my keymap')
-- Returns the following table
({
'<leader>f',
':SomeCommand<CR>',
description = 'Description of my keymap',
mode = 'v',
opts = {
silent = true,
expr = true,
remap = false,
},
})
<

vim:tw=78:ts=8:ft=help:norl:
9 changes: 8 additions & 1 deletion doc/legendary.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*legendary.txt* Last change: 2023 June 23
*legendary.txt* Last change: 2023 June 27

==============================================================================
Table of Contents *legendary-table-of-contents*
Expand Down Expand Up @@ -318,6 +318,13 @@ Commands:

" search autocmds
:Legendary autocmds

" repeat the last item executed via legendary.nvim's finder;
" by default, only executes if the last set of item filters used still returns `true`
:LegendaryRepeat

" repeat the last item executed via legendary.nvim's finder, ignoring the filters used
:LegendaryRepeat!
<
Lua API:

Expand Down
1 change: 1 addition & 0 deletions doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ legendary-keymap-tables-table-of-contents legendary-keymap-tables.txt /*legendar
legendary-keymap-tables.txt legendary-keymap-tables.txt /*legendary-keymap-tables.txt*
legendary-legendary.nvim legendary.txt /*legendary-legendary.nvim*
legendary-lua-api-lua-api legendary-lua-api.txt /*legendary-lua-api-lua-api*
legendary-lua-api-repeat-last-item legendary-lua-api.txt /*legendary-lua-api-repeat-last-item*
legendary-lua-api-table-of-contents legendary-lua-api.txt /*legendary-lua-api-table-of-contents*
legendary-lua-api.txt legendary-lua-api.txt /*legendary-lua-api.txt*
legendary-mapping-development-composition legendary-mapping-development.txt /*legendary-mapping-development-composition*
Expand Down