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.
<c-m>inserts Carriage Return /CR (Enter) (and<c-j>, a newline (NL) ). See:h CTRL-Mand:h i_CTRL-M, or this answer: http://superuser.com/questions/433903/how-to-type-carriage-return – VanLaser Feb 15 '16 at 21:54