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.
10 lines
300 B
Lua
10 lines
300 B
Lua
if vim.g.loaded_http_codes then
|
|
return
|
|
end
|
|
vim.g.loaded_http_codes = 1
|
|
|
|
vim.api.nvim_create_user_command('HTTPCodes', function()
|
|
require('http-codes').pick()
|
|
end, {})
|
|
|
|
vim.keymap.set('n', '<Plug>(http-codes-pick)', function() require('http-codes').pick() end, { desc = 'Pick HTTP status code' })
|