Browse Source

Updates syntax highlighting to better highlight the current language

master
sloum 10 months ago
parent
commit
cccce1eeef
  1. 5
      indent/nimf.vim
  2. 44
      syntax/nimf.vim

5
indent/nimf.vim

@ -23,10 +23,7 @@ function! NimfIndent()
let prevline = getline(prevlnum)
let midx = match(prevline, '^\s*\%(\<if\>\|\<do\>\|\<else\>\)')
if midx == -1
let midx = match(prevline, '{\s*$')
if midx == -1
let midx = match(prevline, '\<:\>\s*')
endif
let midx = match(prevline, '^:\s*\S.*')
endif
if midx != -1

44
syntax/nimf.vim

@ -1,7 +1,7 @@
" Vim syntax file
" " Language: nimf
" " Maintainer: sloum < sloum AT rawtext.club >
" " Latest Revision: 26 July 2020
" " Latest Revision: 08 Feb 2021
"
" For version 5.x: Clear all syntax items
@ -27,47 +27,39 @@ endif
syn region nimfComment start=/\<(\>/ end=/\<)\>/ contains=nimfTodo
" Strings, needs work to require (^|\s) before, couldnt get it to work
syn match nimfStringLiteral /\<"\>.*\<"\>/
syn match nimfStringLiteral /\<"\>.*\<"\>/ contains=nimfEscape
" Adds highlighting for integers
syn match nimfInt '\<-\=[0-9]*[0-9]\+\>'
" Escapes in strings
syn match nimfEscape /\\\h\{1}/ contained
syn match nimfChar /\<`\\\=\S\{1}\>/ contains=nimfEscape
" keywords for language keywords
syn keyword nimfConditional if then else
syn keyword nimfLoop do loop
syn keyword nimfStatement var svar allot
syn keyword nimfOperators + - / * % /% ++ --
syn keyword nimfMemory @ ! +! ? <r r> r@
syn keyword nimfComparison > < = >= <= 0= != 0< !0
syn keyword nimfComparison and or
syn keyword nimfOperators + - / * % /% ++ -- < > <= >= = != and or && ||
syn keyword nimfMemory @ ! +! ? <r r> r@ set get set-string get-string set-raw-string var scar allot
syn match nimfWordDef '\<:m\?\s*[^ \t]\+\>'
syn keyword nimfWordDef ;
syn keyword nimfInclude inline
syn match nimfInclude /module-end/
syn keyword nimfInclude inline module-end
syn keyword nimfException error exit halt
syn keyword nimfTodo TODO XXX FIXME BUG NOTE contained
syn keyword nimfSub dup drop . .s .r print prints swap
syn keyword nimfSub over roll pick bye words rdepth
syn keyword nimfSub depth clearstack page cr space neg
syn keyword nimfSub input emit sleep allot see 2dup abs
syn keyword nimfSub windsize at-xy rdepth key
syn keyword nimfTodo TODO XXX FIXME BUG NOTE DEBUG contained
highlight link nimfInclude Include
highlight link nimfWordDef Identifier
highlight link nimfStatement Identifier
highlight link nimfSub Function
highlight link nimfInt Constant
highlight link nimfComment Comment
highlight link nimfStringLiteral String
highlight link nimfEscape Delimiter
highlight link nimfChar String
highlight link nimfTodo Todo
highlight link nimfException Exception
highlight link nimfInt Number
highlight link nimfOperators Operator
highlight link nimfInclude PreProc
highlight link nimfMemory StorageClass
highlight link nimfConditional Conditional
highlight link nimfComparison Label
highlight link nimfLoop Repeat
highlight link nimfException Exception
highlight link nimfTodo Todo
highlight link nimfMemory StorageClass
highlight link nimfWordDef Identifier

Loading…
Cancel
Save