POV-Ray : Newsgroups : povray.unix : VIM syntax highlighting and .inc files Server Time
28 Jul 2024 16:30:03 EDT (-0400)
  VIM syntax highlighting and .inc files (Message 11 to 20 of 24)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>
From: Mark M  Wilson
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 16:00:50
Message: <3C0550BF.C9B058CD@ncsl.dcr.state.nc.us>
OK, then my next (stupid) question is (you can tell I haven't read that
section of the manual lately):
when making the include statements, if the .pov file (which used to be
the .inc file) is not in the same dir. as all the other .inc files which
come with POVRay, do I explicitly state the path like so:
#include ~/ceiling.pov  

or had I better move the ceiling.pov file to /usr/share/povray where all
the other stuff is?

--Mark

Ron Parker wrote:
> 
> On Wed, 28 Nov 2001 15:54:30 -0500, Mark M. Wilson wrote:
> > Here's a possibly dumb idea -- could I create a symlink from the .inc to
> > the .pov file and 'fool' vim into treating it accordingly?  I.e., ln -s
> > ceiling.inc ceiling.pov   ?
> > --Mark
> 
> Sure, but why not just call it ceiling.pov then?  It's not as though the
> #include statement will care.
> 
> --
> #macro R(L P)sphere{L __}cylinder{L P __}#end#macro P(_1)union{R(z+_ z)R(-z _-z)
> R(_-z*3_+z)torus{1__ clipped_by{plane{_ 0}}}translate z+_1}#end#macro S(_)9-(_1-
> _)*(_1-_)#end#macro Z(_1 _ __)union{P(_)P(-_)R(y-z-1_)translate.1*_1-y*8pigment{
> rgb<S(7)S(5)S(3)>}}#if(_1)Z(_1-__,_,__)#end#end Z(10x*-2,.2)camera{rotate x*90}


Post a reply to this message

From: Warp
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 16:01:53
Message: <3c0550c1@news.povray.org>
Mark M. Wilson <mmw### [at] ncsldcrstatencus> wrote:
: It's one thing to change horses in mid stream; I'm not particularly fond
: of the idea of trading my horse in for a camel, to boot!

meta-x vi-mode

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Mark M  Wilson
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 16:03:36
Message: <3C055166.6455B898@ncsl.dcr.state.nc.us>
Er, what the h#$@ does that mean? (I'm a newbie)  --MMW

Warp wrote:
> 
> 
> meta-x vi-mode
> 
> --
> #macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
> rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
> ],13),8)-3,10>#end blob{N(array[6]{11117333955,
> 7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Peter Popov
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 16:12:32
Message: <3kka0u0fejvibfq6rg9qtth8lm8lh8n61l@4ax.com>
On Wed, 28 Nov 2001 15:21:57 -0500, "Mark M. Wilson"
<mmw### [at] ncsldcrstatencus> 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?

off the top of my head,

:syn pov


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Warp
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 16:13:09
Message: <3c055365@news.povray.org>
Mark M. Wilson <mmw### [at] ncsldcrstatencus> wrote:
: Er, what the h#$@ does that mean? (I'm a newbie)  --MMW

  If you press meta-x and write vi-mode, emacs will start acting like vi.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Mark M  Wilson
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 16:18:57
Message: <3C0554FF.92FE3F25@ncsl.dcr.state.nc.us>
I take it from the presence of the colon that this is a command issued
while in vim, editing the .inc file?  Or is this a statement to be added
to my ~/.vimrc ?  And if the former, will this be a permanent change (I
hope so)?
Thanks for all this help, guys!
--Mark

