Skip to content

Commit 0364c5a

Browse files
committed
Update ft_hare.{txt,jax}
1 parent b0854e1 commit 0364c5a

2 files changed

Lines changed: 86 additions & 93 deletions

File tree

doc/ft_hare.jax

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,45 @@
1818

1919
☆ファイルタイププラグイン *ft-hare-plugin*
2020

21-
このプラグインには、動作を微調整するために |vimrc| 内で定義できるいくつかの異
22-
なる変数がある
21+
このプラグインには、動作を調整するために |vimrc| 内で定義できるいくつかの異な
22+
る変数がある
2323

24-
さらに、`{ }` ブロックの折り畳みもサポートされている。折り畳みを有効にするに
25-
は、|after-directory| 内のファイル (例えば、~/.vim/after/ftplugin/hare.vim) に
26-
以下のコードを追加する: >
24+
*hare-folding*
25+
このプラグインは `{ }` ブロックの折り畳みをサポートしている。折り畳みを有効に
26+
するには、|after-directory| 内のファイルに以下のコードを追加する (例えば、
27+
~/.vim/after/ftplugin/hare.vim): >
2728
2829
setlocal foldmethod=syntax
2930
30-
ブロックベースの折り畳みでは小さな折り畳みが多数作成される傾向があるため
31-
'foldminlines' 'foldnestmax' などの関連するオプションをいくつか設定すること
32-
を検討すること
31+
構文ベースの折り畳みでは小さな折り畳みが多数作成される傾向があるため
32+
'foldminlines' または 'foldnestmax' などの関連するオプションをいくつか設定する
33+
ことを検討すること
3334

35+
*hare-symbol-operators*
36+
ほとんどの記号演算子は、デフォルトではハイライトされない ("?"、"!"、および
37+
"::" を除く)。すべての演算子をハイライトしたい場合は、|vimrc| 内で、それらを希
38+
望するハイライトグループにリンクすることができる。例: >
39+
40+
hi def link hareCast hareSymbolOperator
41+
hi def link hareSymbolOperator hareOperator
42+
<
3443
*g:hare_recommended_style*
3544
Hare の公式スタイルガイドに従って、次のオプションがデフォルトで設定されている:
3645
>
3746
setlocal noexpandtab
38-
setlocal shiftwidth=0
47+
setlocal shiftwidth=8
3948
setlocal softtabstop=0
4049
setlocal tabstop=8
4150
setlocal textwidth=80
4251
4352
この動作を無効にするには、|vimrc| に次の行を追加する: >
4453
4554
let g:hare_recommended_style = 0
46-
<
47-
*g:hare_symbol_operators*
48-
デフォルトでは、記号演算子は特別な構文ハイライト表示を受けない (`!``?``::`
49-
のみ例外)。他のほとんどの演算子の構文ハイライトを有効にするには、|vimrc| に以
50-
下の行を追加する: >
51-
52-
let g:hare_symbol_operators = 1
5355
<
5456
*g:hare_space_error*
55-
デフォルトでは、末尾の空白文字とスペースに続く <Tab> 文字はエラーとしてハイラ
56-
イト表示される。挿入モードでは、このハイライト表示は自動的に無効になる。このハ
57-
イライト表示を完全に無効にするには、|vimrc| に以下の行を追加する: >
57+
デフォルトでは、末尾の空白文字と <Tab> 文字に続くスペースはエラーとしてハイラ
58+
イトされる。挿入モードでは自動的に無効になる。このハイライトを完全に無効にする
59+
には、 |vimrc| に以下の行を追加する: >
5860
5961
let g:hare_space_error = 0
6062
@@ -67,26 +69,26 @@ Hare の公式スタイルガイドに従って、次のオプションがデフ
6769
ソースファイルのみを検索する。
6870

6971
*g:filetype_haredoc*
70-
|g:filetype_haredoc| 変数を使用すると、この検索の深さを微調整したり、Hare ド
72+
`g:filetype_haredoc` 変数を使用すると、この検索の深さを微調整したり、Hare ド
7173
キュメントファイルの検出を完全にバイパスしたりできる:
7274

7375
値 効果~
74-
0 自動検出なし
76+
0 検索無効
7577
1 カレントディレクトリのみを検索 (これがデフォルト)
7678
2 サブディレクトリの 1 階層を検索
7779
3 サブディレクトリの 2 階層を検索
7880

