OpenGL Shading Language (GLSL) Vim syntax highlighting.
Using the Pathogen plugin:
-
From your
~/.vim
directory:git submodule add https://github.com/beyondmarc/glsl.vim.git bundle/glsl.vim
If not using the Pathogen plugin:
-
Add this directory to your
runtimepath
, in your.vimrc
:set rtp^=/path/to/glsl.vim
The plugin will try to automatically detect which version to use by looking for
the text #version XXX
in the 30 first lines of the file.
If the version of the file can't be determined, the default version will be used.
To set the default GLSL version for which the syntax is loaded, set the global
variable glsl_default_version
in your .vimrc
before loading the plugin:
let g:glsl_default_version = 'glsl330'
If this variable is not set, it will default to glsl330
.
To set the list of file extensions for which the syntax is loaded, set the
global variable glsl_file_extensions
in your .vimrc
before loading the plugin:
let g:glsl_file_extensions = '*.glsl,*.vsh,*.fsh,*.vert,*.tesc,*.tese,*.geom,*.frag,*.comp'
If this variable is not set, it will default to *.glsl,*.vsh,*.fsh,*.vert,*.tesc,*.tese,*.geom,*.frag,*.comp
.