vim-help: update

This commit is contained in:
Rico Sta. Cruz 2017-09-09 17:27:23 +08:00
parent 2587e40858
commit fe9da5708e
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 40 additions and 27 deletions

View File

@ -1,15 +1,14 @@
--- ---
title: Vim helpfiles title: Vim helpfiles
category: Vim category: Vim
layout: 2017/sheet
updated: 2017-09-09
--- ---
``` ## Writing help files
:help help-writing {: .-left-reference}
```
{:.light}
### Creating a document ### Creating a document
Use `help` to preview it, and `text` to edit it.
```nohighlight ```nohighlight
:e doc/potion.txt :e doc/potion.txt
@ -17,6 +16,8 @@ Use `help` to preview it, and `text` to edit it.
:set ft=text :set ft=text
``` ```
Use `ft=help` to preview it, and `ft=text` to edit it.
### Example ### Example
```nohighlight ```nohighlight
@ -29,28 +30,37 @@ USAGE INSTRUCTIONS *ack-usage*
Search recursively for {pattern}. See |:AckAdd|. Search recursively for {pattern}. See |:AckAdd|.
Also see http://beyondgrep.com for more information. Also see http://beyondgrep.com for more information.
vim:tw=78:ts=8:ft=help:norl:
``` ```
## Syntax reference This is a cheatsheet for writing Vim help files. See: `:help help-writing`
## Syntax
### Reference
| Code | Description | Example | | Code | Description | Example |
| ----- | ----- | -----: | | ----- | ----- | ----- |
| `*tags*` | Tags | | *Inline items* |
| ----- | ----- | ----- |
| `*tags*` | Tags | |
| `|link-to-tags|` | Links to tags | `|:command|` | | `|link-to-tags|` | Links to tags | `|:command|` |
| `'vimoption'` | Vim option | `'textwidth'` | | `'vimoption'` | Vim option | `'textwidth'` |
| ----- | ----- | | ----- | ----- | ----- |
| `{code-text}` | Code text | `{Visual}gf` | | `{code-text}` | Code text | `{Visual}gf` |
| `<code-text>` | Code text | `<PageDown>` | | `<code-text>` | Code text | `<PageDown>` |
| `` `code-text` `` | Code text | `` `set fo=want` `` | | `` `code-text` `` | Code text | `` `set fo=want` `` |
| `CTRL-X` | Code text | | `CTRL-X` | Code text | |
| ----- | ----- | | ----- | ----- | ----- |
| `INTRODUCTION *tag*` | Section header | | *Block items* |
| `Column heading~` | Highlighting | | ----- | ----- | ----- |
| `www.url.com` | Web URL | | `INTRODUCTION *tag*` | Section header | |
| ----- | ----- | | `Column heading~` | Highlighting | |
| `=====` | Separator | | `www.url.com` | Web URL | |
| `-----` | Separator | | ----- | ----- | ----- |
{:.greycode} | `=====` | Separator | |
| `-----` | Separator | |
### Tags ### Tags
@ -59,7 +69,6 @@ USAGE INSTRUCTIONS *ack-usage*
* Press `^]` to jump to a tag * Press `^]` to jump to a tag
### Code blocks ### Code blocks
Surround with `>` and `<` characters
``` ```
Example: > Example: >
@ -67,21 +76,25 @@ Example: >
< <
``` ```
Surround with `>` and `<` characters
### File header ### File header
It's customary to start a file with a tag of the filename, plus a description
``` ```
*potion.txt* functionality for the potion programming language *potion.txt* functionality for the potion programming language
``` ```
It's customary to start a file with a tag of the filename, plus a description.
### Heading ### Heading
Starts with `ALL CAPS`, ends with `*a-tag*`
``` ```
============================================================================== ==============================================================================
CONTENTS *potion-contents* CONTENTS *potion-contents*
``` ```
Starts with `ALL CAPS`, ends with `*a-tag*`
### Notes ### Notes
Using `*Todo` and `*Error` will highlight your notes. Using `*Todo` and `*Error` will highlight your notes.