If we set a keymap that {lhs}
is abc in normal mode. For example,
local opts = { noremap = true, silent = true }
vim.keymap.set('n', 'abc', function() print("Keymap abc!"), opts)
If we type abc
in normal mode, where is the abc
stored? Can we access it?
abc
is typed.ab
we just typed to be ready for triggering the map when we typec
. I guess that there may be somewhere neovim "memorizes/stores"ab
. Maybeab
is "memorized/stored" in some kind of "register" like mark register (e.g.,ma
marked in registera
), yank register (e.g.,"ay
yanked in registera
), or recording register (e.g.,qa
recorded in registera
)? My goal is to access that "register", and I hope it can be used in the function part ofvim.keymap.set()
.vim.keymap.set()
setting, I would like that the function take, e.g., (if we typeabc
)c
inabc
to do some process in the function, and (if we typeabd
)d
to do the other process in the same function. Wait. So I have to set forabc
andabd
separately?ab
and in your function callgetchar()
to get the next character and act upon this