Firstly, I use these code to keymap sth.
local keymap = vim.api.nvim_set_keymap
local opts = {noremap = true, silent = true}
local function map(mode, shortcut, command)
keymap(mode, shortcut, command, opts)
end
local function nmap(shortcut, command)
map("", shortcut, command)
end
nmap("n", "h")
nmap("e", "j")
nmap("u", "k")
nmap("i", "l")
Then when I use the snippet, it doesn’t work properly.
When I click n/e/u/i
, just expand/narrow the selecting scope,Like the visual mode. But I just want to input n/e/u/i
.
Maybe I missed sth. So how to resovle this problem? Thanks.