Skip to content

Commit c417805

Browse files
authored
Merge pull request #1552 from vim-jp/hh-update-ft_hare
Add ft_hare.{txt,jax}
2 parents c87b2a6 + 5e99f6f commit c417805

File tree

2 files changed

+149
-0
lines changed

2 files changed

+149
-0
lines changed

doc/ft_hare.jax

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
*ft_hare.txt* Hare プログラミング言語のサポート
2+
3+
==============================================================================
4+
☆内容 *hare*
5+
6+
1. 前書き |hare-intro|
7+
2. ファイルタイププラグイン |hare-plugin|
8+
3. 設定 |hare-settings|
9+
10+
==============================================================================
11+
☆前書き *hare-intro*
12+
13+
このプラグインは、Hare プログラミング言語に構文のハイライト、インデント、その
14+
他の機能を提供する。Hare モジュール内の README ファイルのサポートも提供されて
15+
いるが、これは |g:filetype_haredoc| を設定して有効にする必要がある。
16+
17+
==============================================================================
18+
☆ファイルタイププラグイン *hare-plugin*
19+
20+
このプラグインは、HAREPATH 環境変数の内容を含むように 'path' の値を自動的に設
21+
定し、|gf| などのコマンドで標準ライブラリまたはサードパーティのモジュールを直
22+
接開くことができるようにする。HAREPATH が設定されていない場合、デフォルトで、
23+
ほとんどの Unix 系ファイルシステムの推奨パス、つまり /usr/src/hare/stdlib およ
24+
び /usr/src/hare/third-party が使用される。
25+
26+
==============================================================================
27+
☆設定 *hare-settings*
28+
29+
このプラグインは、vimrc で定義して動作を設定できる少数の変数を提供する。
30+
31+
*g:filetype_haredoc*
32+
このプラグインは、Hare モジュールを自動的に検出し、README ファイルに "haredoc"
33+
ファイルタイプを設定できる。ヒューリスティックとして使用される再帰的ディレクト
34+
リ検索はパフォーマンスに若干の影響を与えるため、この機能はデフォルトで無効に
35+
なっており、特別にオプトインする必要がある: >
36+
let g:filetype_haredoc = 1
37+
<
38+
検索動作を調整する方法については、|g:haredoc_search_depth| を参照。
39+
40+
*g:hare_recommended_style*
41+
公式の Hare スタイルガイドに従って、次のオプションがデフォルトで設定される: >
42+
setlocal noexpandtab
43+
setlocal shiftwidth=0
44+
setlocal softtabstop=0
45+
setlocal tabstop=8
46+
setlocal textwidth=80
47+
<
48+
この動作を無効にするには: >
49+
let g:hare_recommended_style = 0
50+
<
51+
*g:hare_space_error*
52+
デフォルトでは、末尾の空白文字とスペース文字が前にあるタブはエラーとしてハイラ
53+
イトされる。挿入モードでは、これは自動的にオフになる。このハイライトを完全に無
54+
効にするには: >
55+
let g:hare_space_error = 0
56+
<
57+
*g:haredoc_search_depth*
58+
デフォルトでは、|g:filetype_haredoc| が有効な場合、カレントディレクトリとその
59+
直下のサブディレクトリのみ Hare ファイルが検索される。最大検索深度は以下のよう
60+
に調整する: >
61+
let g:haredoc_search_depth = 2
62+
<
63+
値 効果~
64+
0 カレントディレクトリのみ検索。
65+
1 カレントディレクトリと直下のサブディレクトリを検索。
66+
2 カレントディレクトリと 2 階層のサブディレクトリを検索。
67+
68+
最大検索深度は任意の整数に設定できるが、2 より大きい値を使用することは推奨され
69+
ず、ほとんどの状況で具体的なメリットは得られないだろう。
70+
71+
==============================================================================
72+
vim:tw=78:ts=8:noet:ft=help:norl:

en/ft_hare.txt

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
*ft_hare.txt* Support for the Hare programming language
2+
3+
==============================================================================
4+
CONTENTS *hare*
5+
6+
1. Introduction |hare-intro|
7+
2. Filetype plugin |hare-plugin|
8+
3. Settings |hare-settings|
9+
10+
==============================================================================
11+
INTRODUCTION *hare-intro*
12+
13+
This plugin provides syntax highlighting, indentation, and other functionality
14+
for the Hare programming language. Support is also provided for README files
15+
inside Hare modules, but this must be enabled by setting |g:filetype_haredoc|.
16+
17+
==============================================================================
18+
FILETYPE PLUGIN *hare-plugin*
19+
20+
This plugin automatically sets the value of 'path' to include the contents of
21+
the HAREPATH environment variable, allowing commands such as |gf| to directly
22+
open standard library or third-party modules. If HAREPATH is not set, it
23+
defaults to the recommended paths for most Unix-like filesystems, namely
24+
/usr/src/hare/stdlib and /usr/src/hare/third-party.
25+
26+
==============================================================================
27+
SETTINGS *hare-settings*
28+
29+
This plugin provides a small number of variables that you can define in your
30+
vimrc to configure its behavior.
31+
32+
*g:filetype_haredoc*
33+
This plugin is able to automatically detect Hare modules and set the "haredoc"
34+
filetype for any README files. As the recursive directory search used as a
35+
heuristic has a minor performance impact, this feature is disabled by default
36+
and must be specifically opted into: >
37+
let g:filetype_haredoc = 1
38+
<
39+
See |g:haredoc_search_depth| for ways to tweak the searching behavior.
40+
41+
*g:hare_recommended_style*
42+
The following options are set by default, in accordance with the official Hare
43+
style guide: >
44+
setlocal noexpandtab
45+
setlocal shiftwidth=0
46+
setlocal softtabstop=0
47+
setlocal tabstop=8
48+
setlocal textwidth=80
49+
<
50+
To disable this behavior: >
51+
let g:hare_recommended_style = 0
52+
<
53+
*g:hare_space_error*
54+
By default, trailing whitespace and tabs preceded by space characters are
55+
highlighted as errors. This is automatically turned off when in insert mode.
56+
To disable this highlighting completely: >
57+
let g:hare_space_error = 0
58+
<
59+
*g:haredoc_search_depth*
60+
By default, when |g:filetype_haredoc| is enabled, only the current directory
61+
and its immediate subdirectories are searched for Hare files. The maximum
62+
search depth may be adjusted with: >
63+
let g:haredoc_search_depth = 2
64+
<
65+
Value Effect~
66+
0 Only search the current directory.
67+
1 Search the current directory and immediate
68+
subdirectories.
69+
2 Search the current directory and two levels of
70+
subdirectories.
71+
72+
The maximum search depth can be set to any integer, but using values higher
73+
than 2 is not recommended, and will likely provide no tangible benefit in most
74+
situations.
75+
76+
==============================================================================
77+
vim:tw=78:ts=8:noet:ft=help:norl:

0 commit comments

Comments
 (0)