4

there is a strange Phenomenon of my vim(gvim).
just as i said in title, when i press enter, it'll show ^M at lower right. and disappear after about 1sec, then it'll act as it should be. as if it's the first charactor of some "multi-charactor" command.

here are some lines in my vimrc.
au FileType * nnoremap <buffer> <CR> <C-]>
let mapleader = "\<space>"
set encoding=utf-8
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set fileencodings=utf-8,ucs-bom,chinese
set ffs=unix,dos,mac

can someone tell me how to fix it?

thanks for Pinpin. but my problem occurs in normal mode.

thanks for any help :)

sillypenguin
  • 129
  • 2
  • 7
  • 1
    Have you seen this **[post](http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/)** about odd ^M characters? – Pippin Dec 04 '13 at 05:16
  • yes, i've seen it. but it's not the problem i met. my problem occurs in normal mode. when i press enter in insert mode, it doesn't show the ^M charcactor. – sillypenguin Dec 04 '13 at 06:20
  • Does the behavior go away if you do `vim -u NONE`? – jthill Dec 04 '13 at 06:31
  • yes, it's gone. does this mean this occured because one of my plugin? – sillypenguin Dec 04 '13 at 06:39
  • i tried "-u NORC" "--noplugin". and it seem to be some command in my vimrc caused it. – sillypenguin Dec 04 '13 at 07:01
  • i found the reason. there some nnoremap maps in my vimrc.which i meant to be map CTRL+m. thanks, @jthill ,can you answer this question so that i can choose your answer? – sillypenguin Dec 04 '13 at 07:22

1 Answers1

3

For internal reasons, <C-M> is the same as <CR> (or <Enter>). The reason that Vim briefly displays the key in the bottom right corner is that it is waiting for further keys (and you have :set showcmd), because you have a mapping that begins with Enter.

:nmap <CR>

(or :nmap <C-m>) will list it. To avoid the delay, you need to get rid of it / choose another key for it.

Community
  • 1
  • 1
Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324