insert mode

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.

Comments

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

Read more
Subscribe with RSS Syndicate content
nobody click here