Grace Huang
Grace Huang

Reputation: 5709

Odd behavior of backspace in Vim (SSH to Linux from Mac)

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?

Upvotes: 10

Views: 7587

Answers (3)

ppostma1
ppostma1

Reputation: 3676

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

Upvotes: 0

Grace Huang
Grace Huang

Reputation: 5709

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.

Upvotes: 16

Paul Simpson
Paul Simpson

Reputation: 2514

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

Upvotes: 20

Related Questions