mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-10 04:23:51 -05:00
Update scala
This commit is contained in:
@@ -4,18 +4,21 @@
|
|||||||
" Modifications by : Derek Wyatt
|
" Modifications by : Derek Wyatt
|
||||||
" Last Change: 2011 Mar 19 (Derek Wyatt)
|
" Last Change: 2011 Mar 19 (Derek Wyatt)
|
||||||
|
|
||||||
"if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
" finish
|
finish
|
||||||
"endif
|
endif
|
||||||
"let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
setlocal indentexpr=GetScalaIndent()
|
setlocal indentexpr=GetScalaIndent()
|
||||||
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>
|
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>
|
||||||
setlocal autoindent
|
setlocal autoindent
|
||||||
|
setlocal softtabstop=2
|
||||||
|
setlocal tabstop=2
|
||||||
|
setlocal shiftwidth=2
|
||||||
|
|
||||||
"if exists("*GetScalaIndent")
|
if exists("*GetScalaIndent")
|
||||||
" finish
|
finish
|
||||||
"endif
|
endif
|
||||||
|
|
||||||
let s:defMatcher = '\%(\%(private\|protected\)\%(\[[^\]]*\]\)\?\s\+\|abstract\s\+\|override\s\+\)*\<def\>'
|
let s:defMatcher = '\%(\%(private\|protected\)\%(\[[^\]]*\]\)\?\s\+\|abstract\s\+\|override\s\+\)*\<def\>'
|
||||||
let s:funcNameMatcher = '\w\+'
|
let s:funcNameMatcher = '\w\+'
|
||||||
|
|||||||
@@ -4,8 +4,19 @@ elseif exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
scriptencoding utf-8
|
||||||
|
|
||||||
let b:current_syntax = "scala"
|
let b:current_syntax = "scala"
|
||||||
|
|
||||||
|
function! s:ContainedGroup()
|
||||||
|
try
|
||||||
|
silent syn list @scala
|
||||||
|
return '@scala'
|
||||||
|
catch /E392/
|
||||||
|
return 'TOP'
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
syn sync minlines=200 maxlines=1000
|
syn sync minlines=200 maxlines=1000
|
||||||
|
|
||||||
@@ -17,7 +28,7 @@ syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skip
|
|||||||
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
|
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
|
||||||
hi link scalaKeyword Keyword
|
hi link scalaKeyword Keyword
|
||||||
|
|
||||||
syn region scalaBlock start=/{/ end=/}/ contains=TOP fold
|
exe 'syn region scalaBlock start=/{/ end=/}/ contains=' . s:ContainedGroup() . ' fold'
|
||||||
|
|
||||||
syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome
|
syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome
|
||||||
hi link scalaAkkaSpecialWord PreProc
|
hi link scalaAkkaSpecialWord PreProc
|
||||||
@@ -103,13 +114,13 @@ hi link scalaIString String
|
|||||||
hi link scalaTripleIString String
|
hi link scalaTripleIString String
|
||||||
|
|
||||||
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
||||||
syn region scalaInterpolationB matchgroup=scalaInterpolation start=/\${/ end=/}/ contained contains=TOP
|
exe 'syn region scalaInterpolationB matchgroup=scalaInterpolation start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
|
||||||
hi link scalaInterpolation Function
|
hi link scalaInterpolation Function
|
||||||
hi link scalaInterpolationB Normal
|
hi link scalaInterpolationB Normal
|
||||||
|
|
||||||
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
|
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
|
||||||
syn region scalaFInterpolationB matchgroup=scalaFInterpolation start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=TOP
|
exe 'syn region scalaFInterpolationB matchgroup=scalaFInterpolation start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
|
||||||
hi link scalaFString String
|
hi link scalaFString String
|
||||||
hi link scalaFInterpolation Function
|
hi link scalaFInterpolation Function
|
||||||
hi link scalaFInterpolationB Normal
|
hi link scalaFInterpolationB Normal
|
||||||
|
|||||||
Reference in New Issue
Block a user