]> git.draconx.ca Git - vimconf.git/blobdiff - ftplugin/glsl.vim
Add GLSL syntax highlighting.
[vimconf.git] / ftplugin / glsl.vim
diff --git a/ftplugin/glsl.vim b/ftplugin/glsl.vim
new file mode 100644 (file)
index 0000000..04022de
--- /dev/null
@@ -0,0 +1,13 @@
+" TODO: #version appears exactly once in the file, before any non-whitespace
+" (i.e. possibly after a length comment).  Checking only the first 10 lines
+" is an incorrect hack.
+for item in getline(1,10)
+       if item =~ "#version 400"
+               execute ':set syntax=glsl400'
+               break
+       endif
+       if item =~ "#version 330"
+               execute ':set syntax=glsl330'
+               break
+       endif
+endfor