Adding Comments to Code Including Modules and Themes

One of the biggest issues with code in any type of programming is the lack of good commenting.

What are the reasons that most programmers do not add comments?

Tags in comments


I have the following issue: I have added a taxonomy field to my forum comments and it does not work, meaning when I create new comment tags they indeed appear in the comment and even the new tags appears in the tag vocabulary but when I click on the tag there are no contents, as if drupal does not count comments as content.

Taxonomy upgrade extras: 

Comment author name as link

Use the following PHP code in a custom token to display the comment author's name as a link to either their homepage or their user profile. If they didn't enter a homepage URL and they're an anonymous user, or if accessing user profiles is not allowed, the comment author's name will be displayed without a link.

Set the 'token type' to 'Comments'.

Insert-mode features

The Vimrc Project

This page is part of the documentation for the vimrc project. For other documentation pages, check the links in the sidebar or go to the top documentation page.


When editing a PHP file, start an in-line comment as usual:

  // This is a comment.

When you start a new line, the comment leader will be inserted automatically:

  // This is a comment.

This is convenient, until you get to the end of your comment:

  // This is a comment.
  // This is the second and last line of the comment.

To delete the comment leader (and whitespace), just type <C-U> (i.e., CTRL-U: hold down the Control key and type "u".)

Start a documentation block by entering /** and start a new line. The comment leader will be inserted automatically, with the correct indentation:

         * The first character I typed on this line was "T".
         * A space was added automatically on the previous line and this one.
         * The space on the empty line was removed automatically.

To close the block, just type / and vim will give you the correct **/.

Code snippets

Subscribe with RSS Subscribe to RSS - comments