17

How To Add A File Extension To vim Syntax Highlighting


Posted by Artem Russakovskii on April 2nd, 2008 in Databases, Linux, Programming

Updated: July 8th, 2009

17 Responses to “How To Add A File Extension To vim Syntax Highlighting”

    17 Comments:
  1. Thaya says:

    I used to hate VIM when I first started programming. Now I am powerless without it. It's amazing how feature-rich the text editor is. I still learn new VIM tricks 3-4 times a month.

  2. Jimmy Janks says:

    This is the best ever, thanks for posting this!
    I would only add that you can spare yourself the "syntax on" and "filetype on" lines if these are already your defaults and just add the new to-be-highlighted extensions with the "au" line.
    Belissima!

  3. It was very helpful. Thanks!

  4. Srikanth says:

    Thanks for the tip, this helped me today :)

  5. roger says:

    Thanks a lot !
    I was looking for this for a long time !

    Bye,
    Roger

  6. Shushan says:

    You made my day. Thanks!

  7. kunthar says:

    In case this recipe doesn't works for anyone, just use this;
    :syntax on
    :set syn=php or whatever extension you want.

  8. Merijn says:

    Thanks for the tip!

  9. Amy says:

    You are awesome. Thanks for this!

  10. Phani T says:

    Thanks a lot dude.
    i was looking for this tip from a long time.
    Its working just fine.

  11. Vishal Kotcherlakota says:

    Running great on Vim on Slackware! Thanks for putting out this tip. It saved me a lot of digging through Vim's documentation. =)

  12. chrish says:

    Awesome! Real time saver. Was preparing to RTFM :)

  13. neurox says:

    Thanks – I needed this badly for Magento's .phtml files (which are actually PHP). Awesome! :)

  14. Joel says:

    Thanks google, and thanks to you for the great tip. works like a champ.

  15. Yo says:

    It may have been a while but it's still useful. Thanks!

  16. John says:

    Just what I was looking for.

    Thanks dude!

Leave a Reply