Tuesday, April 27, 2010

Re: foldmethod=indent and tabstop=4



On Tue, Apr 27, 2010 at 3:04 PM, Vlad Dogaru <ddvlad@rosedu.org> wrote:
On Tue, 2010-04-27 at 14:20 -0400, Jeremiah Martell wrote:
> I can't seem to get these two to work together:
>
> set foldmethod=indent
> set tabstop=4

Also set 'shiftwidth'. Help on fold-indent explains that shiftwidth is
the value that governs folds.

It's common _not_ to change tabstop, but only shiftwidth and
softtabstop, as mentioned in :h 'tabstop'.

Hope this helps,
Vlad


Thanks Vlad, that worked. I thought I had tried that combination before, but I must have missed it.


I also tried to not set tabstop but instead use softtabstop, but I had some weird issues.
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).

It's not a big deal since I already have a solution, but I am curious as to how you would go about fixing this.

Thanks,
 - Jeremiah

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

No comments: