0

I'm sorry, for some reason I'm having a lot of trouble figuring out how to map my backspace button to Ctrl+H in my vimrc file. I've looked a lot online, and haven't found anything that seems to work.

Any help is much appreciated.

Fabrizio
  • 7,603
  • 6
  • 44
  • 104
Mason
  • 6,893
  • 15
  • 71
  • 115

2 Answers2

1

You should check your terminal type, and set your $TERM to correct value. It's not a good idea to use map in vim to work around this issue.

Lifu Tang
  • 1,271
  • 9
  • 11
  • Maybe you can have a look of these two pages: http://www.helpdesk.umd.edu/topics/applications/terminal/tera_term/1105/ and http://www.ibb.net/~anne/keyboard.html – Lifu Tang Oct 13 '11 at 05:32
0

This worked for me:

:imap ^H <Left><Del>

So does:

:imap ^H <BS>
GWW
  • 43,129
  • 11
  • 115
  • 108
  • Neither of those have worked for me. I'm running Ubuntu 64 bit. Any idea why that wouldn't work? – Mason Oct 13 '11 at 04:41
  • 1
    What mode are you trying to use the mapping in? insert mode? – GWW Oct 13 '11 at 04:42
  • Yeah. I've tried every combination of ^h, , and . I'm putting them in my .vimrc file, no luck. – Mason Oct 13 '11 at 04:44
  • 1
    If you are putting them in your `.vimrc` don't include the `:` at the front. But you still didn't answer my question, are you trying to use the key binding in insert mode? normal mode? visual mode? – GWW Oct 13 '11 at 04:48
  • Insert mode, I think. (Whatever the mode is after you hit "a" to edit) – Mason Oct 13 '11 at 04:50
  • 1
    Hmm, that's very strange. Try typing `:verbose imap ^H` while in `vim` and let me know what it says. – GWW Oct 13 '11 at 04:51
  • `i ^H Last set from ~/.vimrc Press ENTER or type command to continue` – Mason Oct 13 '11 at 04:55