Create Neovim `:map`pings in Lua with ease!
This is the first stable release of nvim-cartographer. It features significant performance improvements, thanks to changes in Neovim's vim.api.nvim_set_keymap
function which allow a function to be mapped natively. As such, the cartographer.callbacks
module has been removed entirely, though this makes it so that users have to update to Neovim 0.7
The time that the plugin takes to initialize has been improved. This comes with a swath of readability enhancements for any maintainers.
As well, if you are on Neovim 0.7 or later, you will be able to use the builtin Lua callback registration from nvim_set_keymap
instead of the handbaked one I wrote. It is much more performant!
This release was due in large part to the efforts of @shadmansaleh. I would like to thank him again for noting the absence of these features and working to add them.
map.v.n
).map.buffer
for buffer 0, map.buffer5
for buffer 5)map.n['<Tab>'] = function() end
)map.z = '<Cmd>echo "Hello"<CR>'
) doing nothingThis release features even more simple syntax when compared to the previous. You can now :map
without calling a function:
local map = require 'cartographer'
-- This is the old syntax; still valid
map().n.nore.silent['jk'] = '<Esc>'
-- This is the new syntax
map.n.nore.silent['jk'] = '<Esc>'
This version includes all initial features, including:
map().x.expr['<Tab>'] = '<Cmd>Foo<CR>'
nvim_set_keymap
.