I want to set a keymap for all modes (i.e. vim.api.nvimsetkeymap({'v', 'n','i' }, ' o',…
- User
I want to set a keymap for all modes (i.e.
vim.api.nvim_set_keymap({'v', 'n','i' }, ' o', function () WHAT HERE end)). Is it possible to call this from lua? Doing justvim.cmd("normal! <C-o>")doesn't work Assistant
In Neovim Lua, you can set keymaps for multiple modes using
vim.keymap.set(). Here's how you can do it:vim.keymap.set({'n', 'v', 'i', 'c'}, '<leader>o', function() vim.cmd.normal('o') -- This is the preferred Lua way to execute normal mode commands end, { noremap = true, silent = true })If you specifically want to jump in the jumplist, you can use:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.