Minimum tabstop to get all columns aligned

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

Minimum tabstop to get all columns aligned

Paolo Bolzoni
Dear list,

Lately I often works with cvs-like files where columns are
separed by tabs and the first line contains the columns
description.

To move around those files I setup "nowrap" and "set tabstop=40"
(title can be long) and it works fairly well.

However, I was wondering is there a way to setup tabstop to the
minimum to get all the columns aligned?

Yours faithfully,
Paolo

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Minimum tabstop to get all columns aligned

Tony Mechelynck
To get all columns aligned, you must of course know the width of the
widest column. If that can be known from the first line, it should be
possible to set 'tabstop' accordingly, depending on that first line's
format (in particular, is it a comma-separated list of column widths,
or a "format line" with a | bar representing a tab stop and repeated -
dashes between tab stops? I've seen both kinds).

See, among others,
    :help eval.txt
    :help substitute()
    :help virtcol()
    :help max()
    :help :execute

See also the vartabs plugin, http://www.vim.org/scripts/script.php?script_id=785

Best regards,
Tony.

On Tue, Mar 14, 2017 at 11:54 AM, Paolo Bolzoni
<[hidden email]> wrote:

> Dear list,
>
> Lately I often works with cvs-like files where columns are
> separed by tabs and the first line contains the columns
> description.
>
> To move around those files I setup "nowrap" and "set tabstop=40"
> (title can be long) and it works fairly well.
>
> However, I was wondering is there a way to setup tabstop to the
> minimum to get all the columns aligned?
>
> Yours faithfully,
> Paolo
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Minimum tabstop to get all columns aligned

Ethan Hereth
Have you seen this?

https://github.com/chrisbra/csv.vim

I use it occasionally and I like it. Maybe it'll help you?

Sorry if this email is formatted incorrectly, I'm sending from my phone as I'm out of the office...
On Tue, Mar 14, 2017 at 7:31 AM Tony Mechelynck <[hidden email]> wrote:
To get all columns aligned, you must of course know the width of the
widest column. If that can be known from the first line, it should be
possible to set 'tabstop' accordingly, depending on that first line's
format (in particular, is it a comma-separated list of column widths,
or a "format line" with a | bar representing a tab stop and repeated -
dashes between tab stops? I've seen both kinds).

See, among others,
    :help eval.txt
    :help substitute()
    :help virtcol()
    :help max()
    :help :execute

See also the vartabs plugin, http://www.vim.org/scripts/script.php?script_id=785

Best regards,
Tony.

On Tue, Mar 14, 2017 at 11:54 AM, Paolo Bolzoni
<[hidden email]> wrote:
> Dear list,
>
> Lately I often works with cvs-like files where columns are
> separed by tabs and the first line contains the columns
> description.
>
> To move around those files I setup "nowrap" and "set tabstop=40"
> (title can be long) and it works fairly well.
>
> However, I was wondering is there a way to setup tabstop to the
> minimum to get all the columns aligned?
>
> Yours faithfully,
> Paolo
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.