mappy.nvim is a simple wrapper around vim.keymap.set for nightly builds or vim.api.nvim_set_keymap for stable builds function. Supports tables.
use({"shift-d/mappy.nvim"})- Telescope picker to view your mappings
- Stable-compatible
- Nested mappings
- Multiple modes
- which-key.nvim integration
- Register mappings based on event
versionparam creates an alias formappy:stableormappy:nightlyfunction. By default mappy:map is a placeholder function. Accepts either"nightly"or"stable"
require("mappy")({
version = "stable" | "nightly"
})Use mappy:new() to create a default module.
local module = require("mappy"):new()module:set_maps({
lhs = rhs,
nested_ = {
_lhs = rhs,
}
})module:set_opts({
modes = "modechar" | { "mode", "char" },
map = {...} -- Look at the docs of map function's api
})module:set_event("VimEvent") -- see :h eventsNote that mappy:set_maps function should be called before.
module:map()Stable mode is using vim.api.nvim_set_keymap function to set mappings. Useful for 6.1 and previous versions of neovim.
module:stable()Nightly mode is using vim.keymap.set function to set mappings. Neovim nightly is required. (probably will included in next stable release of neovim)
module:nightly()Requirements:
mappy:set_eventcalledconfig.versionset
-- storage is a name for table with event map. must be different for every call.
module:event_map(storage)module:map({
lhs = description,
nested_ = {
_lhs = description
}
})mappy:link()