sponsor Vim development Vim logo Vim Book Ad

glsl.vim : Syntax file for the OpenGL Shading Language GLSL GLSlang

 script karma  Rating 328/141, Downloaded by 6902  Comments, bugs, improvements  Vim wiki

created by
Nathan Cournia
script type
Syntax file for the OpenGL Shading Language.  The following is highlighted (as defined in the
Orange Book):

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

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

All reserverd keywords (that GLSL currently does not use) are highlighted as errors.

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

cp glsl.vim $HOME/.vim/syntax/.

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

au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.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 1.10.00 2004-06-30 6.0 Nathan Cournia - Updated syntax to match GLSL 1.10.59
- Swizzles no longer conflict with structure member vars.
  For example: the .s in gl_Light[0].shininess is no
  longer incorrectly highlighted. (Thanks Nico Galoppo)
glsl.vim 1.00.01 2004-06-23 6.0 Nathan Cournia - The following are now highlighted correctly:
    - .p swizzle
    - gl_MultiTexCoordN
glsl.vim 1 2004-06-04 6.0 Nathan Cournia 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.