@@ -3,7 +3,7 @@
3" Based on haskell indentation by motemen <motemen@gmail.com>
3" Based on haskell indentation by motemen <motemen@gmail.com>
5" author: raichoo (raichoo@googlemail.com)
5" author: raichoo (raichoo@googlemail.com)
6−" date: Nov 2 2012
6+" date: Mar 19 2013
8" Modify g:idris_indent_if and g:idris_indent_case to
8" Modify g:idris_indent_if and g:idris_indent_case to
9" change indentation for `if'(default 3) and `case'(default 5).
9" change indentation for `if'(default 3) and `case'(default 5).
@@ -36,6 +36,12 @@ if !exists('g:idris_indent_let')
36 let g:idris_indent_let = 4
36 let g:idris_indent_let = 4
39+if !exists('g:idris_indent_rewrite')
40+ " rewrite prf in expr
42+ let g:idris_indent_rewrite = 8
39if !exists('g:idris_indent_where')
45if !exists('g:idris_indent_where')
40 " where f : Nat -> Nat
46 " where f : Nat -> Nat
41 " >>>>>>f x = x
47 " >>>>>>f x = x
@@ -71,6 +77,10 @@ function! GetIdrisIndent()
71 return match(prevline, 'let') + g:idris_indent_let
77 return match(prevline, 'let') + g:idris_indent_let
80+ if prevline =~ '\<rewrite\>\s\+.\+\<in\>\s*$'
81+ return match(prevline, 'rewrite') + g:idris_indent_rewrite
74 if prevline !~ '\<else\>'
84 if prevline !~ '\<else\>'
75 let s = match(prevline, '\<if\>.*\&.*\zs\<then\>')
85 let s = match(prevline, '\<if\>.*\&.*\zs\<then\>')