Re: switch the line above the cursor and the line below the cursor

2010-05-06 Thread BC
On May 5, 3:45 am, Jürgen Krämer wrote: > > I didn't write this, nor did I even quote this. Thas was written by > Christian Brabandt. > Oops. Sorry for the careless cut and paste. - BC -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text

Re: switch the line above the cursor and the line below the cursor

2010-05-06 Thread Ben Fritz
On May 5, 11:57 pm, Vladimir Rybas wrote: > > Just curious...in what sorts of cases is such a command actually > > useful? > > I use it often. Actually, I'm not switching lines, but moving visually > selected blocks up & down, left & right. > It's faster than cut & paste or whatever. Here's my m

Re: switch the line above the cursor and the line below the cursor

2010-05-05 Thread Vladimir Rybas
> > Just curious...in what sorts of cases is such a command actually > useful? > I use it often. Actually, I'm not switching lines, but moving visually selected blocks up & down, left & right. It's faster than cut & paste or whatever. Here's my mapping on that " Move visually selected blocks of t

Re: switch the line above the cursor and the line below the cursor

2010-05-05 Thread Jürgen Krämer
Hi, BC wrote: > > > On May 4, 2:28 am, Jürgen Krämer wrote: > >> Ok, this is cheating, since you are actually changing the current line: >> :call setline(line('.')-1, reverse(getline(line('.')-1, line('.')+1))) > >> This will fail, if you are on the last or first line of a buffer. I didn't

Re: switch the line above the cursor and the line below the cursor

2010-05-04 Thread BC
On May 4, 2:28 am, Jürgen Krämer wrote: > Ok, this is cheating, since you are actually changing the current line: > :call setline(line('.')-1, reverse(getline(line('.')-1, line('.')+1))) > This will fail, if you are on the last or first line of a buffer. or alternatively, you could even use a

Re: switch the line above the cursor and the line below the cursor

2010-05-04 Thread sc
On Tuesday 04 May 2010 11:46:46 am Ben Fritz wrote: > On May 3, 11:13 pm, BC wrote: > > I thought the question was how to swap the line above the > > current line with the one below it, without changing the > > current line. I'd like to know how to do that, without > > affecting the registers. >

Re: switch the line above the cursor and the line below the cursor

2010-05-04 Thread Ben Fritz
On May 3, 11:13 pm, BC wrote: > > I thought the question was how to swap the line above the current line > with the one below it, without changing the current line. I'd like to > know how to do that, without affecting the registers. > Just curious...in what sorts of cases is such a command actu

Re: switch the line above the cursor and the line below the cursor

2010-05-03 Thread Jürgen Krämer
Hi, Peng Yu wrote: > I want to define a key shortcut switch the line above the cursor and > the line below the cursor without affecting what is in the buffer (I > mean the things copied by say 'yy'). Could you show me how to do it? :-m+|-2m- or as a map :nnoremap

Re: switch the line above the cursor and the line below the cursor

2010-05-03 Thread Christian Brabandt
On Tue, May 4, 2010 7:59 am, Christian Brabandt wrote: > On Tue, May 4, 2010 6:13 am, BC wrote: >> I thought the question was how to swap the line above the current line >> with the one below it, without changing the current line. I'd like to >> know how to do that, without affecting the registers.

Re: switch the line above the cursor and the line below the cursor

2010-05-03 Thread Christian Brabandt
On Tue, May 4, 2010 6:13 am, BC wrote: > I thought the question was how to swap the line above the current line > with the one below it, without changing the current line. I'd like to > know how to do that, without affecting the registers. Ok, this is cheating, since you are actually changing the

Re: switch the line above the cursor and the line below the cursor

2010-05-03 Thread BC
On May 2, 8:16 pm, Tim Chase wrote: > On 05/02/2010 06:55 PM, Peng Yu wrote: > > > I want to define a key shortcut switch the line above the cursor and > > the line below the cursor without affecting what is in the buffer (I > > mean the things copied by say 'yy&#

Re: switch the line above the cursor and the line below the cursor

2010-05-02 Thread Tim Chase
On 05/02/2010 06:55 PM, Peng Yu wrote: I want to define a key shortcut switch the line above the cursor and the line below the cursor without affecting what is in the buffer (I mean the things copied by say 'yy'). Could you show me how to do it? I usually use the following Ex "

switch the line above the cursor and the line below the cursor

2010-05-02 Thread Peng Yu
I want to define a key shortcut switch the line above the cursor and the line below the cursor without affecting what is in the buffer (I mean the things copied by say 'yy'). Could you show me how to do it? Regards, Peng -- You received this message from the "vim_use" maill