Vim Tips Wiki


1,624pages on
this wiki
Add New Page

Use this page to discuss script 3556 openscad: syntax highlighting for the OpenSCAD 3D modeling language

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on
  • This page may be out of date: check the script's page above, and its release notes.


To my copy, I added the 2d primitives:

syn keyword openscad2dPrimitive square circle polygon import_dxf<br>
hi def link openscad2dPrimitive			Keyword

--June 23, 2012

Thanks, I've added this to the code. -Taj 20130306

Auto enableEdit

To get it to work automajickally, I added this to my .vimrc after copying the script to .vim/syntax/

au BufNewFile,BufRead *.scad            setf openscad

--December 2, 2012

Hull, extrusion and import operatorsEdit

I added highlighting for the convex hull, extrusion (linear and rotational) and import operators:

--- /tmp/vim-openscad/syntax/openscad.vim       2013-03-05 04:47:36.000000000 +0100
+++ openscad.vim        2014-01-11 10:36:06.640895113 +0100
@@ -23,9 +23,10 @@
 syn keyword openscadRepeat for intersection_for
 syn keyword openscadInclude include use
 syn keyword openscadCsgKeyword union difference intersection render intersection_for
-syn keyword openscadTransform scale rotate translate mirror multmatrix color minkowski 
+syn keyword openscadTransform scale rotate translate mirror multmatrix color minkowski hull linear_extrude rotate_extrude
 syn keyword openscadPrimitiveSolid cube sphere cylinder polyhedron surface
 syn keyword openscadPrimitive2D square circle polygon import_dxf
+syn keyword openscadPrimitiveImport import
 syn match openscadSpecialVariable "\$[a-zA-Z]\+\>" display
 syn match openscadModifier "^\s*[\*\!\#\%]" display
@@ -66,6 +67,7 @@
 hi def link openscadNumber                         Number
 hi def link openscadPrimitiveSolid             Keyword
 hi def link openscadPrimitive2D                Keyword
+hi def link openscadPrimitiveImport    Keyword
 hi def link openscadRepeat                         Repeat
 hi def link openscadSpecialVariable            Special
 hi def link openscadString                         String

-- 09:49, January 11, 2014 (UTC)

Note: I just noticed that there's a github project for this, so I added a pull request there.

-- 10:14, January 11, 2014 (UTC)


Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki