feat: add <Plug> mappings (#10)
Some checks are pending
ci / changes (push) Waiting to run
ci / lua-format (push) Blocked by required conditions
ci / lua-lint (push) Blocked by required conditions
ci / lua-typecheck (push) Blocked by required conditions
quality / changes (push) Waiting to run
quality / Lua Format Check (push) Blocked by required conditions
quality / Lua Lint Check (push) Blocked by required conditions
quality / Lua Type Check (push) Blocked by required conditions
quality / Markdown Format Check (push) Blocked by required conditions

## 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:
Barrett Ruth 2026-02-07 14:04:18 -05:00 committed by GitHub
commit 2475bcd6b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -16,6 +16,17 @@ USAGE *:HTTPCodes*
:HTTPCodes
<
===============================================================================
MAPPINGS *http-codes-mappings*
*<Plug>(http-codes-pick)*
<Plug>(http-codes-pick) Open the HTTP status code picker.
Equivalent to |:HTTPCodes|.
Example configuration: >lua
vim.keymap.set('n', '<leader>hc', '<Plug>(http-codes-pick)')
<
===============================================================================
CONFIGURATION *vim.g.http_codes*

View file

@ -6,3 +6,7 @@ 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' })