20

How To Add A File Extension To vim Syntax Highlighting


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

Updated: July 8th, 2009

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

    20 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!

  17. Carlos says:

    Thanks! It's exactly what I needed.

  18. Jake says:

    Hey I am trying to do this but it is not quite working as expected. It will highlight that file type BUT it also highlights other file types using that highlighting. (Bad).

    My problem is documented here if anyone has any input that would be much appreciated. (You don't need a username or password to reply).

    http://superuser.com/questions/113455/vim-highlighting-for-specific-file-types

    Jake

Leave a Reply

Connect with Facebook