Thursday, August 30, 2018

Re: About using vartabstop

Hi,

2018-8-30(Thu) 14:36:09 UTC+9 Christian Brabandt:
> On Mi, 29 Aug 2018, Lifepillar wrote:
>
> > There's a meme (if it may be called so) circulating on Twitter
> > about using Fibonacci sequences for indentation. Just for fun,
> > I wanted to see if it could be implemented using the vartabs
> > feature. I thought that this would do it (for C files):
> >
> > set shiftwidth=0
> > set noexpandtab
> > set vartabstop=1,1,2,3,5,8,13,21,34
> > set autoindent
> > set smartindent
> > set ft=c
> >
> > With the above settings, it appears that the value of tabstop
> > is used. This seems to agree with shiftwidth's documentation:
> > "When [shiftwidth is] zero the 'ts' value will be used", but
> > not with tabstop's help: "the value of 'tabstop' will be
> > ignored while 'vartabstop' is set". Putting together the two,
> > I would expect the above to use vartabstop.
> >
> > Am I missing something?
>
> I am not sure. It might be, that the functionality of using the tabstop
> setting when shiftwidth is zero is indeed missing from vartabstop,
> because this was done some time after the vartab patch has been created
> and that feature has than not made it back into the vartabs patch.
>
> I'll have a look at it in more detail later.

I also tried Fibonacci indent with the vartabstop option yesterday. 😃
https://twitter.com/h_east/status/1034606768226070528 (Japanese)

It worked well for files already indented with tabs, but auto indentation in insert mode did not work well.

I investigated for a moment but I could not fix it.
Probably we will fix it by modifying tabstop_padding().

--
Best regards,
Hirohito Higashi (h_east)

--
--
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/d/optout.

No comments: