Re: syntax highlighting of rc.conf with vim



On Sat, Jul 28, 2007 at 05:12:42PM +0400, Andrey V. Elsukov wrote:
Am 28.07.2007 um 14:26 schrieb Miroslav Lachman:
If your rc.conf file will start with comment character (#) then
syntax highlight will be OK.
WUOUf, that is a pretty trick. Thanks very much. It works.

Also you can put in the comment highlight type:
# vim: filetype=sh

FreeBSD has somewhat of an exception to this. The feature you're
talking about is called vim modeline, and there's quite a big warning
in the vim port (shown during installation) about modelines causing
historic security problems.

Regardless of that fact, I do use them myself, but I'm selective
about them. I prefer to use .vimrc and set up appropriate AutoCmd
entries depending upon fully-qualified paths for config files.

Take your pick. I just wanted to point out that FreeBSD does
explicitly mention the historic issues with modeline in the port.

--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |

_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Syntax highlight for all Files
    ... I ask my self if it possible to have syntax highlight for all files. ... Is it possible to configure emacs with the same behavior as vim. ... Best Regards ...
    (comp.emacs)
  • Re: syntax highlighting of rc.conf with vim
    ... syntax highlight will be OK. ... that is a pretty trick. ... Also you can put in the comment highlight type: ... # vim: filetype=sh ...
    (freebsd-stable)
  • Re: VIM: Can I set a vim status line to initialise the search register /
    ... Bob Harris wrote: ... VIM: Can I set a vim status line to initialise the search register / ... Drat meant modeline not statusline ... I do not think so, but maybe you could trick it, using an autocmd ...
    (comp.editors)
  • vim modeline debuggin
    ... I'd expect vim to read the modeline and set tabsize and shiftwidth to 3. ... tabs are 8 characters long and:set ts? ...
    (comp.editors)
  • Re: [vim] declaring ft for a file
    ... what's the best way do declare a certain file to be of a certain filetype? ... that ~/.aliasrc is a zsh file. ... A modeline should work fine. ... It is by default in vim, ...
    (comp.editors)