For example, I've mapped inoremap ( (), and if I do iabbrev if if(then it will expand to if(then) instead of if()then (the inoremap is executed after the iabbrev). Is it possible to make iabbrev ignore my custom keymappings so I can make iabbrev if if()then correctly expand to if()then?

1 Answer 1


inoreabbrev (insert-mode non-recursive abbreviation) is the command that will ignore custom mappings when executing the abbreviations.

To remove abbreviations without leaving vim use iunabbrev [lhs]. Now inoreabbrev if if()then should work correctly.

  • 1
    Thank you! It totally works. And also do you happen to know if there's any way to ignore custom mappings when editing macros (like let @q = 'gg')?
    – tga
    Commented Aug 26, 2018 at 14:20
  • let @q = 'gg' just sets the contents of the q-register, so it depends how you run the macro. I thought :normal! @q would work but apparently not, never tried it, so temporary fix could be :normal! <C-r>q to directly insert the contents of the q-register used for the macro and run ignoring remappings. Commented Aug 28, 2018 at 3:45

Your Answer

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

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