blob: 69030b47bae963862b8f812ecb88b73a45215f78 [file] [log] [blame]
Amelia Clarke35dfe582024-05-24 08:05:00 +02001" Vim filetype plugin.
2" Language: Haredoc (Hare documentation format)
3" Maintainer: Amelia Clarke <selene@perilune.dev>
4" Last Updated: 2024-05-02
5" Upstream: https://git.sr.ht/~selene/hare.vim
6
7if exists('b:did_ftplugin')
8 finish
9endif
10let b:did_ftplugin = 1
11
12let s:cpo_save = &cpo
13set cpo&vim
14
15" Formatting settings.
16setlocal comments=:\
17setlocal formatlistpat=^\ \\?-\
18setlocal formatoptions+=tnlj formatoptions-=c formatoptions-=q
19
20" Search for Hare modules.
21setlocal includeexpr=hare#FindModule(v:fname)
22setlocal isfname+=:
23setlocal suffixesadd=.ha
24
25" Add HAREPATH to the default search paths.
26setlocal path-=/usr/include,,
27let &l:path .= ',' .. hare#GetPath() .. ',,'
28
29let b:undo_ftplugin = 'setl com< flp< fo< inex< isf< pa< sua<'
30
31" Follow the Hare style guide by default.
32if get(g:, 'hare_recommended_style', 1)
33 setlocal noexpandtab
34 setlocal shiftwidth=0
35 setlocal softtabstop=0
36 setlocal tabstop=8
37 setlocal textwidth=80
38 let b:undo_ftplugin .= ' et< sts< sw< ts< tw<'
39endif
40
41let &cpo = s:cpo_save
42unlet s:cpo_save
43
44" vim: et sts=2 sw=2 ts=8