feat: add <Plug> mappings
Problem: users who want keybindings must wrap commands in closures. There is no stable public API for key binding. Solution: define <Plug> mappings in the plugin file and document them in a new MAPPINGS section in the vimdoc.
This commit is contained in:
parent
4dc650957b
commit
97a6fb2bd7
2 changed files with 24 additions and 0 deletions
|
|
@ -40,3 +40,11 @@ vim.api.nvim_create_autocmd('OptionSet', {
|
|||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local cmds = require('diffs.commands')
|
||||
vim.keymap.set('n', '<Plug>(diffs-gdiff)', function()
|
||||
cmds.gdiff(nil, false)
|
||||
end, { desc = 'Unified diff (horizontal)' })
|
||||
vim.keymap.set('n', '<Plug>(diffs-gvdiff)', function()
|
||||
cmds.gdiff(nil, true)
|
||||
end, { desc = 'Unified diff (vertical)' })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue