neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

hare.vim (1442B)


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