Added syntax highlighting for vim
parent
2e4e5bff3d
commit
c5a1cda975
|
@ -0,0 +1,38 @@
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
set iskeyword=a-z,A-Z,-,*,_,!,@
|
||||||
|
|
||||||
|
" Language keywords
|
||||||
|
syntax keyword ceevKeywords let unlet
|
||||||
|
|
||||||
|
syntax keyword ceevConstant Character
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syntax region ceevCommentLine start="//" end="$" contains=ceevTodos
|
||||||
|
|
||||||
|
" String literals
|
||||||
|
syntax region ceevString start=/\v"/ skip=/\v\\./ end=/\v"/ contains=ceevEscapes
|
||||||
|
|
||||||
|
" Char literals
|
||||||
|
syntax region ceevChar start=/\v'/ skip=/\v\\./ end=/\v'/ contains=ceevEscapes
|
||||||
|
|
||||||
|
" Escape literals \n, \r, ....
|
||||||
|
syntax match ceevEscapes display contained "\\[nr\"']"
|
||||||
|
|
||||||
|
" Number literals
|
||||||
|
syntax region ceevNumber start=/\s\d/ skip=/\d/ end=/\s/
|
||||||
|
|
||||||
|
" Set highlights
|
||||||
|
highlight default link ceevTodos Todo
|
||||||
|
highlight default link ceevKeywords Keyword
|
||||||
|
highlight default link ceevConstant Constant
|
||||||
|
highlight default link ceevCommentLine Comment
|
||||||
|
highlight default link ceevString String
|
||||||
|
highlight default link ceevNumber Number
|
||||||
|
highlight default link ceevTypeNames Type
|
||||||
|
highlight default link ceevChar Character
|
||||||
|
highlight default link ceevEscapes SpecialChar
|
||||||
|
|
||||||
|
let b:current_syntax = "ceev"
|
|
@ -0,0 +1 @@
|
||||||
|
autocmd BufNewFile,BufRead *.cv setf ceev
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -z $1 ]]; then echo "Expected a file but got nothing"; exit 1; fi
|
||||||
|
|
||||||
|
cp $1 ~/.vim/syntax/$1
|
||||||
|
cp "${1}.ftd" ~/.vim/ftdetect/$1
|
||||||
|
|
||||||
|
echo "Installed $1"
|
Loading…
Reference in New Issue