Peter Popov wrote:
> 
> On Wed, 28 Nov 2001 15:21:57 -0500, "Mark M. Wilson"
> <mmw### [at] ncsldcrstatencus> 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?
> 
> off the top of my head,
> 
> :syn pov
> 
> Peter Popov ICQ : 15002700
> Personal e-mail : pet### [at] vipbg
> TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Ron Parker
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 16:32:00
Message: <slrna0alui.q0h.ron.parker@fwi.com>
On Wed, 28 Nov 2001 16:01:51 -0500, Mark M. Wilson wrote:
> OK, then my next (stupid) question is (you can tell I haven't read that
> section of the manual lately):
> when making the include statements, if the .pov file (which used to be
> the .inc file) is not in the same dir. as all the other .inc files which
> come with POVRay, do I explicitly state the path like so:
> #include ~/ceiling.pov  
> 
> or had I better move the ceiling.pov file to /usr/share/povray where all
> the other stuff is?

You can add stuff to the include path by putting something like

library_path=/home/ron/pov-dist/include

in your ~/.povrayrc file.  Then the #include will just work.

Also, I think you'll find that POV's #include statement doesn't understand
shell shortcuts like ~.

-- 
#macro R(P)z+_(P)_(P)_(P+1)_(P+1)+z#end#macro Q(C,T)bicubic_patch{type 1u_steps
6v_steps 6R(1)R(3)R(5)R(7)pigment{rgb z}}#end#macro _(Y)#local X=asc(substr(C,Y
,1))-65;<T+mod(X,4)div(X,4)9>-2#end#macro O(T)Q("ABEFUQWS",T)Q("WSXTLOJN",T)#
end O(0)O(3)Q("JNKLCGCD",0)light_source{x 1}// ron### [at] povrayorg


Post a reply to this message

From: Mark M  Wilson
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 16:36:40
Message: <3C055926.155A55C8@ncsl.dcr.state.nc.us>
I wondered about that, even as I was typing it....
-MMW

Ron Parker wrote:

> 
> Also, I think you'll find that POV's #include statement doesn't understand
> shell shortcuts like ~.
> 
> --
> #macro R(P)z+_(P)_(P)_(P+1)_(P+1)+z#end#macro Q(C,T)bicubic_patch{type 1u_steps
> 6v_steps 6R(1)R(3)R(5)R(7)pigment{rgb z}}#end#macro _(Y)#local X=asc(substr(C,Y
> ,1))-65;<T+mod(X,4)div(X,4)9>-2#end#macro O(T)Q("ABEFUQWS",T)Q("WSXTLOJN",T)#
> end O(0)O(3)Q("JNKLCGCD",0)light_source{x 1}// ron### [at] povrayorg


Post a reply to this message

From: Adrien Beau
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 18:13:29
Message: <3C056FB5.6D60C32A@free.fr>
"Mark M. Wilson" wrote:
> 
> I take it from the presence of the colon that this is a command issued
> while in vim, editing the .inc file?

Correct.

> Or is this a statement to be added
> to my ~/.vimrc ?

No.

> And if the former, will this be a permanent change

No. But at least it works, if you're in a rush.

-- 
Adrien Beau   adr### [at] freefr   http://adrien.beau.free.fr/


Post a reply to this message

From: Adrien Beau
Subject: Re: VIM syntax highlighting and .inc files
Date: 28 Nov 2001 18:29:17
Message: <3C057367.73EE2512@free.fr>
"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

which almost clearly associate the filetype "pov" to any
files with names ending in .pov.

If you look a few lines below, you'll see that *.inc is
problematic: it can be a POV-Ray include, or an assembler
include, or a PHP include (and I have also used that
extension for Fortran includes).

So, there is some vim-script code to try to guess whether
an .inc file is an assembly or POV-Ray file. It seems it
doesn't work, at least in your case.

If you don't use assembly or PHP, I suggest you modify
the following lines

" Povray or IA64
au BufNewFile,BufRead *.inc                     call FTCheck_inc()

to look like

" Povray or IA64
au BufNewFile,BufRead *.inc                     set ft=pov

Brutal but efficient. Hope this helps.

-- 
Adrien Beau   adr### [at] freefr   http://adrien.beau.free.fr/


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>

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