haredoc.vim (1447B)
1 vim9script 2 3 # Vim filetype plugin. 4 # Language: Haredoc (Hare documentation format) 5 # Maintainer: Amelia Clarke <selene@perilune.dev> 6 # Last Change: 2026 Jan 24 7 # 2026 Jun 27 by Vim Project (normalize recommended style guard) 8 # Upstream: https://git.sr.ht/~sircmpwn/hare.vim 9 10 if exists('b:did_ftplugin') 11 finish 12 endif 13 b:did_ftplugin = 1 14 15 # Use the Hare compiler. 16 compiler hare 17 b:undo_ftplugin = 'compiler make' 18 19 # Formatting settings. 20 setlocal comments=:\ 21 setlocal commentstring=\ %s 22 setlocal formatlistpat=^\\s*-\\s\\+ 23 setlocal formatoptions+=tnlj formatoptions-=c formatoptions-=q 24 b:undo_ftplugin ..= ' | setl cms< com< flp< fo<' 25 26 # Locate Hare modules. 27 &l:includeexpr = 'trim(v:fname, ":", 2)->substitute("::", "/", "g")' 28 setlocal isfname+=: 29 &l:path = ',,' .. hare#GetPath() 30 b:undo_ftplugin ..= ' | setl inex< isf< pa<' 31 32 # Follow the official style guide by default. 33 if get(g:, 'hare_recommended_style', get(g:, 'filetype_recommended_style', 1)) 34 setlocal noexpandtab 35 setlocal shiftwidth=8 36 setlocal softtabstop=0 37 setlocal tabstop=8 38 setlocal textwidth=80 39 b:undo_ftplugin ..= ' | setl et< sts< sw< ts< tw<' 40 endif 41 42 # Highlight incorrect whitespace outside of insert mode. 43 if get(g:, 'hare_space_error', 1) 44 augroup HaredocSpaceError 45 autocmd! 46 autocmd InsertEnter * hi link haredocSpaceError NONE 47 autocmd InsertLeave * hi link haredocSpaceError Error 48 augroup END 49 endif 50 51 # vim: et sts=2 sw=2 ts=8 tw=80