Files
org-vim/runtime/ftplugin/haredoc.vim
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.3 KiB
VimL
Raw Normal View History

2025-09-08 15:30:41 -04:00
vim9script
# Vim filetype plugin.
# Language: Haredoc (Hare documentation format)
# Maintainer: Amelia Clarke <selene@perilune.dev>
# Last Updated: 2025 Sep 06
# Upstream: https://git.sr.ht/~sircmpwn/hare.vim
2024-05-24 08:05:00 +02:00
if exists('b:did_ftplugin')
finish
endif
2025-09-08 15:30:41 -04:00
b:did_ftplugin = 1
2024-05-24 08:05:00 +02:00
2025-09-08 15:30:41 -04:00
# Use the Hare compiler.
compiler hare
b:undo_ftplugin = 'compiler make'
2024-05-24 08:05:00 +02:00
2025-09-08 15:30:41 -04:00
# Formatting settings.
2024-05-24 08:05:00 +02:00
setlocal comments=:\
2025-09-08 15:30:41 -04:00
setlocal commentstring=\ %s
setlocal formatlistpat=^-\
2024-05-24 08:05:00 +02:00
setlocal formatoptions+=tnlj formatoptions-=c formatoptions-=q
2025-09-08 15:30:41 -04:00
b:undo_ftplugin ..= ' | setl cms< com< flp< fo<'
2024-05-24 08:05:00 +02:00
2025-09-08 15:30:41 -04:00
# Locate Hare modules.
setlocal includeexpr=hare#IncludeExpr()
2024-05-24 08:05:00 +02:00
setlocal isfname+=:
2025-09-08 15:30:41 -04:00
&l:path = ',,' .. hare#GetPath()
2024-05-24 08:05:00 +02:00
setlocal suffixesadd=.ha
2025-09-08 15:30:41 -04:00
b:undo_ftplugin ..= ' | setl inex< isf< pa< sua<'
2024-05-24 08:05:00 +02:00
2025-09-08 15:30:41 -04:00
# Follow the official style guide by default.
2024-05-24 08:05:00 +02:00
if get(g:, 'hare_recommended_style', 1)
setlocal noexpandtab
setlocal shiftwidth=0
setlocal softtabstop=0
setlocal tabstop=8
setlocal textwidth=80
2025-09-08 15:30:41 -04:00
b:undo_ftplugin ..= ' | setl et< sts< sw< ts< tw<'
2024-05-24 08:05:00 +02:00
endif
2025-09-08 15:30:41 -04:00
# Highlight incorrect whitespace outside of insert mode.
if get(g:, 'hare_space_error', 1)
augroup HaredocSpaceError
autocmd!
autocmd InsertEnter * hi link haredocSpaceError NONE
autocmd InsertLeave * hi link haredocSpaceError Error
augroup END
endif
2024-05-24 08:05:00 +02:00
2025-09-08 15:30:41 -04:00
# vim: et sts=2 sw=2 ts=8 tw=80