WordPress Vim Syntax Highlighting

Lately I have been doing a lot more work in WordPress. I primarily code in Vim, and it always bugged me there was no syntax highlighting for WordPress in Vim (or at least that I could find), so I decided to write one. I started off pulling all the functions from this page: http://codex.wordpress.org/Function_Reference. However I found this page to be pretty incomplete, so I continued to add functions to the file as I went along.

I decided to release the file to the public in case anyone is looking for WordPress syntax highlighting. Note, by no means is this file complete, but is a good base. Feel free to contact me to fill in any functions I am missing.

Find it on Github

To install, download and place in your .vim/syntax/ directory. Then load by running in vim:

:set syn=wordpress

Or place something like the following in your .vimrc file:

autocmd BufEnter *.php :set syn=wordpress

6 thoughts on “WordPress Vim Syntax Highlighting”

  1. Great work Darshan, your plugin is miles more complete than mine. I didn’t do it by hand. I simply parsed the Codex function reference and parsed out all the function names.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>