added the tengo syntax highlight.
This commit is contained in:
parent
b7fbf1db65
commit
50a89054a8
4 changed files with 105 additions and 0 deletions
2
nvim/ftdetect/tengo.vim
Normal file
2
nvim/ftdetect/tengo.vim
Normal file
|
@ -0,0 +1,2 @@
|
|||
autocmd BufRead,BufNewFile *.tengo set filetype=tengo
|
||||
|
11
nvim/ginit.vim
Normal file
11
nvim/ginit.vim
Normal file
|
@ -0,0 +1,11 @@
|
|||
let s:fontsize = 12
|
||||
function! AdjustFontSize(amount)
|
||||
let s:fontsize = s:fontsize+a:amount
|
||||
:execute "GuiFont! Monospace:h" . s:fontsize
|
||||
endfunction
|
||||
|
||||
noremap <C-ScrollWheelUp> :call AdjustFontSize(1)<CR>
|
||||
noremap <C-ScrollWheelDown> :call AdjustFontSize(-1)<CR>
|
||||
inoremap <C-ScrollWheelUp> <Esc>:call AdjustFontSize(1)<CR>a
|
||||
inoremap <C-ScrollWheelDown> <Esc>:call AdjustFontSize(-1)<CR>a
|
||||
|
6
nvim/lua/filetypes.lua
Normal file
6
nvim/lua/filetypes.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
pmd = "markdown",
|
||||
},
|
||||
})
|
86
nvim/syntax/tengo.vim
Normal file
86
nvim/syntax/tengo.vim
Normal file
|
@ -0,0 +1,86 @@
|
|||
" Vim syntax file
|
||||
" Language: Tengo
|
||||
" Maintainer: E Sequeira <raised-vestals-0g@icloud.com>
|
||||
" URL: https://github.com/geseq/vim-tengo
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
" Folding
|
||||
syn region FoldingBrace start="{" end="}" transparent fold
|
||||
syn region FoldingParen start='(' end=')' transparent fold
|
||||
|
||||
" Interpreter directive
|
||||
syn match HashBang "\%1l^#!.*"
|
||||
hi def link HashBang PreProc
|
||||
|
||||
" Comments
|
||||
syn region CommentBlock start="/\*" end="\*/"
|
||||
syn region CommentBlock start="//" end="$"
|
||||
|
||||
hi def link CommentBlock Comment
|
||||
|
||||
" Interpreted strings
|
||||
syn region InterpString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn region InterpString start=+`+ skip=+\\\\\|\\"+ end=+`+
|
||||
hi def link InterpString string
|
||||
|
||||
" Raw strings
|
||||
syn region RawString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||
hi def link RawString character
|
||||
|
||||
" Built-in functions
|
||||
syn keyword BuiltinFuncs format len copy append delete splice type_name
|
||||
syn keyword BuiltinFuncs string int bool float char bytes time error range
|
||||
syn keyword BuiltinFuncs is_string is_int is_bool is_float is_char is_bytes is_error
|
||||
syn keyword BuiltinFuncs is_undefined is_function is_callable is_array is_immutable_array
|
||||
syn keyword BuiltinFuncs is_map is_immutable_map is_iterable is_time
|
||||
|
||||
hi def link BuiltinFuncs Keyword
|
||||
|
||||
|
||||
" Functions
|
||||
syn match FuncDecl /\<func\>/
|
||||
hi def link FuncDecl Type
|
||||
|
||||
" Floating point
|
||||
syn match FloatLit "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
||||
syn match FloatLit "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
||||
syn match FloatLit "\<\d\+[Ee]-\d\+\>"
|
||||
|
||||
hi def link FloatLit Float
|
||||
|
||||
" Integers
|
||||
syn match Integers "\<0x\x\+\>"
|
||||
syn match Integers "\<0\o\+\>"
|
||||
syn match Integers "\<\d\+\([Ee]\d\+\)\?\>"
|
||||
syn match Integers "\<\d\+\([Ee]+\d\+\)\?\>"
|
||||
|
||||
hi def link Integers Number
|
||||
|
||||
" Constants
|
||||
syn keyword Constants true false undefined
|
||||
hi def link Constants Keyword
|
||||
|
||||
" Keywords
|
||||
syn keyword CtrlWords return break continue
|
||||
syn keyword CondWords if else
|
||||
syn keyword Directive import export
|
||||
syn keyword RepeatWords for in
|
||||
syn keyword Declaration var error immutable
|
||||
|
||||
hi def link CtrlWords Statement
|
||||
hi def link CondWords Conditional
|
||||
hi def link Directive Statement
|
||||
hi def link RepeatWords Repeat
|
||||
hi def link Declaration Keyword
|
||||
|
||||
" Function call
|
||||
syntax match FuncCall /\<\K\k*\ze(/
|
||||
hi def link FuncCall Keyword
|
||||
|
||||
let b:current_syntax = 'tengo'
|
||||
|
Loading…
Reference in a new issue