info
Vim and drupal code validation
I have been using the Syntastic plugin for vim for a long time. Syntastic does what it have to, in php files it validates the file by in short terms do a
$ php -l FILENAME
And present the error(s) in the statusbar, and with a little marker at the line(s).
If you install the PHP_CodeSniffer via the pear installer, Syntastic automatic validates the code against the default code standards setup in php_codesniffer.
I found DrupalCS module by Ericduran which is a PHP code sniffer addon, and tests your active code on-the-fly when saving.
The DrupalCS and phpcs (php code sniffer) is integrated into the Syntastic plugin.

The installation of PHP Code Sniffer and Drupal CS is quite simple, and it’s nicely documented on the DrupalCS module page.
After installing it, you can test if the DrupalCodingStandard work by test if it’s loaded in your terminal
$ phpcs -i
If you want to test a file from your terminal, you can fire the command
phpcs --standard=DrupalCodingStandard --extensions=php,module,inc,install,test,profile,theme FILENAME.module
The result will look something like this output
If you execute the phpcs without the Drupal specific validator
$ phpcs --extensions=php,module,inc,install,test,profile,theme FILENAME.module
The result output is a bit more scary.
Vim configuration
The configuration for vim im using to get it working is.
let g:syntastic_enable_signs=1 " Enable markers on the line containing a problem.
let g:syntastic_auto_jump=0 " Dont jump to the first line with a problem
let g:syntastic_phpcs_conf='--standard=DrupalCodingStandard --extensions=php,module,inc,install,test,profile,theme' " Test php,module,inc,install ... files with the DrupalCodingStandard
The first days after using it on a daily basis, it was quite annoying, but it have made me more aware of how i code.
My Vim configuration and plugins
My primary editor for PHP/Drupal programming have been MacVim for years, and therefore my editor have been tweaked and customized to my needs, you can see my .vimrc file. I’m always ready for new plugins, new branches of existing repositories and to learn new.
The installed version of my MacVim is the snapshot-64. Which is installed with Homebrew.
First of all the colorscheme is very important, since we’re looking at it for (way too many) hours a day. I toggles between github and Mustang2.
Below theres a list of all the installed plugins im using these days. All plugins, syntax and colorschemes is handled by pathogen.vim which in short terms makes it very easy to install new plugins, colorshemes and so on.
Ack is an alternative grep command, which is more effective and fast. Use this plugin to search recursivly from the current path for a text-string.
:Ack 'function hook_node_info'
Will look in current path for the written text string.
CTRLP.vim is described in this blogpost.
Gundo.vim gives you a little window, where you will se a visualized view of your undo-tree.
Jsbeautifier is a little tool, which can format / indent your .js code nice, an online version can be found here jsbeautifier
JSHint is a little nodeJS tool, so you can test your .js code for code errors.
:JSHint %
Will run jshint on the current file and open a little scratch window, which describes all errors with linenumbers.

NERDCommenter provides a nifty feature to easy change a block of text to a comment block, supports a lot of different filetypes.
NERDTree have been the most important plugin for me, the plugin creates a window where you can explore your filesystem, open files and create/delete files/directories.

Syntax highlight file for php5, which can be configured a bit.
Supertab works when hitting <TAB> when typing a word, it will display a box with text suggestions, and you can browse through suggestions with <TAB> and <S-TAB>

Syntastic checks your sourcecode for syntax errors. It checks your code through external syntax checkers. You will be notified by a little mark on all lines containing an error. And shows a window where information about the error is shown.
Check this blogpost for a lot more info on this subject.
Tagbar shows a sidebar with functions, variable definitions generated by ctags. Classes, properties, methods and functions in javascript.

vim-buffergator lets you see a window on the left, with all open buffers.
vim-css-color will highlights color definitions in css-files. a color will be shown with the color as background for the text, #f00 will be shows as white text on red background.
Vim-fugitive Handle various git commands from within vim.
Vim-indexed-search shows a “Match x of y” when searching in buffers.

Vim-jquery is a syntax file to add some colorations for jQuery keywords and css selectors.
Vim-matchit - The % in normal vi/vim will jump between matching [ ( {’s, with matchit you will be able to jump between keywords as if, then, else, foreach, you can decide yourself, the configuration goes into the .vimrc file.
Vim-nginx is as simple as syntax colors for nginx configuration files.
Powerline is a utility plugin which allows you to create better-looking, more functional vim statuslines.
Vim-surround is all about “surroundings”: parentheses, brackets, quotes, XML tags, and more. The plugin provides mappings to easily delete, change and add such surroundings in pairs
ZoomWin you easy makes your window zoom in/out of full screen with