Default modeline (was: Re: free42)

Rainer Müller raimue at macports.org
Sun Feb 22 11:09:02 PST 2009


Martin Krischik wrote:
> Am 01.02.2009 um 22:34 schrieb Ryan Schmidt:
[...]
>>> +############################################################ {{{1  
>>> ###########
>>> +# vim: set nowrap tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab :
>>> +# vim: set textwidth=0 filetype=tcl foldmethod=marker nospell :
>> We already have the modeline in the first line of the portfile. If  
>> these lines are adding things that we don't have in the modeline,  
>> what are they and would they be useful to consider adding to our  
>> recommended modeline?
> 
> First and foremost they use the full names of the settings instead of
> abbreviations. So lets compare:
> 
> 1)	fenc=utf-8	fileencoding
> 2)	ft=tcl		filetype
> 3)	et		expandtab
> 4)	sw=4		shiftwidth
> 5)	ts=4		tabstop
> 6)	sts=4		softtabstop
> 
> No. 3 and 5 contradict each other - if tabs are expanded to spaces you
> don't need to set the physical tab stops. My Suggestion is tabstop=8
> noexpandtab - most terminals set the tabstop to 8.

I agree. Usually when using vim tabstop should not be changed, only
shiftwidth. I am not sure if using softtabstop is "compatible" with
other editors. Most other editors are not able to make a difference
between tabs at indentation level and somewhere else in the file. This
could be the reason why our default modeline is changing tabstop.

> I also have foldmethod=marker which might be helpful for very large
> Portfiles - you can then fold parts of the source with {{{ and }}}.

Useless if not also using foldenable. I would leave this for everyone to
add in their .vim/filetype.vim. Some people do not like folding.

For example:
  au BufRead,BufNewFile Portfile setlocal foldenable foldmethod=marker

> textwidth=0 is actually wrong - better would be textwidth=78 - one can
> then format comments with the "gq" command.

I have that set for all text/code files anyway. I don't think we should
enforce a specific textwidth for Portfiles. For example commands in
destroot phases or variant lines with descriptions are often longer than
80 characters.

Rainer


More information about the macports-dev mailing list