misc: update highlighters and indenters
[nit.git] / misc / vim / indent / nit.vim
index 0b18e7d..4e1555d 100644 (file)
@@ -30,17 +30,21 @@ setlocal nosmartindent
 setlocal nocindent
 setlocal autoindent
 setlocal comments=:#
-setlocal indentkeys+==end,=else,=do,=var,0!,=then,=special,=class,=interface,=universal
-setlocal sw=8
+setlocal indentkeys+==end,=else,=catch,=do,=var,0!,=then,=loop,=special,=class,=interface,=universal
+
+" Only define the function once.
+if exists("*GetNITIndent")
+       finish
+endif
 
 " Indent after
-let s:relative_indent = '\<\(do\|then\|else\|if\)\s*\(#\|$\)\|^\s*\(\<\(redef\|private\)\>\s*\)\?\(\<abstract\>\s*\)\?\<\(class\|interface\|universal\|special\)\>'
+let s:relative_indent = '\<\(do\|loop\|then\|else\|catch\|if\)\s*\(#\|$\)\|^\s*\(\<\(redef\|private\)\>\s*\)\?\(\<abstract\>\s*\)\?\<\(class\|interface\|universal\|special\)\>'
 " Unindent on them
-let s:outdent = '^\s*\(else\|then\|end\)\>'
+let s:outdent = '^\s*\(catch\|else\|then\|end\)\>'
 " At 0
 let s:no_indent = '^\s*\(class\|import\|special\)\>'
 
-let s:syng_strcom = '\<nit\%(String\|StringDelimiter\|Escape\|Comment\|Documentation\)\>'
+let s:syng_strcom = '\<NIT\(String\|StringDelimiter\|Escape\|Comment\|Documentation\)\>'
 
 " Check if the character at lnum:col is inside a string, comment, or is ascii.
 function s:IsInStringOrComment(lnum, col)
@@ -52,11 +56,6 @@ function s:Match(lnum, regex)
        return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0
 endfunction
 
-" Only define the function once.
-if exists("*GetNITIndent")
-       finish
-endif
-
 function GetNITIndent()
        " Find a non-blank line above the current line.
        let plnum = prevnonblank(v:lnum - 1)