Defining a keymap via vim.keymap.set
local function dog() end
vim.keymap.set('n', '<Leader>dog', dog)
then :redir > keymap.txt | nmap | redir END
will output all the normal keymaps.
Then I find that in keymap.txt
n <Space>pc * <Cmd>lua require("conf.builtin_extend").ping_cursor()<CR>
n <Space>dog * <Lua function 3>
n <Space>tc * :tabclose<CR>
The keymaps defined via vimL is practical useful: I know the content of a keymap/what it is doing.
But I completely don’t know what <Leader>dog
is doing as it is only showing me a lua function.
In pratical use, I use Telescope keymaps
to quickly find the keymaps I want (if forget the keymap but remember what it does). And now with the new API it is not easy to do that.