feat: add <Plug> mappings (#27)
## Problem Users who want keybindings must call Lua functions directly or 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
a59bec1ae3
commit
26dafe2f08
2 changed files with 32 additions and 3 deletions
|
|
@ -14,3 +14,13 @@ end, { nargs = '?' })
|
|||
vim.api.nvim_create_user_command('LiveServerToggle', function(opts)
|
||||
require('live-server').toggle(opts.args)
|
||||
end, { nargs = '?' })
|
||||
|
||||
vim.keymap.set('n', '<Plug>(live-server-start)', function()
|
||||
require('live-server').start()
|
||||
end, { desc = 'Start live server' })
|
||||
vim.keymap.set('n', '<Plug>(live-server-stop)', function()
|
||||
require('live-server').stop()
|
||||
end, { desc = 'Stop live server' })
|
||||
vim.keymap.set('n', '<Plug>(live-server-toggle)', function()
|
||||
require('live-server').toggle()
|
||||
end, { desc = 'Toggle live server' })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue