Aligning text

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Aligning text

Narayanan S. Iyer
Hi,

Is there a simple way in vim (or in linux) to align text.

eg.

Before aligning

abc x def ghi
abcdef x ghijk

After aligning (on character x. I should be able to select this)

   abc  x def ghi
abcdef x ghijk

Regards,
Iyer
Reply | Threaded
Open this post in threaded view
|

Re: Aligning text

Dominic Evans
I like Charles'

http://vim.sourceforge.net/scripts/script.php?script_id=294


On 07/10/05, Narayanan S. Iyer <[hidden email]> wrote:

> Hi,
>
> Is there a simple way in vim (or in linux) to align text.
>
> eg.
>
> Before aligning
>
> abc x def ghi
> abcdef x ghijk
>
> After aligning (on character x. I should be able to select this)
>
>    abc  x def ghi
> abcdef x ghijk
>
> Regards,
> Iyer
>
Reply | Threaded
Open this post in threaded view
|

Re: Aligning text

Charles E Campbell Jr
In reply to this post by Narayanan S. Iyer
Narayanan S. Iyer wrote:

>Is there a simple way in vim (or in linux) to align text.
>
>eg.
>
>Before aligning
>
>abc x def ghi
>abcdef x ghijk
>
>After aligning (on character x. I should be able to select this)
>
>   abc  x def ghi
>abcdef x ghijk
>  
>

Using Align.vim (see
http://vim.sourceforge.net/scripts/script.php?script_id=294) makes this
straightforward:

use V and motion to highlight/select the two lines
:Align x

(it'll appear as  :'<,'>Align x)

would do the alignment you request.  For some examples, see
http://mysite.verizon.net/astronaut/vim/align.html .

Regards,
Chip Campbell