On Sat, Jan 19, 2019 at 10:09 PM Peter Kokot <peterko...@gmail.com> wrote:
> On Wed, 29 Nov 2017 at 22:53, Peter Kokot <peterko...@gmail.com> wrote: > > > > Hello, > > > > I'm not sure if this has been discussed before, but I find these local > > variables in C, H and other files a bit strange and bloated: > > > > /* > > * Local variables: > > * tab-width: 4 > > * c-basic-offset: 4 > > * End: > > * vim600: noet sw=4 ts=4 fdm=marker > > * vim<600: noet sw=4 ts=4 > > */ > > > > Is there any chance to start omitting them and use a single > > .editorconfig file instead or is this something that is a must have in > > C projects of today? > > > > Thank you for some clarification on this :) > > Hello, I'm bumping this question since it was brought up also in the > pull request for fixing the code style of the libmbfl [1]. > > Going through these editor settings: > - tab-width: 4 is already set in the .editorconfig file > - c-basic-offset: 4 is emacs setting for indentation level [2] > - noet is setting for vim to not expand tabs to spaces > - sw means setting the shift width in vim > - ts means tabstop > - fdm=marker means folding method [3] > > Since these are specific for the C code, we should instead set other > ways of code style fixes methods for this task. For example, Clang > format and Clang tidy can fix existing code quite nicely from what the > settings they have available. And EditorConfig mostly can do all that > what is set above - set the indentation style and its width. Not to > mention that with the default Vim configuration (tested on latest > Ubuntu), this doesn't work as it should anymore. > > So, the main question here, can we start removing these comment blocks > from the *.c and *.h files together with the footer file [4]? > > [1] https://github.com/php/php-src/pull/3754 > [2] https://www.emacswiki.org/emacs/IndentingC > [3] http://vim.wikia.com/wiki/Folding > [4] http://git.php.net/?p=php-src.git;a=blob;f=footer;hb=HEAD > I think it's okay to drop these. I'm using vim, but I don't think these variables ever did something for me. Nikita