I have a few :cabbrev mappings that I use frequently, like :qq as a shortcut for :q!.

Recently I installed a nifty plugin and these abbreviations no longer triggered with Enter, although Space would still activate them. It turns out that the plugin rebinds <CR> in command mode to a function that does some work then returns a string <CR>, which is presumably interpreted as a keystroke, although I do not know why. However, the "keystroke" is not triggering abbreviations.

Is this a Vim bug, or does the extra <CR> need to be triggered some other way? I would like to keep the plugin if possible, but I really like my abbreviations.


You can trigger expansion of abbreviations by pressing Ctrl-]. So perhaps you can add the CTRL-] in front of the mapping of the Enter key.

Read the help at :h i_CTRL-] and :h c_CTRL-]

Also you should probably create an issue for that on the plugins repository.

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