This also happens when copying and pasting. I am attempting to edit Go code and typing or copying and pasting "package main" comes out as "pkage main". No idea why I can't type a c. Pressing delete backspace prints out a ^? and pressing delete actually deletes a character. I tried restarting it but I have no idea how else to troubleshoot this and I could find nothing online.
Possible Cause 1:
If c works normally everywhere such that this problem only affects Vim, it could be that there may be an abbreviation or mapping set up for c. Examine your
I just temporarily turned my c into backspace in Vim in the normal, command, normal and insert modes:
:map c ^? :nmap c ^? :imap c ^?
^? denotes the result of typing Ctrl-VBackspace.)
Possible Cause 2:
c as the erase character in your TTY. That is to say, as if the following command had been executed:
stty erase c
However, this would also affect other programs and shells. Try
in your shell to reset the TTY parameters to some reasonable default settings. This is a useful command to remember; it comes in handy when some visual program unexpectedly dies, leaving the TTY settings in an inappropriate state.
Sounds like something garbled in the paste process.
When you paste to any other editor, does it work or just the same? If it is the same, then perhaps the source was already garbled to begin with.
If other editors paste fine, then, try the clipboard paste shortcut:
If you are copying from the other app using merely selecting with your mouse, you should use instead:
If you still find oddities, try:
:set pasteto enter vim's paste mode.
- then try the above paste shortcuts
- When you want to turn off paste mode for any reason just
Copying and pasting in the console works in the way that the text is inserted char by char, and Vim interpretes each char to mean something.
When using Vim, make sure you're in --INSERT-- mode, and not command mode. In Command mode, a 'c' means change, and for example, if you type ce, Vim'll delete till the end of the word and enter Insert mode.
'^' stands for Command. ^C means Ctrl+C. That's the console, not the Vim editor itself. You'll get a similar character If you press Ctrl-(something) or the Escape key.
All the standard navigation keys(such as Home, Delete, PgUp/PgDn, arrow keys), are included in modern Vi as a backup. It's for users who prefer not to use/find it hard to use x or d or the hjkl scroll keys.