POV-Ray : Newsgroups : povray.unix : VIM syntax highlighting and .inc files : Re: VIM syntax highlighting and .inc files Server Time
28 Jul 2024 18:19:19 EDT (-0400)
  Re: VIM syntax highlighting and .inc files  
From: Anthony Thyssen
Date: 9 Jul 2002 10:27:35
Message: <3D2AF312.CFDEFDF8@cit.gu.edu.au>
Adrien Beau wrote:
> 
> "Mark M. Wilson" wrote:
> >
> > Does any one who uses vim know how to get it to use the same povray
> > syntax color scheme for .inc files as for .pov files?  When editing my
> > .pov files at a console (Debian Linux, BTW) I get my colors, but when
> > editing my own custom .inc files, I just get the usual light grey text
> > and black background.  Is there some config file I can edit to get vim
> > to recognize that .inc files should be treated the same as .pov?
> 
> This perhaps depends of the version of Vim you are using.
> Use :version to see which one you have. My answer should
> work at least for Vim 5.8 and 6.0.
> 
> So, is there any config file you can edit?
> 
> Yes, there is, and the file is $VIMRUNTIME/filetype.vim
> (that is, e.g, /usr/local/share/vim/vim58/filetype.vim).
> 
> Searching for the word "pov" in that file (with "/pov")
> leads us to these lines:
> 
> " Povray
> au BufNewFile,BufRead *.pov                     set ft=pov
> ...
> " Povray or IA64
> au BufNewFile,BufRead *.inc                     set ft=pov
> 
> Brutal but efficient. Hope this helps.
> 

Applogies for replying 6 months later to this problem, but as a fairly
heavy
user of vi and vim, and no one coming up with the better solutions, I
had to
say something..

First DO NOT EDIT "filetype.vim", you are asking for trouble with
upgrades.

Instead add that line to your ".vimrc" file in your home directory.

If you have other types of ".inc" files you can also add to your  povray
scene files the comment
   // vim:set syntax=pov:

This line must be either within the first five lines of either the top
or
the bottom of your ".inc" file.  I use this a alot on "unusal" files,
and work very well in telling vim just what syntax highlighing it should
use, in unusal cases.

  Anthony Thyssen ( System Programmer )   
http://www.sct.gu.edu.au/~anthony/

-----------------------------------------------------------------------------
    The Number of the Editor --  Vi Vi Vi

-----------------------------------------------------------------------------
     PGP Public Key available -- finger -l ant### [at] lyrchcitgueduau


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.