Saturday, April 13, 2013

Re: How can one set tabstops to specific values?

On 14/04/13 02:33, Linda W wrote:
>
>
>
> I'd like to be able to set tabstops in various files to useful values
>
> like in
> /etc/fstab
> set ts=17,17,8,24,3
>
> With the last tabstop repeated for the width of the line...
>
> I've seen this in other editors and even the linux-console has
> this ability -- so how can I setvim to produce tabstops for a
> variably tab'ed output file?
>
> Thanks... I DID look through the vimhelp, but couldn't find
> anything related to varying the tabs.
>

Neither could I, and I used :helpgrep

IMHO using variable *hard* tabs is courting disaster, because most other
programs (including printers, and the Python interpreter) always use
fixed hard tabs every 8 columns.

For *soft* tabs (moving the cursor by adding spaces, or sometimes a
mixture of spaces and tabs, when the <Tab> key is hit at the keyboard)
it is something else, and I've seen this kind of option wished for
several times in vim_use or vim_dev. I suppose it could be added to the
todo list, but with a low priority, because I don't see it coming in any
foreseeable future, unless someone is both willing and capable of
implementing it (are you? I'm not).

For the sake of portability, I recommend keeping 'tabstop' at its
default of 8, setting 'expandtab' on, and using any values you like for
'shiftwidth' and 'softtabstop'. This way existing hard tabs will be seen
at multiples of 8, no new ones will be added, and tabbing or indenting
will happen by adding as many or as few spaces as you like. (You might
also use :retab to get rid of existing hard tabs in favour of spaces.)


Best regards,
Tony.
--
It is something to be able to paint a particular picture, or to carve a
statue, and so to make a few objects beautiful; but it is far more
glorious to carve and paint the very atmosphere and medium through
which we look, which morally we can do. To affect the quality of the
day, that is the highest of arts.
-- Henry David Thoreau, "Where I Live"

--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment