Tuesday, April 27, 2010

Re: foldmethod=indent and tabstop=4

On Tue, 2010-04-27 at 15:38 -0400, Jeremiah Martell wrote:

> It also fixed the folding issue, but broke my syntax matching for
> tabs.
>
> I have this line in a special syntax file:
> syn match SpecialK /\t/
>
> But (with softtabstop instead of tabstop) it only matches double tabs
> (8 spaces), but not single tabs (4 spaces).
>
> If I change it to this:
> syn match SpecialK / /
>
> (match 4 spaces)
> Then it only matches single tabs (4 spaces), but not double tabs (8
> spaces).

I'm not really sure about this, but Vim might be inserting tabs every 8
consecutive spaces. Try setting list to see if there really are tabs
instead of 8 spaces and, if so, setting notabstop, eventually a retab,
might fix things.

I find that having a shiftwidth != 8 and expandtab mixes tabs and spaces
in sourcefiles, which is really irritating to some readers.

I use an adapted version of the snippet at [1] to always know if there
are tabs or spaces in my file.

[1]
http://vim.wikia.com/wiki/Highlight_unwanted_spaces#Using_the_list_and_listchars_options

Vlad


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

Subscription settings: http://groups.google.com/group/vim_use/subscribe?hl=en

No comments: