Re: moving virual rectange about in virtualedit mode

2007-05-02 Thread Charles E Campbell Jr

Gary Johnson wrote:


On 2007-05-02, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:
 


Yakov Lerner wrote:

   


I 'set ve=all' and selected a rectangle with Ctrl-V.
How can I move this rectangle up/down left/right with arrows ?
 


With DrawIt v8d, you can move a selected rectangle about with your mouse.
Here's the relevant portion of the help for DrawIt:



   One may drag and move a selection with .  First,
   select the region using the .  Release the mouse button,
   then press ctrl and the  button; while continuing to press
   the button, move the mouse.  The selected block of text will then
   move along with the cursor.
   



Unfortunately, this works only for gvim, not vim.   
in an xterm opens the Main Options menu.


 


Here's how to get & install DrawIt (when 7.1 comes out, this will become
lots easier - just steps 3&4)
   



 


3) Get DrawIt:
  http://vim.sourceforge.net/scripts/script.php?script_id=40
  http://mysite.verizon.net/astronaut/vim/index.html#DRAWIT

4) Install an up-to-date version of Drawit:
  vim DrawIt.vba.gz
  :so %
  :q

   



One may need to uninstall (i.e., delete) any earlier version of
DrawIt, too, specifically the file ~/.vim/plugin/DrawIt.vim.  The
symptoms of needing to do this include vim complaining at startup
that \di has been defined twice.

I use the line-drawing capability of DrawIt all the time.  I haven't
done much with the visual-block commands, so I thought I'd try one.
I think I found a bug in the version of DrawIt from the astronaut
site.

I inserted the following two paragraphs of text into a buffer,
started DrawIt by typing \di, left-clicked the mouse on the
character in the upper left corner of the region (the 'e' in
"everywhere", no longer visible below), dragged the visual selection
to the lower right corner, and typed \b to draw a box.

  Mary had a little lamb,
  Its fleece was white as snow,
  And +--+ went,
  The |amb was sure to go|
||
  It f|llowed her to scho|l one day,
  Whic+--+le,
  And made the children laugh and play
  To see a lamb at school.

Note that the two bars between the paragraphs are in columns 1 and 2
instead of 8 and 27.
 

See DrawIt's help, lines 253-256.  The visual-block commands require 
spaces to work in.
Most of these commands are imported from Sylvain Viart's drawing.vim; I 
haven't tried

making the "holer" routine obsolete yet.

Regards,
Chip Campbell



Re: moving virual rectange about in virtualedit mode

2007-05-02 Thread Gary Johnson
On 2007-05-02, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:
>  Yakov Lerner wrote:
> 
> > I 'set ve=all' and selected a rectangle with Ctrl-V.
> > How can I move this rectangle up/down left/right with arrows ?
> 
>  With DrawIt v8d, you can move a selected rectangle about with your mouse.
>  Here's the relevant portion of the help for DrawIt:
> 
>  
> 
> One may drag and move a selection with .  First,
> select the region using the .  Release the mouse button,
> then press ctrl and the  button; while continuing to press
> the button, move the mouse.  The selected block of text will then
> move along with the cursor.

Unfortunately, this works only for gvim, not vim.   
in an xterm opens the Main Options menu.

>  Here's how to get & install DrawIt (when 7.1 comes out, this will become
>  lots easier - just steps 3&4)

>  3) Get DrawIt:
>http://vim.sourceforge.net/scripts/script.php?script_id=40
>http://mysite.verizon.net/astronaut/vim/index.html#DRAWIT
> 
>  4) Install an up-to-date version of Drawit:
>vim DrawIt.vba.gz
>:so %
>:q
> 

One may need to uninstall (i.e., delete) any earlier version of
DrawIt, too, specifically the file ~/.vim/plugin/DrawIt.vim.  The
symptoms of needing to do this include vim complaining at startup
that \di has been defined twice.

I use the line-drawing capability of DrawIt all the time.  I haven't
done much with the visual-block commands, so I thought I'd try one.
I think I found a bug in the version of DrawIt from the astronaut
site.

