Skip to main content
edited tags
Link
derobert
  • 113.2k
  • 20
  • 242
  • 289
Source Link
mtk
  • 28.6k
  • 35
  • 100
  • 131

vim backspace not working normally

The Backspace key is not working as expected in vim and also in vi. It is working as the Delete key, and Delete key is deleting the char, but instead something wierd happens. But, for now, I am trying to get the Backspace key working.

I tried few solution by googling and searching unix.se, but none helped. I tried adding

:map~ ^? ^H

to .exrc file. Also tried adding following function from this link, later mapping the correct key-sequence as given, but even that didn't help solve the issue.

func Backspace()
  if col('.') == 1
    if line('.')  != 1
      return  "\<ESC>kA\<Del>"
    else
      return ""
    endif
  else
    return "\<Left>\<Del>"
  endif
endfunc

###vim details

VIM - Vi IMproved 7.0 (2006 May 7, compiled Jun 12 2009 07:09:20)

Machine

$ cat /etc/*release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

###Note:

  1. I connect to a remote unix machine using putty connection manager.
  2. Shift+Backspace works as normal Backspace key works i.e. delete a character to the left.