VIM comma missing in insert mode

I am starting VIM and I have a strange problem. I started using vim in a terminal emulator, but today I switched to gVim. Then I realized that I can not write a comma in Insert mode! I tried :map , :imap , both said no matching was found. THEN I tried :nomap , and :inomap , and with no luck. When writing commands, I can write a comma, but not in insert mode. What is the problem?


Some details: I am running the newly installed ubuntu 9.04 system with an English keyboard, but using the Hungarian layout. I can write a comma in vim when writing to vim "command line" after pressing: in command mode.

+4
source share
4 answers

Well, I managed to solve it. I used to use mkvimrc to create my .vimrc. Now I deleted it all and created one manually. Not sure what caused this, but now it works as expected. Moral: do not be lazy, write your vimrc yourself. :)

+2
source

remove the line "cindent" from your .vimrc file. worked for me!

+10
source

What happens if you type CTRL-V followed by a comma in insert mode? Do you get a comma?

Also, since you only have this problem in gvim, not vim, try running xev and typing into it to see if the events look odd. (you may need apt-get install x11-utils for xev) The events I get look like this:

 KeyPress event, serial 30, synthetic NO, window 0x4000001, root 0x236, subw 0x0, time 788140933, (138,120), root:(144,139), state 0x10, keycode 59 (keysym 0x2c, comma), same_screen YES, XLookupString gives 1 bytes: (2c) "," XmbLookupString gives 1 bytes: (2c) "," XFilterEvent returns: False KeyRelease event, serial 30, synthetic NO, window 0x4000001, root 0x236, subw 0x0, time 788141013, (138,120), root:(144,139), state 0x10, keycode 59 (keysym 0x2c, comma), same_screen YES, XLookupString gives 1 bytes: (2c) "," XFilterEvent returns: False 
+2
source

Do you have something like this in your .vimrc set cinkeys=0{,0},:,0#,!,!^F ? I ran into this problem and solved it by removing the rogue exclamation mark set cinkeys=0{,0},:,0#,!^F

+1
source

All Articles