Thursday, October 4, 2012

Re: vim: how to gq a visual block?

ping wrote:
> as in subject, suppose we have a gq'ed block already:
>
> 0 1 2
> 12345678901234567890123456789
> lsdjflsdlksjfsdlfjsld 123
> lsjfsdfksdjfldsfsdlsl 456
> lsjdlfsdlfjsalfslfsjs 789
>
>
> now I want to re-format the character blocks , for example, extend
> them from current length 21 to some other length, say, 25, or squeeze
> to 18, without affacting the "digit blocks".
>
> is it possible at all with any command or plugins?
>
Not a perfect solution, because the righthand side digits may move (as a
column) a bit, but:

* set tw=(new value here)
* ctrl-v block of characters
* :B norm! gqap

That also assumes that the text within is a paragraph, too.

The ":B" is supported by my vis plugin:

You can get vis.vim from:

http://vim.sourceforge.net/scripts/script.php?script_id=1195 (stable)
http://www.drchip.org/astronaut/vim/index.html#VIS (cutting
edge)

Regards,
C Campbell

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment