8

I'm using NOTPAD++ and I wonder how I can highlight codes in tpl files.

I googled online and there are answers but none of them works. For intance, http://sourceforge.net/p/notepad-plus/discussion/331753/thread/3067a53d/

Any ideas?

Or any other better programmes than NOTEPAD++ for highlighting codes in tpl files?

Run
  • 54,938
  • 169
  • 450
  • 748

6 Answers6

10

The following method is compatible with Sublime Text 2 and 3.

  1. Open your .tpl file in Sublime Text
  2. In the Sublime Text menu, navigate to PreferencesPackage Control
  3. From the drop-down list choose Package Control: Install Package
  4. Type "smarty" and Sublime Text Smarty should appear in the search results. Click it to install.
  5. In the menu you can now navigate to ViewSyntaxSmarty to enable Smarty syntax highlighting for your document.

More information about this package can be viewed here.

If you end up with the Command Palette (the drop-down part of the UI) still open after installing the package, you can press Ctrl Shift P, or on Mac Cmd Shift P, to toggle it closed again.

Mentalist
  • 1,530
  • 1
  • 18
  • 32
JD Savaj
  • 803
  • 8
  • 16
9

I found these instructions and worked for me.

http://was955.wordpress.com/2013/03/06/how-to-add-a-tpl-files-to-notepad-as-a-php-file/

  • Step 1) Run Notepad++ using from “Run as Administrator”.
  • Step 2) Go to “Settings”->”Style Configurator”.
  • Step 3) Add in the .tpl extension name into the “User ext” column by choosing PHP or html as a Language on from the options on left hand selection box.
  • Step 4) Click Save & Close on next.
Žiga
  • 198
  • 3
  • 7
7

How about userDefineLang_smarty.xml:

http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_smarty.xml

Sophia
  • 79
  • 1
  • 4
  • 3
    Please, refer here: http://stackoverflow.com/questions/5677962/notepad-custom-language-highlighting ;) – Sophia Aug 12 '13 at 14:41
2

My search for a good and free Smarty Editor, resulted in Netbeans with a Smarty Plugin (named PHP Smarty Framework). I am an eclipse user, whenever I need to work on views (templates) I switch to Netbeans. But, I accept this as a Temporary solution and looking for a working smarty plugin for Eclipse.

bkilinc
  • 989
  • 2
  • 13
  • 28
1

SynWrite editor, also free, allows you to create TPL lexer of any kind. See lexer-related tutorials in Readme folder.

Prog1020
  • 4,530
  • 8
  • 31
  • 65
0

I've just tried, the highliting dont seems to work properly (text in white, bg in black).

is it working for you?

Bruno
  • 1,088
  • 1
  • 13
  • 31