Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vim

backspace

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?

like image 209
Grace Shao Avatar asked Jan 13 '12 00:01

Grace Shao


2 Answers

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
like image 93
Paul Simpson Avatar answered Sep 21 '22 20:09

Paul Simpson


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.

like image 33
Grace Shao Avatar answered Sep 20 '22 20:09

Grace Shao