vimrc

Screenshots

Syntax highlighting

This screenshot shows custom highlighting of documentation blocks and .info files using the delek color scheme.

screenshot showing syntax highlighting

Plugins

Note that the lower central window is on line 113, column 38. In other words, the cursor is on the text drupal_get_path. I used <C-W>] to open the upper window on the definition of drupal_get_path(). See the description of Tag searches.

The left and right windows show the use of two Recommended plugins: the NERDTRee directory brower and the Tagbar tag browser. The current directory is for the Ctools module. Tagbar always displays tage for the currently avtive window: in this case, the core
includes/common.inc.

screenshot showing vim with split windows and the NERDTree and Tagbar plugins

Automatic completion

Read more

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

Installation

Where to get Vim

The vim home page is http://www.vim.org/, and the main download page is http://www.vim.org/download.php. Most Mac users prefer this version: http://code.google.com/p/macvim/.

To use the vimrc project, you need at least vim 7.0 with "normal" features enabled at compilation time. As of early 2012, the current version is 7.3. See Prerequisites if you are not sure what version of vim you already have.

The sections below describe

and additional steps needed for some features:

Installation with drush

$ drush @none dl vimrc
$ drush help vimrc-install
$ drush -v vimrc-install <options>
Read more
Subscribe with RSS Syndicate content
nobody click here