sponsor Vim development Vim logo Vim Book Ad

glsl.vim : Syntax File for the Desktop OpenGL Shading Language Version 4.6 GLSL GLSlang

 script karma  Rating 5/5, Downloaded by 75  Comments, bugs, improvements  Vim wiki

created by
Richard Van Natta
script type
Syntax file for the OpenGL Shading Language version 4.6.  The following is highlighted (as defined in the Orange Book):

- All gl_ variables
- All built-in functions
- All keywords

This is an updated version of the top hit on duckduckgo and bing (script 1002), which hasn't been updated in 14 years.

The syntax file was modified from c.vim, so you can expect that your GLSL shaders will be highlighted similar to C files.

All reserved keywords (that GLSL currently does not use) are highlighted as errors. User labels are highlighted as errors.

Keywords: glsl glslang opengl shading language
install details
Place glsl.vim in your syntax directory:

cp glsl.vim ~/.vim/syntax/.

Enable highlighting with glsl.vim in your .vimrc with:

au BufNewFile,BufRead *.comp,*.frag,*.tese,*.tesc,*.geom,*.vert,*.glsl setf glsl

or explicitly set the syntax with:

set syntax=glsl

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
glsl.vim 2.0 2018-11-18 6.0 Richard Van Natta Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
OSDN.net Logo