robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqMerge pull request #40472 from zeertzjq/vim-1f337327945732ed7

master
1.5 KiB62 linesraw
1" Vim filetype plugin.
2" Language:     Hare
3" Maintainer:   Amelia Clarke <selene@perilune.dev>
4" Last Updated: 2024 Oct 04
5"               2026 Jun 27 by Vim Project (normalize recommended style guard)
6" Upstream:     https://git.sr.ht/~sircmpwn/hare.vim
7
8if exists('b:did_ftplugin')
9  finish
10endif
11let b:did_ftplugin = 1
12
13let s:cpo_save = &cpo
14set cpo&vim
15
16" Formatting settings.
17setlocal comments=://
18setlocal commentstring=//\ %s
19setlocal formatlistpat=^\ \\?-\ 
20setlocal formatoptions+=croqnlj/ formatoptions-=t
21
22" Search for Hare modules.
23setlocal include=^\\s*use\\>
24setlocal includeexpr=hare#FindModule(v:fname)
25setlocal isfname+=:
26setlocal suffixesadd=.ha
27
28" Add HAREPATH to the default search paths.
29setlocal path-=/usr/include,,
30let &l:path .= ',' .. hare#GetPath() .. ',,'
31
32let b:undo_ftplugin = 'setl cms< com< flp< fo< inc< inex< isf< pa< sua< mp<'
33
34" Follow the Hare style guide by default.
35if get(g:, 'hare_recommended_style', get(g:, 'filetype_recommended_style', 1))
36  setlocal noexpandtab
37  setlocal shiftwidth=0
38  setlocal softtabstop=0
39  setlocal tabstop=8
40  setlocal textwidth=80
41  let b:undo_ftplugin .= ' et< sts< sw< ts< tw<'
42endif
43
44augroup hare.vim
45  autocmd!
46
47  " Highlight whitespace errors by default.
48  if get(g:, 'hare_space_error', 1)
49    autocmd InsertEnter * hi link hareSpaceError NONE
50    autocmd InsertLeave * hi link hareSpaceError Error
51  endif
52augroup END
53
54if !exists('current_compiler')
55  let b:undo_ftplugin .= "| compiler make"
56  compiler hare
57endif
58
59let &cpo = s:cpo_save
60unlet s:cpo_save
61
62" vim: et sts=2 sw=2 ts=8