Vim Tips Wiki
Register
Advertisement
Vim Tip Guidelines
Quick reference
General guidelines
Titles and renaming a tip
Comments
Categories
Discussion page
Merging similar tips
Deleting a tip
Templates
Formatting code blocks
Entities and other magic
Script comments

In short[]

  • Add a category to a tip with a |category1=SomeCategory line just before the final }} line of the tip template.
  • Each tip is in one or more categories.
  • Each category is in exactly one parent category.
  • Create new categories carefully.

Examples and explanations[]

For example, there may be categories:

VimTip
Usage
Folding

The purpose of the folding category is to allow readers to easily find all tips that relate to using folding in Vim.

If a tip concerns folding, it should be in the Folding category (which has the Usage category as its parent). It should not also be in the Usage category, because that would be redundant. An exception is the VimTip category, which is meant to collect all tips.

See all categories for a list of all the categories, including some that deal with the rest of the wiki. Categories for Vim tips start at Category:VimTip.

Here is an ajax based category tree (requires javascript) using Template:vimcats

VimTip(7 C, 1,148 P)
Building Vim(11 P)
Integration(5 C, 46 P)
LanguageSpecific(16 C, 17 P)
Options(23 P)
Plugin(1 C, 17 P)
Usage(20 C, 69 P)

To track the review process, there is a statistics page for each category: Just append /stats to the URL, or follow the link below the headline. See Category:Folding and Category:Folding/stats.

Think twice before you add a new category. A category should contain a reasonable number of tips. It makes little sense to add a category just for one tip.

Example

  1. You may edit a tip on folding and find the wikitext: |category1=Usage
  2. The tip template uses that line to put the tip in the Usage category (which will be shown at the bottom of the tip page). In that case, you should change the category by replacing "Usage" with "Folding", so it reads: |category1=Folding
  3. If the tip is not in the Usage category, you would simply add the above line to the bottom of the tip template.

A tip can be in more than one category. For example, a tip on folding Python programs should be in Category:Folding and Category:Python. However, multiple categories should not be predecessors of each other. So don't put a tip in category Folding and category Usage.

Here is an example showing categories in a TipImported template (the same procedure works with the TipNew and the TipProposed templates):

{{TipImported
|id=741
|previous=740
|next=742
|created=June 7, 2004
|complexity=intermediate
|author=Anon
|version=6.0
|rating=21/11
|category1=Folding
|category2=Python
|category3=
}}

You can insert up to six categories using parameters category1, category2, category3, ... category6. In this example, category3 has a blank value, so it will have no effect.

Note that "VimTip" does not appear in the wikitext – it is inserted automatically by Template:TipImported (on each tip imported from vim.org), or Template:TipNew (on each accepted new tip created on this wiki). Proposed new tips (not yet accepted) use Template:TipProposed which inserts Category:VimTipProposed.

After editing a tip, click Preview to preview the result. The last line of the page will list the categories, allowing you to confirm that your edit will be successful when you save it.

Put the categories just before the "}}" as shown above (the "}}" should be on a line by itself).

The traditional method of assigning a page to the Folding category would be to include the following line at the bottom: [[Category:Folding]]

That method also works, but we are avoiding it to reduce confusion when users edit the Comments section. Periodically, a bot is run to move categories from the body of the tip into the tip template (however, the bot does not move a category unless it is on a line by itself, with no other wikitext, and the bot does not move Category:Temporary).

Advertisement