Created
November 16, 2017 21:55
-
-
Save daniellivingston/42c75f39b6fdd342f1ffe3fd73193311 to your computer and use it in GitHub Desktop.
LaGriT Syntax file for ViM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: LaGriT | |
" Maintainer: Daniel Livingston | |
" Latest Revision: 16 November 2017 | |
" To install: copy to ~/.vim/syntax/lagrit.vim | |
" ---------------------------------------------------- " | |
" if exists("b:current_syntax") | |
" finish | |
" endif | |
" Match floating point or integers | |
syn match LGNumbers '\d\+' | |
syn match LGNumbers '[-+]\d\+' | |
syn match LGNumbers '[-+]\d\+\.\d*' | |
" Capture words with numbers appended, i.e. mo1, to avoid number highlighting | |
syn match LGNull '[A-Za-z]\+[0-9]\+' | |
" syn match LGNull '[,/=" "]\+' | |
" For a command line, first and second entries | |
syn match argOne '^\zs[^\/]\+\ze' contained | |
syn match argTwo '\/\zs[^\/]\+\ze\/' contained | |
syn match argOneTwo '^\zs[^\/]\+\/[^\/]\+\ze\/' contains=argOne,argTwo | |
" Select keywords that should be highlighted differently | |
syn keyword argFinish finish | |
syn keyword argSingle setpts settets connect geniee triangulate quality and | |
syn keyword argQualifiers rtp xyz all brief seq nod minmax list value node element both le gt ge eq lt imt itetclr | |
syn keyword argLast minmax quad plane box hex tet tri ascii binary def inclusive | |
syn keyword argOneShort rmpoint resetpts | |
syn keyword argTwoShort compress itp status | |
" Comments | |
syn match LGComment "[#*].*$" | |
" Link matches to highlighting classes | |
hi def link argQualifiers Identifier | |
hi def link argTwo Statement | |
hi def link argOne Type | |
hi def link argTwoShort Statement | |
hi def link argOneShort Type | |
hi def link argFinish PreProc | |
hi def link argSingle Type | |
hi def link LGComment Comment | |
hi def link LGNumbers Constant | |
hi def link argLast Statement | |
let b:current_syntax = "lagrit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" IMPORTANT NOTE: | |
" MUST be renamed 'lagrit.vim' | |
" Copy into ~/.vim/ftdetect/lagrit.vim | |
autocmd BufRead,BufNewFile *.lgi set filetype=lagrit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy
lagrit.vim
to~/.vim/syntax/lagrit.vim
.Rename
lagrit_2.vim
tolagrit.vim
and copy to~/.vim/ftdetect/lagrit.vim
.May have to create
syntax
andftdetect
folders if you don't have any other syntax files installed.