summaryrefslogtreecommitdiffstats
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorAmelia Clarke <selene@perilune.dev>2024-05-24 08:05:00 +0200
committerChristian Brabandt <cb@256bit.org>2024-05-24 08:05:00 +0200
commit35dfe58a540e2fb0eff953630f8e4fcbf4bc26ca (patch)
tree2d8e6f3a28d381ed91a719de656494f7ef98b733 /runtime/ftplugin
parent2b09de910458247b70751928217422c38fd5abf8 (diff)
patch 9.1.0442: hare runtime files outdatedv9.1.0442
Problem: hare runtime files outdated Solution: runtime(hare): update hare.vim to match upstream (Amelia Clarke) closes: #14836 Signed-off-by: Amelia Clarke <selene@perilune.dev> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/hare.vim56
-rw-r--r--runtime/ftplugin/haredoc.vim44
2 files changed, 84 insertions, 16 deletions
diff --git a/runtime/ftplugin/hare.vim b/runtime/ftplugin/hare.vim
index 0200ba5913..422bb7b4e8 100644
--- a/runtime/ftplugin/hare.vim
+++ b/runtime/ftplugin/hare.vim
@@ -1,35 +1,59 @@
-" Vim filetype plugin
-" Language: Hare
-" Maintainer: Amelia Clarke <me@rsaihe.dev>
-" Previous Maintainer: Drew DeVault <sir@cmpwn.com>
-" Last Updated: 2022-09-28
-" 2023 Aug 28 by Vim Project (undo_ftplugin)
+" Vim filetype plugin.
+" Language: Hare
+" Maintainer: Amelia Clarke <selene@perilune.dev>
+" Last Updated: 2024-05-10
+" Upstream: https://git.sr.ht/~sircmpwn/hare.vim
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
-" Formatting settings.
-setlocal formatoptions-=t formatoptions+=croql/
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Set the default compiler.
+compiler hare
-" Miscellaneous.
+" 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
-let b:undo_ftplugin = "setl cms< com< fo< sua<"
+" Add HAREPATH to the default search paths.
+setlocal path-=/usr/include,,
+let &l:path .= ',' .. hare#GetPath() .. ',,'
-" Hare recommended style.
-if get(g:, "hare_recommended_style", 1)
+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=8
+ setlocal shiftwidth=0
setlocal softtabstop=0
setlocal tabstop=8
setlocal textwidth=80
- let b:undo_ftplugin ..= " | setl et< sts< sw< ts< tw<"
+ let b:undo_ftplugin .= ' et< sts< sw< ts< tw<'
endif
-compiler hare
+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
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
-" vim: et sw=2 sts=2 ts=8
+" vim: et sts=2 sw=2 ts=8
diff --git a/runtime/ftplugin/haredoc.vim b/runtime/ftplugin/haredoc.vim
new file mode 100644
index 0000000000..69030b47ba
--- /dev/null
+++ b/runtime/ftplugin/haredoc.vim
@@ -0,0 +1,44 @@
+" Vim filetype plugin.
+" Language: Haredoc (Hare documentation format)
+" Maintainer: Amelia Clarke <selene@perilune.dev>
+" Last Updated: 2024-05-02
+" Upstream: https://git.sr.ht/~selene/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 formatlistpat=^\ \\?-\
+setlocal formatoptions+=tnlj formatoptions-=c formatoptions-=q
+
+" Search for Hare modules.
+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 com< flp< fo< inex< isf< pa< sua<'
+
+" 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
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: et sts=2 sw=2 ts=8