Skip to content

Add ft_hare.{txt,jax} #1552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions doc/ft_hare.jax
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
*ft_hare.txt* Hare プログラミング言語のサポート

==============================================================================
☆内容 *hare*

1. 前書き |hare-intro|
2. ファイルタイププラグイン |hare-plugin|
3. 設定 |hare-settings|

==============================================================================
☆前書き *hare-intro*

このプラグインは、Hare プログラミング言語に構文のハイライト、インデント、その
他の機能を提供する。Hare モジュール内の README ファイルのサポートも提供されて
いるが、これは |g:filetype_haredoc| を設定して有効にする必要がある。

==============================================================================
☆ファイルタイププラグイン *hare-plugin*

このプラグインは、HAREPATH 環境変数の内容を含むように 'path' の値を自動的に設
定し、|gf| などのコマンドで標準ライブラリまたはサードパーティのモジュールを直
接開くことができるようにする。HAREPATH が設定されていない場合、デフォルトで、
ほとんどの Unix 系ファイルシステムの推奨パス、つまり /usr/src/hare/stdlib およ
び /usr/src/hare/third-party が使用される。

==============================================================================
☆設定 *hare-settings*

このプラグインは、vimrc で定義して動作を設定できる少数の変数を提供する。

*g:filetype_haredoc*
このプラグインは、Hare モジュールを自動的に検出し、README ファイルに "haredoc"
ファイルタイプを設定できる。ヒューリスティックとして使用される再帰的ディレクト
リ検索はパフォーマンスに若干の影響を与えるため、この機能はデフォルトで無効に
なっており、特別にオプトインする必要がある: >
let g:filetype_haredoc = 1
<
検索動作を調整する方法については、|g:haredoc_search_depth| を参照。

*g:hare_recommended_style*
公式の Hare スタイルガイドに従って、次のオプションがデフォルトで設定される: >
setlocal noexpandtab
setlocal shiftwidth=0
setlocal softtabstop=0
setlocal tabstop=8
setlocal textwidth=80
<
この動作を無効にするには: >
let g:hare_recommended_style = 0
<
*g:hare_space_error*
デフォルトでは、末尾の空白文字とスペース文字が前にあるタブはエラーとしてハイラ
イトされる。挿入モードでは、これは自動的にオフになる。このハイライトを完全に無
効にするには: >
let g:hare_space_error = 0
<
*g:haredoc_search_depth*
デフォルトでは、|g:filetype_haredoc| が有効な場合、カレントディレクトリとその
直下のサブディレクトリのみ Hare ファイルが検索される。最大検索深度は以下のよう
に調整する: >
let g:haredoc_search_depth = 2
<
値 効果~
0 カレントディレクトリのみ検索。
1 カレントディレクトリと直下のサブディレクトリを検索。
2 カレントディレクトリと 2 階層のサブディレクトリを検索。

最大検索深度は任意の整数に設定できるが、2 より大きい値を使用することは推奨され
ず、ほとんどの状況で具体的なメリットは得られないだろう。

==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:
77 changes: 77 additions & 0 deletions en/ft_hare.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
*ft_hare.txt* Support for the Hare programming language

==============================================================================
CONTENTS *hare*

1. Introduction |hare-intro|
2. Filetype plugin |hare-plugin|
3. Settings |hare-settings|

==============================================================================
INTRODUCTION *hare-intro*

This plugin provides syntax highlighting, indentation, and other functionality
for the Hare programming language. Support is also provided for README files
inside Hare modules, but this must be enabled by setting |g:filetype_haredoc|.

==============================================================================
FILETYPE PLUGIN *hare-plugin*

This plugin automatically sets the value of 'path' to include the contents of
the HAREPATH environment variable, allowing commands such as |gf| to directly
open standard library or third-party modules. If HAREPATH is not set, it
defaults to the recommended paths for most Unix-like filesystems, namely
/usr/src/hare/stdlib and /usr/src/hare/third-party.

==============================================================================
SETTINGS *hare-settings*

This plugin provides a small number of variables that you can define in your
vimrc to configure its behavior.

*g:filetype_haredoc*
This plugin is able to automatically detect Hare modules and set the "haredoc"
filetype for any README files. As the recursive directory search used as a
heuristic has a minor performance impact, this feature is disabled by default
and must be specifically opted into: >
let g:filetype_haredoc = 1
<
See |g:haredoc_search_depth| for ways to tweak the searching behavior.

*g:hare_recommended_style*
The following options are set by default, in accordance with the official Hare
style guide: >
setlocal noexpandtab
setlocal shiftwidth=0
setlocal softtabstop=0
setlocal tabstop=8
setlocal textwidth=80
<
To disable this behavior: >
let g:hare_recommended_style = 0
<
*g:hare_space_error*
By default, trailing whitespace and tabs preceded by space characters are
highlighted as errors. This is automatically turned off when in insert mode.
To disable this highlighting completely: >
let g:hare_space_error = 0
<
*g:haredoc_search_depth*
By default, when |g:filetype_haredoc| is enabled, only the current directory
and its immediate subdirectories are searched for Hare files. The maximum
search depth may be adjusted with: >
let g:haredoc_search_depth = 2
<
Value Effect~
0 Only search the current directory.
1 Search the current directory and immediate
subdirectories.
2 Search the current directory and two levels of
subdirectories.

The maximum search depth can be set to any integer, but using values higher
than 2 is not recommended, and will likely provide no tangible benefit in most
situations.

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