Hi,

I'm the maintainer of the Erlang indentation, which is developed in a
separate repository (https://github.com/vim-erlang/vim-erlang-runtime),
and when it is modified, I send the updated file to Bram.

> 1. I've changed `&shiftwidth` to `shiftwidth()`.
> 2. Removed a checking code / a wrapper function for shiftwidth()
>     for some specific indent plugins.

I agree with the change, except that when I change from &sw to
shiftwidth() in my repository, I would also add the "*shiftwidth" check.
That is because this repo can be used with any version of Vim, and many
systems still have Vim versions without the shiftwidth() feature
(including the newest OS X, which comes with Vim 7.3). So it's fine by
me to simply replace &sw with shiftwidth() in the main Git repo as you
did it; but allow me to add the check in my repo (a change which will
eventually creep back into Vim).

> 3. Some indent plugins change `shiftwidth` and `softtabstop`.
>     Is it evil? What do you think?

My opinion is that most programming languages let their users decide
these, so Vim indentation scripts for those languages shouldn't modify
these settings. There may be exceptions though, e.g. AFAIK the Go
programming language recommends that all code is formatted with the
"gofmt" program; so if gofmt uses sw=4 ts=4, then it can be OK for the
indentation script to modify these (as long as they provide an option to
the user to override these by e.g. setting a variable like
"g:go_indent_keep_sw").

Csaba

On Mon, Jan 25, 2016 at 3:58 PM, tyru <[email protected]> wrote:
> Hi, Vimmers.
>
> I'm sending this email to Vim indent plugins maintainers and vim_dev.
> I suppose all of you maintain `$VIMRUNTIME/runtime/indent/*.vim`.
> I want you to review and merge my modifications.
>
> Now I'm working on the issue about Vim indent plugins.
> (See details below)
> https://github.com/vim/vim/pull/578
>
> Please see my detailed commits for above link.
> In brief:
> 1. I've changed `&shiftwidth` to `shiftwidth()`.
> 2. Removed a checking code / a wrapper function for shiftwidth()
>     for some specific indent plugins.
> 3. Some indent plugins change `shiftwidth` and `softtabstop`.
>     Is it evil? What do you think?
>
> 1. I've changed `&shiftwidth` to `shiftwidth()`.
>
> This allows user to `set shiftwidth=0` in .vimrc.
> This feature is added in 7.3.629 (more than 3 years ago,
> but it makes no sense because indent plugins do not support this yet)
>
> 2. Removed a checking code / a wrapper function for shiftwidth()
>     for some specific indent plugins.
>
> I removed a checking code / a wrapper function for shiftwidth().
> * bzl.vim
> * go.vim
> * html.vim
> * teraterm.vim
> * yaml.vim
>
> 3. Some indent plugins change `shiftwidth` and `softtabstop`.
>     Is it evil? What do you think?
>
> Nowadays, Vim supports syncing `shiftwidth` and `softtabstop` values
> with `tabstop`, like this.
>
>     set tabstop=2 shiftwidth=0 softtabstop=-1
>
> shiftwidth: 7.3.629 or later
> softtabstop: 7.3.692 or later
>
> This makes it easy to change indent behavior at once.
> A user can change it only changing `tabstop` value.
> But, some indent plugins seem to change `shiftwidth` or `softtabstop` values.
> As a result, a user must set all 3 options by him or herself.
>
>
> I'm waiting for your feedbacks about my modification.
>
> Thanks

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui