Re: delete lines

2006-08-10 Thread Jochen Baier

Zitat von Tim Chase <[EMAIL PROTECTED]>:


:nnoremap  X


with this I cannot cross lines (delete $ between line  and line
 coming from line  while backspacing and it is not possible to
delete the last (or in other words the first char after ^ ) char of a
line.



Something perhaps like

:nnoremap  i

might do the trick.  One edge-case I found with this one is if you're 
on a blank line and use backspace, you delete the backspace, but end 
up on the last character of the previous line, thus if you have



abcd
X

with the cursor on the "X", and hit backspace, you end up on top of 
the "d" on the previous line (rather than "after" it).  Thus, hitting 
backspace again will leave you with "abd" instead of "abc" as one 
would normally want.


Haven't yet found a good solution to that one.

-tim



hi,

you may try my script:

cr-bs-del-space-tab.vim
http://www.vim.org/scripts/script.php?script_id=1579

it will enable Return,Backspace,Del,Space and Tab key in Normal mode.

regards jochen






Re: delete lines

2006-08-10 Thread Tim Chase

:nnoremap  X


with this I cannot cross lines (delete $ between line  and line
 coming from line  while backspacing and it is not possible to
delete the last (or in other words the first char after ^ ) char of a
line.



Something perhaps like

:nnoremap  i

might do the trick.  One edge-case I found with this one is if 
you're on a blank line and use backspace, you delete the 
backspace, but end up on the last character of the previous line, 
thus if you have



abcd
X

with the cursor on the "X", and hit backspace, you end up on top 
of the "d" on the previous line (rather than "after" it).  Thus, 
hitting backspace again will leave you with "abd" instead of 
"abc" as one would normally want.


Haven't yet found a good solution to that one.

-tim





Re: delete lines

2006-08-10 Thread Meino Christian Cramer
From: Tim Chase <[EMAIL PROTECTED]>
Subject: Re: delete lines
Date: Thu, 10 Aug 2006 13:22:27 -0500

> > is it also possible to enable the backspace key in normal mode --
> > the delete key is working in normal, so why should I miss the 
> > backspace key ?
> 
> 
> :nnoremap  X
> 
> (all typed literally with greater-than and less-than signs included)
> 
> should do the trick.
> 
> -tim
> 
> 
> 

with this I cannot cross lines (delete $ between line  and line
 coming from line  while backspacing and it is not possible to
delete the last (or in other words the first char after ^ ) char of a
line.

...and after a while the cursor jumps:

Suppose there are lines n til n+5

all lines are filled with ascii-chars.

enter normal mode

goto line 's $

Hit backspace until there is one char /undeleteabnle this way) left
goto line 's $ 
hit backspace
--> the cursor jumps to the last (one and only lonely) char in line


damn is that complicate to use backspace in vim...hadn't exspected
that... ;)

Any other trick ?

-mcc


Re: delete lines

2006-08-10 Thread Tim Chase

is it also possible to enable the backspace key in normal mode --
the delete key is working in normal, so why should I miss the 
backspace key ?



:nnoremap  X

(all typed literally with greater-than and less-than signs included)

should do the trick.

-tim





Re: delete lines

2006-08-10 Thread Meino Christian Cramer
From: "Christian J. Robinson" <[EMAIL PROTECTED]>
Subject: Re: delete lines
Date: Thu, 10 Aug 2006 12:00:45 -0600 (MDT)

Hi,

> Today (Thu, 10 Aug 2006), Ben lemasurier wrote:
> 
> > And then I decide that I want to remove $blah2, so I start to press
> > backspace from here:
> > 
> > fucntion foo() {
> >$blah;
> >$blah2; <- cursor here
> > }
> > 
> > and then when I get to the beginning of the line, it stops. Can I
> > make it so that it will follow up to the end of $blah on the
> > previous line?
> 
> Try ":set backspace+=eol" -- see ":help 'backspace'".
> 
> - Christian
> 
> -- 
>   "They that can give up essential liberty to obtain a little temporary
>safety deserve neither liberty nor safety."  -- Ben Franklin
> Christian J. Robinson <[EMAIL PROTECTED]> http://infynity.spodzone.com/
>PGP keys: 0x893B0EAF / 0xFB698360   http://infynity.spodzone.com/pgp
> 

is it also possible to enable the backspace key in normal mode --
the delete key is working in normal, so why should I miss the 
backspace key ?

:)


mcc


Re: delete lines

2006-08-10 Thread Christian J. Robinson
Today (Thu, 10 Aug 2006), Ben lemasurier wrote:

> And then I decide that I want to remove $blah2, so I start to press
> backspace from here:
> 
> fucntion foo() {
>$blah;
>$blah2; <- cursor here
> }
> 
> and then when I get to the beginning of the line, it stops. Can I
> make it so that it will follow up to the end of $blah on the
> previous line?

Try ":set backspace+=eol" -- see ":help 'backspace'".

- Christian

-- 
  "They that can give up essential liberty to obtain a little temporary
   safety deserve neither liberty nor safety."  -- Ben Franklin
Christian J. Robinson <[EMAIL PROTECTED]> http://infynity.spodzone.com/
   PGP keys: 0x893B0EAF / 0xFB698360   http://infynity.spodzone.com/pgp


RE: delete lines

2006-08-10 Thread Max Dyckhoff
The problem is your setting of backspace. It sounds like currently bs is
equal to "indent,start" or something similar. You need
"indent,start,eol". The easiest way to do this is simply put this in
your .vimrc file:

:set bs=2

That should do it!

Max

> -Original Message-
> From: Ben lemasurier [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 10, 2006 10:51 AM
> To: vim@vim.org
> Subject: delete lines
> 
> Hey everyone,
> 
> Is there a way to make it so that when I am editing something like
this:
> 
> 
> function foo() {
>$blah;
>$blah2;
> }
> 
> And then I decide that I want to remove $blah2, so I start to press
> backspace from here:
> 
> fucntion foo() {
> $blah;
> $blah2; <- cursor here
> }
> 
> and then when I get to the beginning of the line, it stops. Can I make
> it so that it will follow up to the end of $blah on the previous line?
> 
> thanks!
> 
> Ben


Re: delete lines

2006-08-10 Thread Tim Chase

And then I decide that I want to remove $blah2, so I start to press
backspace from here:

fucntion foo() {
$blah;
$blah2; <- cursor here
}

and then when I get to the beginning of the line, it stops. Can I make
it so that it will follow up to the end of $blah on the previous line?



Sounds like you want to tweak your 'backspace' option.

:set backspace

should tell you what it currently is.

:help 'backspace'

should describe what's available in how backspace behaves with 
regards to various conditions.


You likely want to have a line in your vimrc that looks something 
like


set backspace=indent,eol,start

that will allow you to backspace over all three categories of 
things that might not otherwise be backspace-over-able. :)


-tim