File: hare.vim

package info (click to toggle)
neovim 0.11.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 64,140 kB
  • sloc: ansic: 263,427; python: 1,472; lisp: 1,237; sh: 1,138; makefile: 382; xml: 84; ruby: 6
file content (61 lines) | stat: -rw-r--r-- 1,442 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
" Vim filetype plugin.
" Language:     Hare
" Maintainer:   Amelia Clarke <selene@perilune.dev>
" Last Updated: 2024 Oct 04
" Upstream:     https://git.sr.ht/~sircmpwn/hare.vim

if exists('b:did_ftplugin')
  finish
endif
let b:did_ftplugin = 1

let s:cpo_save = &cpo
set cpo&vim

" Formatting settings.
setlocal comments=://
setlocal commentstring=//\ %s
setlocal formatlistpat=^\ \\?-\ 
setlocal formatoptions+=croqnlj/ formatoptions-=t

" Search for Hare modules.
setlocal include=^\\s*use\\>
setlocal includeexpr=hare#FindModule(v:fname)
setlocal isfname+=:
setlocal suffixesadd=.ha

" Add HAREPATH to the default search paths.
setlocal path-=/usr/include,,
let &l:path .= ',' .. hare#GetPath() .. ',,'

let b:undo_ftplugin = 'setl cms< com< flp< fo< inc< inex< isf< pa< sua< mp<'

" Follow the Hare style guide by default.
if get(g:, 'hare_recommended_style', 1)
  setlocal noexpandtab
  setlocal shiftwidth=0
  setlocal softtabstop=0
  setlocal tabstop=8
  setlocal textwidth=80
  let b:undo_ftplugin .= ' et< sts< sw< ts< tw<'
endif

augroup hare.vim
  autocmd!

  " Highlight whitespace errors by default.
  if get(g:, 'hare_space_error', 1)
    autocmd InsertEnter * hi link hareSpaceError NONE
    autocmd InsertLeave * hi link hareSpaceError Error
  endif
augroup END

if !exists('current_compiler')
  let b:undo_ftplugin .= "| compiler make"
  compiler hare
endif

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: et sts=2 sw=2 ts=8