10

I didn't change any setting of my Vim, but today the Backspace gets some crazy behavior. Every time when I hit it, it does not delete a character, but prints ^?. Anyone knows what is going on?

Grace Huang
  • 5,355
  • 5
  • 30
  • 52
  • What OS? Whst do you have in your .vimrc (can you put it down somewhere?) – Rook Jan 13 '12 at 02:50
  • Try to remove all the plugins and `.vimrc` and then look again to Backspace behavior. Is it changed? If yes, then you can at least find the reason by method of exclusion. – Dmitry Frank Jan 13 '12 at 09:02
  • @ldigas I login to Linux from a Mac via Terminal. `.vimrc` actually sources from a standard vimrc of my company. There is no recent change for this `.vimrc` source. @dimonomid Thank you! I just took it out. Still no luck. This may tell me that this problem may not come from the linux terminal. – Grace Huang Jan 13 '12 at 17:04
  • Ok I logged to the Linux box directly and the vim worked just fine. That means the problem comes from the communication between the Mac and the Linux. – Grace Huang Jan 13 '12 at 17:11

3 Answers3

20

Not sure why it would randomly start doing this based on the information you gave, but trying adding this line to your .vimrc

set backspace=start,eol,indent
Paul Simpson
  • 2,504
  • 16
  • 28
16

The problem comes from the communication between Mac Terminal the Linux Terminal.

Go to the Mac Terminal -> Preferences -> Advanced tab, check the option "Delete sends Ctrl-H". Then after I login to Linux, and Backspace works just fine in Vim.

Grace Huang
  • 5,355
  • 5
  • 30
  • 52
0

In Mac Mavricks and Yosemite Open a terminal, then command+, for preferences, click on the profile tab, click on the -keyboard- menu, then add +

Key: very bottom, <= Delete
Modifier: ^ Control
Action: Send Text
Text: H

click Ok

ppostma1
  • 3,616
  • 1
  • 27
  • 28