Installing Coder on Vim, Sublime Text, Visual Studio Code, Komodo, TextMate, Emacs & Geany

Last updated on
29 November 2026

Directions how to integrate Drupal's Coder project with the following IDEs.

Vim

See this great, but slightly out-dated, blog post here.

The Vimrc project includes the needed Vim configuration: you will still have to install Coder project and the Syntastic plugin for vim.

You'll probably want some git integration too.

Once those are installed, to get code standards review on every save, and details in your vim status line, just add this to your .vimrc:

let g:syntastic_php_phpcs_args="--standard=Drupal --extensions=php,module,inc,install,test,profile,theme"
if has('statusline')
  set laststatus=2
  " Broken down into easily includeable segments
  set statusline=%<%f\ " Filename
  set statusline+=%w%h%m%r " Options
  set statusline+=%{fugitive#statusline()} " Git Hotness
  set statusline+=\ [%{&ff}/%Y] " filetype
  set statusline+=\ [%{getcwd()}] " current dir
  set statusline+=%#warningmsg#
  set statusline+=%{SyntasticStatuslineFlag()}
  set statusline+=%*
  let g:syntastic_enable_signs=1
  set statusline+=%=%-14.(%l,%c%V%)\ %p% " Right aligned file nav info
endif

NeoVim

To get nice asynchronous phpcs working you can use the neomake plugin. Once you have that installed all you need to put in your init.vim is:

let g:neomake_php_phpcs_args_standard = 'Drupal'

If you want to run neomake every time you save a php file, you can do something like:

"run Neomake on php files on save
 function! RunAutoPHP()
   if &filetype == 'php'
     Neomake
   endif
 endfunction
 
 autocmd! BufWritePost * call RunAutoPHP()

Sublime Text

Sublime Text 3: https://github.com/mattwithoos/SublimeText3DrupalCoder
Sublime Text 2: (obsolete) https://github.com/sirkitree/DrupalCodingStandard

Komodo

See this blog post on this. http://blog.8bitplateau.net/drupa-code-sniffer-komodo/

TextMate

See: http://nuams.com/blog/installing-drupal-code-sniffer-textmate

Visual Studio Code (VS Code), its builds and forks

See the dedicated section of the “VS Code for Drupal” guide on how the contrib Coder project plays a key role in providing development aid in this family of IDEs.

Emacs

Details on running phpcs from within Emacs: http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php (scroll down to the Printing an Emacs Report section, and be sure to replace the --standard=PEAR bit of the command with --standard=Drupal.
You can also integrate phpcs/drupalcs with Emacs' flymake-mode, see http://marmalade-repo.org/packages/flymake-phpcs.

Geany

Adapted from docs.joomla.org.

  • Open a PHP file
  • On the top menu, select Build > Set Build Commands.
  • Select the middle line in the PHP Commands section and name it “Codesniffer”
  • Enter this code in the Command:
    phpcs --extensions=php,module,inc,install,theme --standard=Drupal --report-width=999 "%f" | sed -e 's/^/%f |/' | egrep 'WARNING|ERROR'
  • Enter this code in the Error regular expression field:
    (.+) [|]\s+([0-9]+)
  • Select OK.
  • If the message window is not open at the bottom, display it by selecting it in the top View menu.
  • When viewing any PHP file, press F9 to run phpcs and see the errors found.

Help improve this page

Page status: No known problems

You can: