add cakephp .ctp files to notepad++

David Jones

I love using notepad++ its become my tool of choice for programming and it works so well with different languages it makes it very easy for me to stick to the same environment. At my work I regularly use cakephp for developing websites and if you are familiar with this you will know that cakephp uses .ctp files for its html or view files. The .ctp actually stands for cake template and isn’t actually recognised as anything by default in notepad++. To get around this you need to make one quick edit to your language settings and these files will open as they should automatically. If you are like me and are using windows 7 then open up C:\Users\YOURNAME\AppData\Roaming\Notepad++\langs.xml Find the xml block that defines the html language on mine its around line 92, it should look something like this

<language name="html" ext="html htm shtml shtm xhtml" commentLine="" commentStart="<!--" commentEnd="-->">

Change the ext line to include the ctp file extension like so

<language name="html" ext="html htm shtml shtm xhtml ctp" commentLine="" commentStart="<!--" commentEnd="-->">

Now close notepad++ and open it up again now open a ctp file and it should style it as html.


  • avatar-irishbloke
    # irishbloke
    been looking how to do this for ages, thanks
  • avatar-anderson
    # Anderson
    Very gooooood !
  • avatar-nikhil
    # nikhil
    Hey! Thanks
  • avatar-muhammad-raheel
    # Muhammad Raheel
    Thanks, your tips are really helpful!

Comments are currently closed