Vim MacPorts support

Rainer Müller raimue at macports.org
Thu Jul 23 17:18:44 PDT 2009


On 2009-07-24 01:50 , Darren Weber wrote:
> I've found that MacVim provides fairly useful tcl highlighting just by
> using the mode line that is suggested here:
> http://guide.macports.org/#development.practices
> 
> That is,
> 
> # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
> 
> 
> If this mode line is adopted as a best practice, will it over-ride any
> of the settings in the ~/.vim path?

Yes, the modeline overwrites settings from .vimrc and the .vim directory.

As you noticed that on files with this modeline only: to enable Tcl
syntax highlighting on all Portfiles regardless of the modeline, add
this line to your .vim/filetype.vim:
  au BufRead,BufNewFile Portfile setfiletype tcl

But what Max provides here offers much more than just syntax
highlighting in Tcl style. It offers validation of Portfile options as
different syntax highlighting and supports lint directly from vim.

As soon as it is improved and thoroughly tested, I would like to include
it in the vim ports. Then we could change that modeline to use
ft=portfile instead of ft=tcl and recommend installing vim from MacPorts (

> It seems to do so on my system, so
> even if I install these new files, it continues to use these mode line
> specifications.

Use
  :set nomodeline
  :e
to temporary disable modelines and reload the file which will apply the
settings from the .vim directory.

Rainer


More information about the macports-dev mailing list