Amelia Clarke | 35dfe58 | 2024-05-24 08:05:00 +0200 | [diff] [blame] | 1 | " 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 | |
| 7 | if exists('b:did_ftplugin') |
| 8 | finish |
| 9 | endif |
| 10 | let b:did_ftplugin = 1 |
| 11 | |
| 12 | let s:cpo_save = &cpo |
| 13 | set cpo&vim |
| 14 | |
| 15 | " Formatting settings. |
| 16 | setlocal comments=:\ |
| 17 | setlocal formatlistpat=^\ \\?-\ |
| 18 | setlocal formatoptions+=tnlj formatoptions-=c formatoptions-=q |
| 19 | |
| 20 | " Search for Hare modules. |
| 21 | setlocal includeexpr=hare#FindModule(v:fname) |
| 22 | setlocal isfname+=: |
| 23 | setlocal suffixesadd=.ha |
| 24 | |
| 25 | " Add HAREPATH to the default search paths. |
| 26 | setlocal path-=/usr/include,, |
| 27 | let &l:path .= ',' .. hare#GetPath() .. ',,' |
| 28 | |
| 29 | let b:undo_ftplugin = 'setl com< flp< fo< inex< isf< pa< sua<' |
| 30 | |
| 31 | " Follow the Hare style guide by default. |
| 32 | if 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<' |
| 39 | endif |
| 40 | |
| 41 | let &cpo = s:cpo_save |
| 42 | unlet s:cpo_save |
| 43 | |
| 44 | " vim: et sts=2 sw=2 ts=8 |