79-
検索の深さは任意の正の整数にすることができるが、ほとんどの場合、 `2` より大き
80-
い値では目に見える利点が得られない可能性がある
81+
検索の深さは任意の正の整数にすることができるが、2 より大きい値では目に見える利
82+
点が得られず、パフォーマンスに影響を及ぼす可能性がある
8183

8284

8385
☆インデント設定 *ft-hare-indent*
8486

85-
このプラグインの他のほとんどの設定とは異なり、インデント設定はバッファごとに設
86-
定でき、既存のグローバル設定を上書きできる。これを行うには、変数の先頭に |g:|
87-
ではなく |b:| を付ける
87+
他の設定とは異なり、インデント設定はバッファごとに設定でき、既存のグローバル設
88+
定を上書きできる。これを行うには、変数の先頭に |g:| ではなく |b:| を付けるだけ
89+
である
8890

89-
*g:hare_indent_match_switch*
91+
*g:hare_indent_match_switch* *b:hare_indent_match_switch*
9092
デフォルトでは、"match" および "switch" 条件の継続行は 1 レベルだけインデント
9193
される: >hare
9294

@@ -96,38 +98,33 @@ Hare の公式スタイルガイドに従って、次のオプションがデフ
9698
yield file;
9799
// ...
98100

99-
代わりに 2 レベルインデントして、"if" 条件と "for" 条件に近づけたい場合
100-
は、|vimrc| に次の行を追加する: >
101+
2 レベルインデントして、"if" 条件や "for" 条件に近づけたい場合は、次の行を
102+
|vimrc| に追加する: >
101103
102104
let g:hare_indent_match_switch = 2
103105
<
104-
*g:hare_indent_case*
105-
デフォルトでは、"match" 式と "switch" 式の場合の継続行は 2 レベルインデントさ
106-
れ、case 本体と視覚的に区別される: >hare
106+
*g:hare_indent_case* *b:hare_indent_case*
107+
デフォルトでは、"match" および "switch" case の継続行は、case 本体と視覚的に区
108+
別するために 2 レベルインデントされる: >hare
107109

108110
case ltok::I8, ltok::I16, ltok::I32,
109111
ltok::I64, ltok::INT =>
110112
// ...
111113

112-
インデント量を変更したい場合は、|g:hare_indent_case| を使って調整できる。有効
113-
な値は `0``1``2` である。
114+
インデントのレベルを変更したい場合は、`g:hare_indent_case` を使って調整できる。
115+
指定できる値は 0、1、2 である。
114116

115117

116118
☆コンパイラサポート *compiler-hare*
117119

118-
このプラグインは、カレントディレクトリに Makefile が存在することを検出した場
119-
合、ビルドシステムに `make` を使用することを想定し、'makeprg' はそのまま残す。
120-
それ以外の場合は、`hare build` が使用される。
121-
122-
*g:hare_makeprg_params*
123-
`hare build` を使用する場合、|g:hare_makeprg_params| 変数を使って 'makeprg'
124-
追加のコンパイラオプションを指定できる。また、バッファごとに設定することも可能
125-
である (|g:| の代わりに |b:| を使用)。その場合、既存のグローバル設定は上書きさ
126-
れる。例: >
127-
128-
let b:hare_makeprg_params = '-lc -t o'
120+
カレントディレクトリに Makefile が検出された場合、このプラグインはビルドシステ
121+
ムに `make` を使用していると想定し、'makeprg' をそのまま残す。それ以外の場合
122+
は、`hare build` が使用される。
129123

130-
グローバルのデフォルトは "-q" で、ビルド中に標準出力への書き込みを抑制する。
124+
*g:hare_makeprg_params*
125+
"hare build" を使用する場合、`g:hare_makeprg_params` を使って 'makeprg' に追加
126+
のコンパイラオプションを指定できる。デフォルトは "-q" で、ビルド時に標準出力へ
127+
の出力を抑制する。
131128

132129
==============================================================================
133130
vim:tw=78:ts=8:noet:ft=help:norl:

en/ft_hare.txt

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,45 @@ functionality for the Hare programming language.
1919
FILETYPE PLUGIN *ft-hare-plugin*
2020

2121
This 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*
3444
The following options are set by default, in accordance with Hare's official
3545
style 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
6770
files 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
7174
search, 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

8385
INDENTATION 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

117118
COMPILER 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

Comments
 (0)