Sunday, April 14, 2013

Re: How can one set tabstops to specific values?

Tony Mechelynck wrote:
>
>
> 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.
----
But my terminal uses '2' for a tabstop (linux console is
programmable for tabstops -- including
arbitrary ones...).

(here's a bash script to do it).
----
#!/bin/bash
#console_codes(4) man page...
printf -v sts "\033H"
if (($#==0)) ; then
echo "$0: <n>" - set tab stop to N
exit 1
fi
declare -i tab=$1;
str=""
declare -i pos=1
while ((++pos<80)) ;do
if ((pos%tab)); then str+=" "
else str+="$sts"
fi
done
echo -e "\033c"
echo "$str"


------------------------
Specifically, I have a few file like /etc/fstab that could really use
vartabs --

I'd like to separate fields with 1 tab, but that looks poopy... Thus the
request.

For programming... I usually use a TS=2 sw=2.

If people really **want** 8, they can just set ts=8 -- as I use 1 level
of TS / indent.


> 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'.
====
For portability, using softabs causes problems -- cause then I can't
use my preferred tabs w/o retab!

i.e. if I use 1 indent/lang level, I can choose my indent and others can
too.

But if spaces are intertwined, then I have to mod- the source code to
change tab-expansion....Ug!

I have my 'more' setup to do tabs=2 as well...

But tabs=8 -- can't indent much before I am across the screen.


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