How can I fix my delete key in VIM over ssh?

How can I fix my delete key in VIM over ssh? (Mac OS X)

  • When I use VIM in the terminal on my local machine (Mac OS X Snow Leopard), the delete key is really backspace (i.e., destructive backspace). When I SSH into a particular server, for some reason it's regular delete (i.e., delete the character under the cursor). How can I change it to be consistent? I've tried a dozen solutions, but nothing seems to work. Checking the "Delete sends Ctrl-H" box in Terminal Preferences->Advanced doesn't work -- this is non-destructive backspace. I've tried about a hundred different key mappings in VIM, to no avail. Interestingly, the key works as expected when I'm typing commands in VIM (e.g., : <something>) -- it's only screwed up when I'm editing the actual text. Any ideas?

  • Answer:

    Try adding set <Del>=<C-v><Del> to the vimrc on the target machine. Here you must type <C-v><Del> while being logged on the target machine. If this does not work, check verbose imap <Del>: this should tell you whether some plugin has remapped <Del> in insert mode.

Aeonaut at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

Couple of ideas to try: In your .vimrc file, add this line: set term=linux In your .bash_profile file (or whatever corresponds to your shell of choice): stty erase ^H Note: to make this work correctly, you must type ctrl-v, then ctrl-h to type the ^H character. Also, make sure "Delete sends Ctrl-H" is checked in your Terminal prefs.

Phoenix

well I think stack over flow is good but can make people lazy some times...None of the solutions above help me so I used my old friend google and I solved it: just follow what this: http://www.alecjacobson.com/weblog/?p=295

Majic Johnson

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.