on master help sign in
Merge pull request #61 from raichoo/vimcodata

vim support for new features

commitcad5efb84afd064da7a5593f17bfc3bb6a499070 authorEdwin Brady <edwin.brady@gmail.com> dateWed 24 Oct 2012, 12:30 (14 years ago) parentbf8685eda79b2c
2 files changed+12−12
contribs/tool-support/vim/indent/idris.vim+3−3 contribs/tool-support/vim/syntax/idris.vim+9−9
contribs/tool-support/vim/indent/idris.vim+3−3
@@ -95,7 +95,7 @@ function! GetIdrisIndent()
9595 return match(prevline, 'do') + g:idris_indent_do
9696 endif
9797
98− if prevline =~ '^\s*data\s\+[^=]\+\s\+=\s\+\S\+.*$'
98+ if prevline =~ '^\s*\(co\)\?data\s\+[^=]\+\s\+=\s\+\S\+.*$'
9999 return match(prevline, '=')
100100 endif
101101
@@ -107,8 +107,8 @@ function! GetIdrisIndent()
107107 return match(prevline, 'case') + g:idris_indent_case
108108 endif
109109
110− if prevline =~ '^\s*\(namespace\|data\)\s\+\S\+\s*$'
111− return match(prevline, '\(namespace\|data\)') + &shiftwidth
110+ if prevline =~ '^\s*\(namespace\|\(co\)\?data\)\s\+\S\+\s*$'
111+ return match(prevline, '\(namespace\|\(co\)\?data\)') + &shiftwidth
112112 endif
113113
114114 if prevline =~ '^\s*using\s\+([^(]*)\s*$'
contribs/tool-support/vim/syntax/idris.vim+9−9
@@ -8,9 +8,9 @@
88
99syn match idrisModule "\<\(module\|namespace\)\>"
1010syn match idrisImport "\<import\>"
11−syn match idrisStructure "\<\(class\|data\|instance\|where\|record\)\>"
11+syn match idrisStructure "\<\(class\|\(co\)\?data\|instance\|where\|record\)\>"
1212syn match idrisVisibility "\<\(public\|abstract\|private\)\>"
13−syn match idrisStatement "\<\(do\|case\|of\|let\|in\|with\|total\|dsl\|auto\|using\)\>"
13+syn match idrisStatement "\<\(do\|case\|of\|let\|in\|with\|total\|\|partial\|dsl\|auto\|using\)\>"
1414syn match idrisSyntax "\(pattern \+\|term \+\)\?syntax"
1515syn match idrisConditional "\<\(if\|then\|else\)\>"
1616syn match idrisTactic contained "\<\(intros\?\|rewrite\|exact\|refine\|trivial\|let\|focus\|try\|compute\|solve\|attack\)\>"
@@ -23,13 +23,13 @@ syn match idrisType "\<\([A-Z][a-zA-Z0-9_]*\|_|_\)\>"
2323syn match idrisLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
2424syn match idrisMetaVar "?[a-z][A-Za-z0-9_]\+"
2525syn match idrisLink "%\(lib\|link\|include\)"
26−syn match idrisAccess "%access"
26+syn match idrisDirective "%\(access\|default\)"
2727syn region idrisString start=+"+ skip=+\\\\\|\\"+ end=+"+
2828syn region idrisBlockComment start="{-" end="-}"
2929syn region idrisProofBlock start="\(default\s\+\)\?proof *{" end="}" contains=idrisTactic
3030
31−highlight def link idrisImport Include
32−highlight def link idrisModule idrisStructure
31+highlight def link idrisImport Structure
32+highlight def link idrisModule Structure
3333highlight def link idrisStructure Structure
3434highlight def link idrisStatement Statement
3535highlight def link idrisSyntax Statement
@@ -37,15 +37,15 @@ highlight def link idrisVisibility Statement
3737highlight def link idrisConditional Conditional
3838highlight def link idrisProofBlock Macro
3939highlight idrisTactic ctermfg=cyan
40−highlight idrisLink ctermbg=yellow ctermfg=magenta
41−highlight idrisAccess ctermbg=magenta ctermfg=yellow
40+highlight def link idrisLink Statement
41+highlight def link idrisDirective Statement
4242highlight def link idrisNumber Number
4343highlight def link idrisFloat Float
4444highlight def link idrisDelimiter Delimiter
4545highlight def link idrisInfix PreProc
4646highlight def link idrisOperators Operator
47−highlight def link idrisType Type
47+highlight def link idrisType Include
4848highlight def link idrisLineComment Comment
4949highlight def link idrisBlockComment Comment
50−highlight idrisMetaVar ctermbg=cyan ctermfg=black
50+highlight idrisMetaVar ctermfg=lightred
5151highlight def link idrisString String