Skip navigation.
Sponsors
Recent comments
Vim and Drupal Modules

Vim and Drupal Modules

18
Aug
2008

I just finished upgrading a server to Ubuntu 8.04 which came with Vim 7.1 rather than 6.3 on the older server. It seems 7.1 does things slightly differently to 6.3.

In 6.3 I could create ~/.vim/filetype.vim and in there define a line as follows:

au BufRead,BufNewFile *.module,*.install,*.theme setf php

However in 7.1, it looks like a line similar to this has to go into ~/.vimrc instead…

au BufReadPost *.module,*.install,*.theme set syntax=php

This tip took me about half an hour to find… Hopefully it'll help someone else programming Drupal with Vim figure out how to get modules, themes and install files to associate with the PHP filetype (specifically for highlighting).

I have a similar

I have a similar configuration in ~/.vim/filetype.vim and it works fine, but it is slightly different from yours.

Here it is:

augroup filetypedetect
autocmd BufNewFile,BufRead *.module setfiletype php
autocmd BufNewFile,BufRead *.install setfiletype php
autocmd BufNewFile,BufRead *.inc setfiletype php
autocmd BufNewFile,BufRead *.info setfiletype dosini
autocmd BufNewFile,BufRead *.test setfiletype php
augroup END

It'd be nice if you asked before taking stuff from my site. Contact me at webmaster [at] thingy - ma - jig . co . uk

This site was based on the Cobalt 2.0 Theme for phpBB written by Jakob Persson

Search
Weblinks

Add to Technorati Favorites

TGC Webring

CMS Drupal Showcase

Feedburner for ThingyMaJig

View Nicholas Thompson's profile on LinkedIn

Nicholas Thompson's ClaimID

IconBuffet

Twitter

Become A Fan