Vimのネイティブヘルプドキュメント (doc/*.txt) を執筆・装飾・書式設定するためのリファレンスガイド。
ヘルプファイルの書き方
ファイルの作成とファイルタイプ
:edit doc/myplugin.txt
:set filetype=help " レンダリングとタグハイライトのプレビュー
:set filetype=text " 通常の編集モード
プレビュー確認には ft=help を、執筆中は書きやすい ft=text を指定します。
標準的な構成サンプル
*ack.txt* Plugin that integrates ack with Vim
==============================================================================
USAGE INSTRUCTIONS *ack-usage*
:Ack[!] {pattern} *:Ack*
Search recursively for {pattern}. See |:AckAdd|.
Also see http://beyondgrep.com for more information.
vim:tw=78:ts=8:ft=help:norl:
完全な公式ガイドラインについては Vim 内で :help help-writing を参照してください。
構文と構成要素
マークアップ記法一覧
| 記法 | 説明 | 記述例 |
|---|---|---|
*tag* |
ジャンプ先となる定義タグ | *myplugin-intro* |
|tag| |
タグへのハイパーリンク | |:command| |
'option' |
Vim設定オプション | 'textwidth' |
{placeholder} |
必須または任意の引数 | {Visual}gf |
<key> |
キーボードの特殊キー | <PageDown>, <CR> |
`command` |
インラインコマンドまたはコード文字列 | `set fo=want` |
CTRL-X |
Controlキーとの組み合わせ | CTRL-] |
HEADING *tag* |
大文字の見出しとタグ | INSTALLATION *my-install* |
Heading~ |
チルダ付きの小見出しまたは列ヘッダー | Options~ |
===== |
大セクション区切り線 (78文字) | ====================== |
----- |
小セクション区切り線 (78文字) | ---------------------- |
タグとナビゲーション
- アンカー名をアスタリスクで囲みます: plugin-tag
- パイプ記号でタグへのリンクを作成します: |plugin-tag|
- パイプリンク上で Ctrl-] を押すとタグへジャンプします。Ctrl-T または Ctrl-O で戻ります。
コードブロックの記述
直前の段落の末尾に > を置き、コードブロックの末尾行の先頭に < を配置します:
Example: >
let g:loaded_myplugin = 1
call myplugin#setup()
<
ドキュメントヘッダー
*myplugin.txt* Extended utility toolkit for Vim
ファイルの最初の行には、ファイル名を含む主タグを置き、その後に概要説明を記述します。
ヘルプ用 Modeline
ファイルの最終行に Modeline 設定を追加します:
vim:tw=78:ts=8:ft=help:norl:
標準的な規約
目次 (Table of Contents)
CONTENTS *myplugin-contents*
1. Introduction .............................. |myplugin-intro|
2. Commands .................................. |myplugin-commands|
3. Configuration Options ..................... |myplugin-options|
作者およびライセンス表記
Author: Jack Hackness <[email protected]> *myplugin-author*
License: Same terms as Vim itself (see |license|)