shrub/indent/hoon.vim

32 lines
456 B
VimL
Raw Normal View History

2013-09-29 03:02:44 +04:00
" Public Domain
" Credit Goes to fode
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal nolisp
setlocal autoindent
if exists("*HoonIndent")
finish
endif
function! HoonIndent(lnum)
let prevlnum = prevnonblank(a:lnum-1)
if prevlnum == 0
return 0
endif
let prevl = substitute(getline(prevlnum),'::.*$','','')
if prevl =~ '\+\+\s*\w*\s*$'
" luslus operator
let ind += &sw
endif
return ind
endfunction