From 746c27cdc15fed13431cfcc2ddc428d6a8920039 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 15 Dec 2012 21:15:47 +0000 Subject: [PATCH] vimlol: improve the LolFx syntax handling. --- tools/vimlol/vimlol.vim | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tools/vimlol/vimlol.vim b/tools/vimlol/vimlol.vim index 398c3b04..91657cd0 100644 --- a/tools/vimlol/vimlol.vim +++ b/tools/vimlol/vimlol.vim @@ -41,7 +41,29 @@ au Syntax cpp """ -""" For now, pretend .lolfx is C++ +""" LolFx language handler """ -au BufRead,BufNewFile *.lolfx let b:current_syntax = "cpp" + +" For now, pretend .lolfx is C++ +au BufRead,BufNewFile *.lolfx set syntax=cpp + +" New sampler types (GLSL) +au BufRead,BufNewFile *.lolfx syn match cType + \ "\" + \ "\" + +" Type constructs (LolFx) +au BufRead,BufNewFile *.lolfx syn keyword cppStructure + \ technique pass precision + +" Variable attributes (GLSL and some HLSL) +au BufRead,BufNewFile *.lolfx syn keyword cType + \ in out uniform attribute varying + +" Texture operators (GLSL and HLSL) +au BufRead,BufNewFile *.lolfx syn keyword cppOperator + \ texture1D texture2D texture3D tex2D tex3D + +" Handle #version constructs +au BufRead,BufNewFile *.lolfx syn region cPreProc start="^\s*\(%:\|#\)\s*version\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell