3

Well, this is not a Ubuntu specific question but here it is anyway. I'm using Vim 7.2 with Ubuntu 10.04. I installed Vim about a day ago using apt-get so it's not the default version you get with the system. Here's the problem, whenever I type text in to a text file in Vim's insert mode the comma character does not appear. No matter how many times I press the comma button it won't display it or add it to the text file. Is there something wrong with the character mapping in Vim? Any suggestions for fixing this?

4
  • Could you put both your .vimrc and the output of :verbose imap in a pastebin (see pastebin.com) and link it here?
    – frabjous
    Nov 1, 2010 at 4:30
  • pastebin.com/L1wMXqFu - .vimrc
    – Dananjaya
    Nov 1, 2010 at 12:23
  • :verbose imap - No mapping found
    – Dananjaya
    Nov 1, 2010 at 12:27
  • Could you please include that pastebin content in the question? We want questions to not depend on external pastes that will inevitably die.
    – Roger Pate
    Nov 1, 2010 at 16:03

3 Answers 3

6

Your cinkeys setting is malformed:

set cinkeys=0{,0},:,0#,!,!^F

See :help cinkeys-format for details, but the ! requires something to follow it, which is interpreted as the comma, rather than being an entry of just "!". Because the ! means not to insert the key, the comma is discarded.

Removing the line from your .vimrc (which uses the default value) or removing the rogue exclamation mark item will work:

set cinkeys=0{,0},:,0#,!^F
1
  • Yes yes yes, the answer with the "cinkeys" solved this problem! You should delete the "!," two chars from your vimrc. set cinkeys=0{,0},:,0#,<b>!,</b>!^F Case Ubuntu 10.10 you can find it here: /etc/vim/
    – user9464
    Jan 23, 2011 at 19:46
3

Well I think I figured it out.. removing the following line at .vimrc file solved the issue

set cinkeys=0{,0},:,0#,!,!^F
1

This might help you: https://stackoverflow.com/questions/1242026/vim-comma-is-missing-in-insert-mode

3
  • Typing CTRL-V just after typing comma will insert a comma, but isn't there a much easier way of typing that? I also have a manually created .vimrc file.
    – Dananjaya
    Nov 1, 2010 at 3:55
  • I don't know much about this. I just pointed you to a resource. Maybe you should ask this on StackOverflow.
    – User
    Nov 1, 2010 at 4:04
  • stackoverflow.com/questions/1165603/vim-comma-key-not-working might help you too.
    – User
    Nov 1, 2010 at 4:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .