[Runtime indent plugins] 3 Things about 'shiftwidth', 'softtabstop'

35 views
Skip to first unread message

tyru

unread,
Jan 25, 2016, 10:02:16 AM1/25/16
to Martin Krischik, Erik Janssen, Tim Pope, Raul Segura Acevedo, Jason Turner, Sung Pae, Karthik Krishnan, Nikolai Weibull, Brent A. Fulgham, Jocelyn Fiat, Csaba Hoch, Steven Oliver, Ajit J. Thakkar, Teemu Matilainen, David Fishburn, Victor Roemer, Aleksandar Jelenak, Johannes Zellner, Hong Xu, Eli Parra, Paulo Moura, Marcus Aurelius Farias, Christophe Poucet, steve layland, Eugene Minkovskii, Jean-Francois Yuen, Mario Schweigler, Neil Carter, vim-perl, John Wellesz, Mike Williams, David Necas (Yeti), Gergely Kontra, Jakson Alves de Aquino, BERTRAND Joël, Michael Piefel, Christian Brabandt, Saikat Guha, David Fishburn, kocha, GI, YiChao Zhou, Christian J. Robinson, Tobias Rundström, Chih-Tsun Huang, Gerald Lai, Bram Moolenaar, vim...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages