mirror of
https://github.com/urbit/shrub.git
synced 2024-11-24 04:58:08 +03:00
init commit
This commit is contained in:
commit
5e3b72b0e5
2
ftdetect/hoonfiletype.vim
Normal file
2
ftdetect/hoonfiletype.vim
Normal file
@ -0,0 +1,2 @@
|
||||
au BufNewfile,BufEnter *.hoon setf hoon
|
||||
|
31
indent/hoon.vim
Normal file
31
indent/hoon.vim
Normal 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
41
syntax/hoon.vim
Normal 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"
|
||||
|
Loading…
Reference in New Issue
Block a user