Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backspace in Terminal Vim (Cygwin)

I'm running a default cygwin install on Windows 8 and can not get the Backspace key to delete characters - I'm expecting the character to be overwritten with a blank when I backspace.

I've tried

set backspace=2 "
set backspace=indent,eol,start
:fixdel

nothing seems to work.

Both :verbose imap <BS> and :verbose imap ^H return No mapping found

like image 979
Warrick FitzGerald Avatar asked Oct 26 '13 01:10

Warrick FitzGerald


People also ask

How do you backspace in Cygwin?

When pressing the backspace key Cygwin, interprets it as a space. Luckily, the problem is rather easy to fix. The easiest way (which did not work everytime while testing) is to simply reinstall terminfo and termcap via setup.exe, as mentioned here: Backspace does not work in Cygwin.

What is backspace in vim?

vi/vim editor FAQ: What is the vi/vim backspace key? In Vim, you delete the character under the cursor using the 'x' key while in command mode (which is the equivalent of a [delete] key), and to delete characters to the left of the cursor -- which is the equivalent of a vim backspace key -- use the capital letter 'X'.

How do I open Vim editor in Cygwin?

In Cygwin Vi or Vim text editor not come by default if the case it installed and not working properly then we need to reinstall it . Before step forward check the vi is installed or not by using vi command only. If the output showing command not found , we have to install a fresh copy in cygwin.

What is Cygwin?

Cygwin is a collection of open source tools that allows Unix or Linux applications to be compiled and run on a Microsoft Windows operating system (OS) from within a Linux-like interface.


2 Answers

Add these settings together:

:set nocompatible
:set backspace=2
like image 142
Alexander Shukaev Avatar answered Oct 11 '22 13:10

Alexander Shukaev


Recently I’ve experienced a weird behavior in a Cygwin installation on Windows 7. When pressing the backspace key Cygwin, interprets it as a space.

Luckily, the problem is rather easy to fix. The easiest way (which did not work everytime while testing) is to simply reinstall terminfo and termcap via setup.exe, as mentioned here: Backspace does not work in Cygwin. If you don’t have termcap installed install it but make sure to reinstall terminfo properly too. At best this is all you need to do to get your backspace back again.

If not, you might need to remove .bashrc from your home folder, e.g. /cygwin/home/you/.bashrc. Then, just to make sure reinstall terminfo and termcap again. This always worked for me.

Enjoy your backspace :)

like image 28
Jobet Samuel Avatar answered Oct 11 '22 13:10

Jobet Samuel