Writing help files

Introduction

Vim helpfiles document plugins and features in :help.

Creating a document

:e doc/potion.txt
:set ft=help
:set ft=text

Use ft=help to preview it, and ft=text to edit it.

See: Writing help files

Example

*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:

This is a cheatsheet for writing Vim help files.

See: Writing help files

Syntax

Reference

CodeDescriptionExample
Inline items  
*tags*Tags 
|link-to-tags|Links to tags|:command|
'vimoption'Vim option'textwidth'
{code-text}Code text{Visual}gf
<code-text>Code text<PageDown>
`code-text`Code text`set fo=want`
CTRL-XCode text 
Block items  
INTRODUCTION *tag*Section header 
Column heading~Highlighting 
www.url.comWeb URL 
=====Separator 
-----Separator 

See: Help notation

Tags

  • Tags are created with asterisks, eg, *potion-usage*
  • Links to tags are |potion-usage|
  • Press ^] to jump to a tag

See: Tags

Code blocks

Example: >
 xyz
<

Surround with > and < characters

See: Writing help files

File header

*potion.txt*  functionality for the potion programming language

It's customary to start a file with a tag of the filename, plus a description.

See: Writing help files

Heading

======================================================================
CONTENTS                                             *potion-contents*

Starts with ALL CAPS, ends with *a-tag*

See: Writing help files

Notes

	*Todo something to do
	*Error something wrong

Using *Todo and *Error will highlight your notes.

See: Writing help files

Final modeline

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

See: Modeline

Conventions

Table of contents

|rails-introduction|            Introduction and Feature Summary
|rails-commands|                General Commands
|rails-navigation|              Navigation

Numbered entries

    1.Intro...................................|ergonomic|
    2.Note to use..............................|CAPSLOCK|
    3.Insert Mode Remappings............|ergonomicInsert|

See: Writing help files

Author lines

Author:  Jack Hackness <[email protected]>         *xyz-author*
License: Same terms as Vim itself (see |license|)

See: Writing help files

0 Comments for this cheatsheet. Write yours!