init commit

This commit is contained in:
ericfode 2013-09-28 16:02:44 -07:00
commit 5e3b72b0e5
3 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,2 @@
au BufNewfile,BufEnter *.hoon setf hoon

31
indent/hoon.vim Normal file
View File

@ -0,0 +1,31 @@
" 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

41
syntax/hoon.vim Normal file
View File

@ -0,0 +1,41 @@
"hoon.vim: Hoon syntax file
"Credit goes to Fode
"
if exists("b:current_syntax")
finish
endif
syn case match
" comments
" Declerations
hi def link hoonDeclaration Define
hi def link hoonSymbol Constant
hi def link hoonAtom Keyword
hi def link hoonRune Keyword
hi def link hoonBranch Conditional
hi def link hoonType Type
hi def link hoonName Constant
syn match hoonDeclaration "++" nextgroup=hoonSymbolDec skipwhite
syn match hoonBranch /?[^\w\s]/
syn match hoonSymbol /%\w*/
syn keyword hoonAtom @
syn match hoonName "\w*" contained
syn match hoonSymbolDec "\w*" contained contains=hoonName
" strings
hi def link hoonComment Comment
syn region hoonComment start="::" end="$" contains=@spell
hi def link hoonString String
syn region hoonString start=+'+ end=+'+ contains=@spell
let b:current_syntax = "hoon"