un-indenting doesn't work with vim

Andrew DeFaria Andrew@DeFaria.com
Thu Jul 17 16:47:00 GMT 2008


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/



More information about the Cygwin mailing list