@@ -19,42 +19,45 @@ functionality for the Hare programming language.
1919FILETYPE PLUGIN *ft-hare-plugin*
2020
2121This plugin has a few different variables that can be defined inside your
22- | vimrc | to tweak its behavior.
22+ | vimrc | to adjust its behavior.
2323
24- Additionally, support is provided for folding `{ }` blocks. To enable folding,
25- add the following to a file inside your | after-directory | (e.g.
24+ *hare-folding*
25+ This plugin supports folding `{ }` blocks. To enable folding, add the
26+ following to a file inside your | after-directory | (e.g.
2627~/.vim/after/ftplugin/hare.vim): >
2728
2829 setlocal foldmethod=syntax
2930
30- Because block -based folding tends to create many small folds, consider setting
31- a few related options, such as 'foldminlines' and 'foldnestmax' .
31+ Because syntax -based folding tends to create many small folds, consider
32+ setting a few related options, such as 'foldminlines' or 'foldnestmax' .
3233
34+ *hare-symbol-operators*
35+ Most symbolic operators do not receive any highlighting by default (with the
36+ exception of "?", "!", and "::"). If you prefer highlighting all operators,
37+ you can link them to your preferred highlight group inside your | vimrc | . For
38+ example: >
39+
40+ hi def link hareCast hareSymbolOperator
41+ hi def link hareSymbolOperator hareOperator
42+ <
3343 *g:hare_recommended_style*
3444The following options are set by default, in accordance with Hare's official
3545style guide: >
3646
3747 setlocal noexpandtab
38- setlocal shiftwidth=0
48+ setlocal shiftwidth=8
3949 setlocal softtabstop=0
4050 setlocal tabstop=8
4151 setlocal textwidth=80
4252
4353 To disable this behavior, add the following to your | vimrc | : >
4454
4555 let g:hare_recommended_style = 0
46- <
47- *g:hare_symbol_operators*
48- By default, symbolic operators do not receive any special highlighting (with
49- `! ` , `?` , and `::` being the only exceptions). To enable syntax highlighting
50- for most other operators, add the following to your | vimrc | : >
51-
52- let g:hare_symbol_operators = 1
5356<
5457 *g:hare_space_error*
55- By default, trailing whitespace and spaces followed by <Tab> characters will
56- be highlighted as errors. This is automatically disabled in Insert mode. To
57- turn off this highlighting completely, add the following to your | vimrc | : >
58+ By default, trailing whitespace and spaces followed by <Tab> characters are
59+ highlighted as errors. This is automatically disabled while in insert mode.
60+ To turn off this highlighting completely, add the following to your | vimrc | : >
5861
5962 let g:hare_space_error = 0
6063
@@ -67,68 +70,61 @@ this is such a common filename, this plugin only searches for Hare source
6770files within the same directory by default.
6871
6972 *g:filetype_haredoc*
70- The | g:filetype_haredoc | variable can be used to tweak the depth of this
73+ The ` g: filetype_haredoc` variable can be used to tweak the depth of this
7174search, or bypass the detection of Hare documentation files altogether:
7275
7376 Value Effect~
74- 0 No automatic detection
77+ 0 Search disabled
7578 1 Search current directory only (this is the default)
7679 2 Search one level of subdirectories
77- 3 Search two levels of subdirectories
7880
79- The search depth may be any positive integer, but values higher than ` 2 ` are
80- unlikely to provide a tangible benefit in most situations .
81+ The search depth may be any positive integer, but values greater than 2 are
82+ very unlikely to provide any tangible benefit and can impact performance .
8183
8284
8385INDENTATION SETTINGS *ft-hare-indent*
8486
85- Unlike most other settings for this plugin, the indentation settings may also
86- be set per-buffer , overriding any global configuration that exists . To do
87- this, simply prefix the variable with | b: | instead of | g: | .
87+ Unlike other settings, indentation settings may be configured on a per-buffer
88+ basis , overriding any existing global configuration. To do so, simply prefix
89+ the variable with | b: | instead of | g: | .
8890
89- *g :hare_indent_match_switch*
90- By default, continuation lines for "match" and "switch" conditions are
91- indented only one level: >hare
91+ *g:hare_indent_match_switch* *b :hare_indent_match_switch*
92+ By default, the continuation lines for "match" and "switch" conditions are
93+ only indented one level: >hare
9294
9395 const file = match (os::create(path, 0o644,
9496 flag::WRONLY | flag::TRUNC)) {
9597 case let file: io::file =>
9698 yield file;
9799 // ...
98100
99- If you instead prefer indenting them two levels, to more closely resemble "if"
100- and "for" conditions, add the following line to your | vimrc | : >
101+ If you prefer indenting them two levels, more closely resembling "if" and
102+ "for" conditions, add the following line to your | vimrc | : >
101103
102104 let g:hare_indent_match_switch = 2
103105<
104- *g:hare_indent_case*
105- By default, continuation lines for cases in "match" and "switch" expressions
106- are indented two levels, to visually distinguish them from the body of the
107- case: >hare
106+ *g:hare_indent_case* *b:hare_indent_case*
107+ By default, the continuation lines for "match" and "switch" cases are indented
108+ two levels, to visually distinguish them from the case body: >hare
108109
109110 case ltok::I8, ltok::I16, ltok::I32,
110111 ltok::I64, ltok::INT =>
111112 // ...
112113
113- If you prefer a different amount of indentation, you can adjust it using
114- | g:hare_indent_case | . Valid values include ` 0 ` , ` 1 ` , and ` 2 ` .
114+ If you prefer a different level of indentation, you can adjust it using
115+ ` g: hare_indent_case` . The possible values are 0, 1 , and 2 .
115116
116117
117118COMPILER SUPPORT *compiler-hare*
118119
119- If this plugin detects a Makefile in the current directory, it will assume you
120- wish to use `make ` for your build system, and will leave 'makeprg' untouched.
121- Otherwise, `hare build` will be used.
122-
123- *g:hare_makeprg_params*
124- When `hare build` is used, additional compiler options may be appended to
125- 'makeprg' with the | g:hare_makeprg_params | variable. It may also be set on a
126- per-buffer basis (using | b: | instead of | g: | ), overriding any global
127- configuration that exists. For example: >
128-
129- let b:hare_makeprg_params = '-lc -t o'
120+ If a Makefile is detected in the current directory, this plugin will assume
121+ you are using "make" for your build system, and will leave 'makeprg' as-is.
122+ Otherwise, "hare build" will be used.
130123
131- The global default is "-q", to suppress writing to stdout while building.
124+ *g:hare_makeprg_params*
125+ When using "hare build", additional compiler options may be appended to
126+ 'makeprg' using `g: hare_makeprg_params ` . The default is "-q", to suppress
127+ printing to stdout when building.
132128
133129==============================================================================
134130 vim:tw=78:ts=8:noet:ft=help:norl:
0 commit comments