1

In my _vimrc, Say I have a keybinding like this:

noremap gm f<Space>a{{c<Esc>0ylfcpa::<Esc>A}}<Esc>2F{

And another keybinding like this:

noremap m3 mckmbkma2j

I have tested both in normal Vim and they work fine

At a lower part of the _vimrc file, is it possible to do something like:

noremap g3 m3gm

I tried this and it doesn't execute properly.

Perhaps there is some kind of substitution I need to do that I'm not aware of. Could someone point me to that concept, if any?

Thanks!

1 Answer 1

1

Yes. It's possible to do what I was trying to do above.

To do so, one needs to understand the difference between noremap and map in Vim.

It works when I use map but not when I use noremap.

map is recursive while noremap is not.

1
  • 1
    I would likely use nnoremap and nmap for Normal-mode only mappings, and you might be interested in <buffer> if these are only relevant for a specific filetype
    – D. Ben Knoble
    Sep 17, 2022 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.