haredoc.vim 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. if exists('b:did_ftplugin')
  7. finish
  8. endif
  9. let b:did_ftplugin = 1
  10. let s:cpo_save = &cpo
  11. set cpo&vim
  12. " Formatting settings.
  13. setlocal comments=:\
  14. setlocal formatlistpat=^\ \\?-\
  15. setlocal formatoptions+=tnlj formatoptions-=c formatoptions-=q
  16. " Search for Hare modules.
  17. setlocal includeexpr=hare#FindModule(v:fname)
  18. setlocal isfname+=:
  19. setlocal suffixesadd=.ha
  20. " Add HAREPATH to the default search paths.
  21. setlocal path-=/usr/include,,
  22. let &l:path .= ',' .. hare#GetPath() .. ',,'
  23. let b:undo_ftplugin = 'setl com< flp< fo< inex< isf< pa< sua<'
  24. " Follow the Hare style guide by default.
  25. if get(g:, 'hare_recommended_style', 1)
  26. setlocal noexpandtab
  27. setlocal shiftwidth=0
  28. setlocal softtabstop=0
  29. setlocal tabstop=8
  30. setlocal textwidth=80
  31. let b:undo_ftplugin .= ' et< sts< sw< ts< tw<'
  32. endif
  33. let &cpo = s:cpo_save
  34. unlet s:cpo_save
  35. " vim: et sts=2 sw=2 ts=8