summaryrefslogtreecommitdiffstats
path: root/autoload/polyglot/detect.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/polyglot/detect.vim')
-rw-r--r--autoload/polyglot/detect.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/autoload/polyglot/detect.vim b/autoload/polyglot/detect.vim
index cac826cf..2b1900e6 100644
--- a/autoload/polyglot/detect.vim
+++ b/autoload/polyglot/detect.vim
@@ -134,6 +134,18 @@ func! polyglot#detect#Fs(...)
set ft=forth | return
endfunc
+func! polyglot#detect#Frag(...)
+ if a:0 != 1 && did_filetype()
+ return
+ endif
+ for lnum in range(1, min([line("$"), 50]))
+ let line = getline(lnum)
+ if line =~# '\s*\(#version\|precision\|uniform\|varying\|vec[234]\)'
+ set ft=glsl | return
+ endif
+ endfor
+endfunc
+
func! polyglot#detect#Re(...)
if a:0 != 1 && did_filetype()
return