I inserted the following two paragraphs of text into a buffer,
started DrawIt by typing \di, left-clicked the mouse on the
character in the upper left corner of the region (the 'e' in
"everywhere", no longer visible below), dragged the visual selection
to the lower right corner, and typed \b to draw a box.

   Mary had a little lamb,
   Its fleece was white as snow,
   And +--+ went,
   The |amb was sure to go|
||
   It f|llowed her to scho|l one day,
   Whic+--+le,
   And made the children laugh and play
   To see a lamb at school.

Note that the two bars between the paragraphs are in columns 1 and 2
instead of 8 and 27.

Regards,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Mobile Broadband Division
 | Spokane, Washington, USA


Re: moving virual rectange about in virtualedit mode

2007-05-02 Thread Charles E Campbell Jr

Yakov Lerner wrote:


I 'set ve=all' and selected a rectangle with Ctrl-V.
How can I move this rectangle up/down left/right with arrows ?


With DrawIt v8d, you can move a selected rectangle about with your mouse.
Here's the relevant portion of the help for DrawIt:



   One may drag and move a selection with .  First,
   select the region using the .  Release the mouse button,
   then press ctrl and the  button; while continuing to press
   the button, move the mouse.  The selected block of text will then
   move along with the cursor.

Here's how to get & install DrawIt (when 7.1 comes out, this will become
lots easier - just steps 3&4)

To get an up-to-date version of drawit, you'll also need to get an 
up-to-date version of vimball.  So:


1) Get an up-to-date version of vimball:
http://vim.sourceforge.net/scripts/script.php?script_id=1502
 -or-   http://mysite.verizon.net/astronaut/vim/index.html#VimBall
 (the mysite.verizon.net one will be the more recent version)

2) Remove the old vimball plugin and install the new one:

   Linux:
   cd /usr/local/share/vim/vim70
   /bin/rm plugin/vimball*.vim autoload/vimball*.vim doc/pi_vimball.txt
   mv (wherever it was downloaded)/vimball.tar.gz .
   gunzip vimball.tar.gz
   tar -xvf vimball.tar

   Windows:
   Under Windows, check your runtimepath to determine where your 
vim 7.0's runtime directories are:


   vim
   :echo &rtp
   :q

   The first directory is likely your personal plugins directory, 
the second one is your vim system directory.


   cd (to your vim system directory)
   del plugin\vimballPlugin.vim
   del autoload\vimball.vim
   del doc\pi_vimball.txt
   ren (wherever)\vimball.tar.gz vimball.tar.gz
   gunzip vimball.tar.gz
   tar -xvf vimball.tar


3) Get DrawIt:
  http://vim.sourceforge.net/scripts/script.php?script_id=40
  http://mysite.verizon.net/astronaut/vim/index.html#DRAWIT

4) Install an up-to-date version of Drawit:
  vim DrawIt.vba.gz
  :so %
  :q



Re: moving virual rectange about in virtualedit mode

2007-05-01 Thread Tim Chase

>> Well, could one not do something like the following?
>>
>> :vnoremap  oo
>
> No, I did not mean "move the corners of the selection".
> I meants "move the contents".
> I meant "erase the contents at the old place and put the contents
> at the new place". Imagine moving text frames in the Word.
> This is what I mean. As if the selection are is a floating 
text frame.

> For example. Given the file:
>
> |--
> |abcdefghijk
> |123456789
>
> I select rectangle 2x2 "ab\n12" with Ctrl-V.
>
> I press Down and Right.
> The result shall be approximately like:
>
> |--
> | defghijk
> | ab456789
>   12
>
> Depending on sophistication, and text under
> the moving rectangle can be either erase with blanks, or
> preserved. (more difficult). I'd make it an option.

I presume your example should be

 |--
 |  cdefghijk
 |ab3456789
 |12

with the "c\n3" and the "d" back over the "4" in there
which mysteriously vanished from your example.

