Skip to content
Vim GLSL Syntax Highlighting with GL_KHR_vulkan_glsl
Branch: master
Clone or download
Pull request Compare This branch is 17 commits ahead of tikhomirov:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ftdetect
indent
syntax
license.md
readme.md

readme.md

vim-glsl

This plugin provides Vim syntax highlighting for the OpenGL Shading Language (GLSL) along with the GL_KHR_vulkan_glsl extension for Vulkan. It also highlights #include directives, which are widely used (even if it's non-standard), and supports the syntax-flavour found in glslc and shaderc. It also includes many missing keywords which were "forgotten" in tikhomirov's original version, like the subroutine and component keywords available in GLSL 4.6 (even if they aren't used that much).

If you find anything missing, please open a GitHub issue or create a PR and I'll get to work.

It applies syntax highlighting to the glslang file extensions: .glsl, .vert, .tesc, .tese, .geom, .frag, and .comp.

If you want to support highlighting in files with other extensions (e.g. .vs or .fs) you can do so by using autocommand:

autocmd! BufNewFile,BufRead *.vs,*.fs set ft=glsl

Supported GLSL Versions

  • OpenGL Shading Language: all versions from 1.10 to 4.60
    • Added missing component layout qualifier
    • Added missing subroutine
  • OpenGL ES Shading Language: versions 1.00 and 3.00
  • The Vulkan extensions found in GL_KHR_vulkan_glsl too:
    • shaderc-style #include directives
    • constant_id and push_constant layout qualifiers
    • gl_VertexIndex and gl_InstanceIndex
    • Ability to specify descriptor sets with set qualifier
    • Support for the various subpassInput descriptors
    • Ability to speicfy input_attachment_index in layout
    • The subpassLoad built-in function for Vulkan
    • Both the imageBuffer and textureBuffer descriptors
    • And finally sampler and samplerShadow

Installation

Using Vundle

Add this to your vimrc:

Plugin 'CaffeineViking/vim-glsl'

Then reload your vimrc and run :PluginInstall.

Using Pathogen

$ cd ~/.vim/bundle
$ git clone https://github.com/CaffeineViking/vim-glsl

Then run :Helptags to generate help tags.

You can’t perform that action at this time.