From 269f6d3dd0ba76bb6ef563990c03f116599da86a Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 29 Mar 2017 10:30:22 -0700 Subject: [PATCH] Add Vim syntax support for Name and HexSequence tokens. Also disable spell checking for .cton files. They tend to contain very few words, and even comments are pretty cryptic. --- misc/vim/syntax/cton.vim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/misc/vim/syntax/cton.vim b/misc/vim/syntax/cton.vim index 2d2dcd0fef..7d6bdab08c 100644 --- a/misc/vim/syntax/cton.vim +++ b/misc/vim/syntax/cton.vim @@ -9,16 +9,22 @@ elseif exists("b:current_syntax") finish endif +" Disable spell checking even in comments. +" They tend to refer to weird stuff like assembler mnemonics anyway. +syn spell notoplevel + syn keyword ctonHeader test isa set syn keyword ctonDecl function stack_slot jump_table syn keyword ctonFilecheck check sameln nextln unordered not regex contained syn match ctonType /\<[bif]\d\+\(x\d\+\)\?\>/ -syn match ctonEntity /\<\(v\|vx\|ss\|jt\|\)\d\+\>/ +syn match ctonEntity /\<\(v\|vx\|ss\|jt\|fn\|sig\)\d\+\>/ syn match ctonLabel /\/ +syn match ctonName /%\w\+\>/ syn match ctonNumber /-\?\<\d\+\>/ syn match ctonNumber /-\?\<0x\x\+\(\.\x*\)\(p[+-]\?\d\+\)\?\>/ +syn match ctonHexSeq /#\x\+\>/ syn region ctonCommentLine start=";" end="$" contains=ctonFilecheck @@ -27,7 +33,9 @@ hi def link ctonDecl Keyword hi def link ctonType Type hi def link ctonEntity Identifier hi def link ctonLabel Label +hi def link ctonName String hi def link ctonNumber Number +hi def link ctonHexSeq Number hi def link ctonCommentLine Comment hi def link ctonFilecheck SpecialComment