Enable syntax highlighting in VIM for PHP-FPM configurations

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, February 18, 2012

Follow me on Twitter as @mattiasgeniar

By default, vim doesn’t recognise the syntaxing options for the /etc/php-fpm.conf files. So if you edit them, there’s no syntax highlighting whatsoever.

If you want that, add the following line to your ~/.vimrc file:

syntax on
autocmd BufRead,BufNewFile /etc/php-fpm.conf set syntax=dosini
autocmd BufRead,BufNewFile /etc/php-fpm.d/*.conf set syntax=dosini

That enables your syntax highlighting in Vim and sets the file “/etc/php-fpm.conf” and “/etc/php-fpm.d/*.conf” to follow the syntax rules defined in the “dosini” set. Other syntax highlighting options are defined in “/usr/share/vim/vim*/syntax/*.vim”. Each .vim file there can be used as the syntax option in the “syntax=” line in your vimrc file.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.