Most Recent Blog

King's View of the Battle

 Open GL model of a chess board.

Showing posts with label vi tags. Show all posts
Showing posts with label vi tags. Show all posts

January 30, 2011

Using VI / VIM Tags for maintaining developer's notes

Have you ever wanted to maintain a set of developer notes, or other quick references documents, and you want to maintain private or sensitive information that should not be accessible from the internet, consider using vi or gvim with tags.

Purpose:
Maintain a set of notes related to current projects, current software systems, and other handy information that is needed quickly can be valuable.  Using vi/gvim to do this can improve the navigation of the notes files.  

Advantages:
  • VIM / GVIM are free easy to learn editors.
  • VIM / GVIM exist on almost all unix installs by default.
  • Use of 'tags' allows quick hyper-link style navigation though a file or set of files.
  • Very light weight and simple way of maintaining information.
What are tags?
Tags are bookmarks.  There are two sides to the tag:
  • The hyper-link or menu identifier.  Called the identifier tag.
  • The bookmarked location or tagged data.
within vim/gvim, one moves from a hyper-link or menu identifier to the tagged data or bookmark location by placing the cursor over the menu item, and pressing 'crtl-]'.

One can quickly jump back to the previous location (the hyper-link or menu identifier from which they came) by pressing the 'crtl-T'.

How do you create bookmarks, and bookmark locations?
  1. Creating a bookmark or tag:
    1. Use the |tagname| syntax to create a menu item or hyper-link in a text file.
    2. In the tags file associated with this text file create a single line entry as follows:
      tagname filename.txt /*tagname*
    3. The tags listed within the tag file will have to be sorted or the tag logic/hyper-link will not work.
  2. Tagging the location/setting the bookmark:
    1. within the text file, add a bookmark with the syntax *tagname*
    2. You are free to use the same tagname in multiple bookmarks, so for example if you wanted to use the tag with a name section at the beginning of each section, you could.
    3. You are also free to use multiple tags/bookmarks on a single line.  An example would be to include the following tags *section* *howtotags* *gvim_tags*.