2

I want to map Ctrl-M to go to the last autocompletion word. Currently, Ctrl-P does this. In my .vimrc:

inoremap <c-m> <c-p>

And this adds the functionality I want.

However, if I'm in insert mode and hit Enter, this also triggers the autocompletion.

Happens in both macVim and CLI vim.

muru
  • 24,838
  • 8
  • 82
  • 143
  • 1
    In Vim (or in terminal), <c-m> inserts Carriage Return /CR (Enter) (and <c-j>, a newline (NL) ). See :h CTRL-M and :h i_CTRL-M, or this answer: http://superuser.com/questions/433903/how-to-type-carriage-return – VanLaser Feb 15 '16 at 21:54

0 Answers0