delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/17/12:47:26

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: un-indenting doesn't work with vim
Date: Thu, 17 Jul 2008 09:46:27 -0700
Lines: 82
Message-ID: <g5nt16$215$1@ger.gmane.org>
References: <f68d89470807110553k2bc71311p799af2cc02e99af8 AT mail DOT gmail DOT com> <20080711130135 DOT GO24644 AT calimero DOT vinschen DOT de> <f68d89470807160249t7ccd06e5o90e0ff5a606819df AT mail DOT gmail DOT com> <g5l5cg$doi$1 AT ger DOT gmane DOT org> <20080716155746 DOT GR24644 AT calimero DOT vinschen DOT de> <g5mm98$sl4$1 AT ger DOT gmane DOT org> <17393e3e0807170141v6dcc5088kc1d23ab59653a24e AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
In-Reply-To: <17393e3e0807170141v6dcc5088kc1d23ab59653a24e@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Matt Wozniski wrote:
> On Thu, Jul 17, 2008 at 1:45 AM, Andrew DeFaria wrote:
>> Corinna Vinschen wrote:
>>> WFM, but the behaviour is not identical to Ctrl-D. It doesn't use 
>>> the shiftwidth for one thing.
>> English woman! English!
> Respectful.
Huh? Your response make no sense!
>> Stated differently, on some versions of vim on some OSes, after 
>> hitting return while in insert mode with autoindent on I am indented. 
>> Now I know of Ctl-d. Still on some machines backspace backspaces and 
>> goes backward and on other machines, OSes, etc. while in vim and 
>> after hitting return in input mode after indenting by a tab, 
>> backspace does nothing but beep at me! This is yet another reason why 
>> I prefer Emacs over vi or vim.
> Stated differently, if you didn't understand what Corinna said, you 
> should have looked it up.
Looked what up? I understand every word she said. What I didn't 
understand was the thought she was trying to convey.
>> I must say, Unix/Linux or other such OSes, I have experienced the 
>> most times when hitting the frigging backspace space rarely goes 
>> backward by one character! Solaris/Sun's OSes are the worse culprit. 
>> Most Linux'es and Cygwin seem to "Do the right thing" most of the 
>> times. Rarely does backspace not perform a backspace on Windows.
>>
>> You dudes/dudettes need to get your S together WRT the frigging 
>> backspace key! How frigging hard is it?
> Not very hard if you take the time to learn a bit about terminals. 
> <BS> on a UNIX keyboard either sends ^? or ^H. 
You apparently ain't getting it! It is only in Unix that often the 
backspace key does not perform the function of moving backward a space 
and deleting the previously character. I have never, I repeat never had 
backspace not do a back space except under Unix - have you?
> If you have "set backspace=indent,eol,start" (or, equivalently, "set 
> backspace=2") in your ~/.vimrc, vim will correctly delete over 
> automatically inserted indentation when it recognizes that you've 
> pressed the backspace key.
Yes, except I put that in my ~/.vimrc and hitting backspace doesn't do that.
> This option wasn't in the original vi, which can't be made to delete 
> over indentation. It's not turned on by default in vim, either, 
> because vim aims for vi compatibility out of the box, and assumes that 
> if you want vim behaviors rather than vi behaviors, then you know what 
> those behaviors are and can take the time to figure out how to turn 
> them on.
Great. What exactly turns them on? Because putting set 
backspace=indent,eol,start didn't do it.
> OTOH, if vim isn't recognizing your piece-of-plastic backspace key as 
> sending the backspace code it expects, be it ^? or ^H, then your 
> terminfo on the server is wrong for the terminal you connect to it 
> with, and one needs to be reconfigured for the correct backspace info.
Backspace backspaces on the bash command line, it just doesn't function 
to backspace past an autoindent.
> Either way, the problem is with your setup, not a fundamental flaw 
> with the way the developers have designed things. 
The mere fact that vim has things like fixdel points to the fundamental 
flaw that I was alluding to and that is that it often doesn't work in 
Unix thus requiring kludges like fixdel. In fact it was spoke about here 
on this very list http://www.cygwin.com/ml/cygwin/2000-04/msg00482.html
> It's no one's problem but your own if you won't take the time to learn 
> about things you don't understand.
I've done more research, learning and understanding in my life than you 
can imagine. I'm not the only one who is confused and fighting this 
problem. Do a little bit of research on your own and you'll quickly 
realize that many, many people struggle with how inconsistently and 
confusingly the backspace key is handled. Indeed having two definitions 
for one key is fundamentally flawed. Having backspace work at the 
command line but not in the editor is fundamentally flawed. Having it 
work at the command line but screwing up when you do a search in more(1) 
is bad. Having it not work when you're typing in a password is bad. This 
treating of backspace differently by various programs and not having it 
do what the word on the keycap states is broken - period!

Seems like my problem was I had a set t_kb=^? in my .vimrc as well as 
the aforementioned fixdel. Indeed the mere fact that I included such 
things in my .vimrc indicate that I was having problems with backspace 
not doing a backspace. I assume that the ^? isn't the two characters ^ 
and ? and I forget how to generate that anymore. In any event I found 
http://www.stripey.com/vim/terminals.html which says to do "execute 'set 
t_kb=' . nr2char(8)". This seems to be working now.
-- 
Andrew DeFaria <http://defaria.com>
COFFEE.EXE Missing - Insert Cup and Press Any Key


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019