The following suite of mappings seems to do what you
describe:

  :vnoremap  ygvrgvooopgv
  :vnoremap  ygvrgvooopgv
  :vnoremap  ygvrgvooopgv
  :vnoremap  ygvrgvooopgv

I'm not sure why they need the "oo" in them, but I may have
stumbled across a bug.  Without it, the 2nd and subsequent
uses mangle the selection when you move.  At least in the
 case...I just left it in there for the other 3 cases.

To reproduce it here, I simply

  :vnoremap  ygvrgvopgv

and then visual-block something and hit  twice.
Debugging showed that on the second attempt, the 
didn't move the selection properly.

I don't know so much about swapping bits around or
remembering what got overwritten for later replacement
rather than just erasing with spaces.  That, as you say,
would be considerably "more difficult".

-tim






Re: moving virual rectange about in virtualedit mode

2007-04-30 Thread Yakov Lerner

On 4/30/07, Tim Chase <[EMAIL PROTECTED]> wrote:

>>> I 'set ve=all' and selected a rectangle with Ctrl-V.
>>> How can I move this rectangle up/down left/right with arrows ?
>>>
>> I assume you're asking how you can move the "other sides" of a visual
>> block.
> No, I meant "move" as in, "erase in old place and paint in new place".

Well, could one not do something like the following?

:vnoremap  oo


No, I did not mean "move the corners of the selection".
I meants "move the contents".
I meant "erase the contents at the old place and put the contents
at the new place". Imagine moving text frames in the Word.
This is what I mean. As if the selection are is a floating text frame.
For example. Given the file:

|--
|abcdefghijk
|123456789

I select rectangle 2x2 "ab\n12" with Ctrl-V.

I press Down and Right.
The result shall be approximately like:

|--
| defghijk
| ab456789
 12

Depending on sophistication, and text under
the moving rectangle can be either erase with blanks, or
preserved. (more difficult). I'd make it an option.

Yakov


Re: moving virual rectange about in virtualedit mode

2007-04-30 Thread Tim Chase
>>> I 'set ve=all' and selected a rectangle with Ctrl-V.
>>> How can I move this rectangle up/down left/right with arrows ?
>>>
>> I assume you're asking how you can move the "other sides" of a visual
>> block. When you're using visual block you usually have control of only
>> one corner (southwest for me most of the time, but it could be any of
>> the four). You can use the o and O commands to start moving different
>> corners. Note that the o command also works in the other two visual
>> modes, and so is very handy.
> 
> No, I meant "move" as in, "erase in old place and paint in new place".

Well, could one not do something like the following?

:vnoremap  oo
:vnoremap  oo
:vnoremap  oo
:vnoremap  oo

This still leaves the h/j/k/l keys for manipulating the size of
the rectangle, and then allows the arrow keys for panning the
selection.  It should even work fairly well in all three block
modes.  It might have a little trouble at the
top/bottom/left/right of your document where arrowing would try
to push it off the edge.

Or am I missing some wrinkle that "set ve=all" introduces?  Or
"select" mode rather than "visual" mode?  (I don't use either so
I don't know the nuances of them)

-tim




Re: moving virual rectange about in virtualedit mode

2007-04-29 Thread Yakov Lerner

On 4/30/07, Sartak <[EMAIL PROTECTED]> wrote:

On 4/29/07, Yakov Lerner <[EMAIL PROTECTED]> wrote:
> I 'set ve=all' and selected a rectangle with Ctrl-V.
> How can I move this rectangle up/down left/right with arrows ?
>
> Thanks
> Yakov
>

I assume you're asking how you can move the "other sides" of a visual
block. When you're using visual block you usually have control of only
one corner (southwest for me most of the time, but it could be any of
the four). You can use the o and O commands to start moving different
corners. Note that the o command also works in the other two visual
modes, and so is very handy.


No, I meant "move" as in, "erase in old place and paint in new place".

Yakov


moving virual rectange about in virtualedit mode

2007-04-29 Thread Yakov Lerner

I 'set ve=all' and selected a rectangle with Ctrl-V.
How can I move this rectangle up/down left/right with arrows ?

Thanks
Yakov