Home Download Buy Blog Forum Support

Is there a Smarty plugin for Sublime Text?

Is there a Smarty plugin for Sublime Text?

Postby arsub on Fri Nov 20, 2009 11:38 pm

Is there a plugin that would enable Sublime Text to provide syntax highlighting for the Smarty templating language? I've looked in the 'Sublime Text Community Packages' but not found anything.

Previously, I was using Notepad++, with the optional 'user defined language' file for Smarty, to achieve this. Also, Komodo Edit provides this facility 'out of the box'.

Thanks in anticipation for any advice.
arsub
 
Posts: 1
Joined: Fri Nov 20, 2009 11:28 pm

Re: Is there a Smarty plugin for Sublime Text?

Postby jps on Mon Nov 23, 2009 10:00 pm

In general, you can use TextMate syntax highlighting files: the one for Smarty is at http://svn.textmate.org/trunk/Bundles/P ... /Syntaxes/ - you'll need to save the file under Sublime Text's Packages/<something> directory (you can access this via 'Preferences/Browse Packages...'), and rename it such that it has an extension of '.tmLanguage'
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Is there a Smarty plugin for Sublime Text?

Postby etune on Wed Mar 31, 2010 2:49 pm

I've followed these instructions and I can't this to work. Does anyone have smarty working well in their editor?

Thanks
etune
 
Posts: 3
Joined: Wed Mar 31, 2010 2:43 pm

Re: Is there a Smarty plugin for Sublime Text?

Postby Anomareh on Wed Mar 31, 2010 3:34 pm

You need to do more than just installing it. You need to edit HTML.tmLanguage.

Uncomment lines 543-546, 712-753, and lastly change the value of line 739 to 0.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Is there a Smarty plugin for Sublime Text?

Postby tito on Fri Oct 07, 2011 6:34 pm

I was going to start a thread to provide some instructions on how I enabled Smarty language.

Here is:

1- With Sublime Text 2 default installation
2 - Open file "Packages\HTML\HTML.tmLanguage", if you search for string "<!--" you will notice that (currently) there is two references to "Smarty language" commented. Un-comment these.
3 - Download this file "http://svn.textmate.org/trunk/Bundles/PHP%20Smarty.tmbundle/Syntaxes/Smarty.plist" as file "Packages\User\Smarty.tmLanguage"
4 - Default "colour-scheme" may not high-lite the syntax properly but "twilight" do. Preferences -> Colour Scheme -> Twilight
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Is there a Smarty plugin for Sublime Text?

Postby bernds on Wed Jan 25, 2012 1:52 pm

Hi tito and sublime users,

thank you very much for your smarty-instructions!

Unfortunateley, this method doesn't seem to work with the latest release (Sublime Text 2 Build 2165).

Ok, the Language-packs are now ending on ".sublime-package".
I renamed the smarty.tmLanguage to Smarty.sublime-package in the /User directory but Sublime keeps displaying an error message on startup. (I also tried to place it in the root directory of /packages)

Of course, I uncommented the smarty-instructions in the HTML.sublime-package.

Does anybody know how to get smarty highlighting work with the current release of Sublime 2?

Would be very grateful!

Best Regards

Bernd
bernds
 
Posts: 2
Joined: Wed Jan 25, 2012 1:40 pm

Re: Is there a Smarty plugin for Sublime Text?

Postby bernds on Wed Jan 25, 2012 2:23 pm

ahh sorry guys, it works perfect with titos instructions!!

I've been searching in the Sublime Program directory all the time, not in the user/AppData directory which was meant... hehe :oops:

Best Regards

Bernd
bernds
 
Posts: 2
Joined: Wed Jan 25, 2012 1:40 pm

Re: Is there a Smarty plugin for Sublime Text?

Postby vardump on Tue Mar 06, 2012 2:20 pm

titos guide worked for me also perfectly!
i have the newest version of sublime text 2 (Build 2183)
vardump
 
Posts: 1
Joined: Tue Mar 06, 2012 2:19 pm

Re: Is there a Smarty plugin for Sublime Text?

Postby StevenRas on Wed Mar 28, 2012 6:15 am

Hi guys,

thanks for those tricks to get smarty support running.

Now my question is:
Is there an easy way to give the "smarty tags" a different color then the "html tags"?

I feel like color-wise I would like the to totally stand out in an html document.... right now they look like html tags to me....

any ideas? I am using the Monokai theme...

Thanks for your support
Steven
StevenRas
 
Posts: 11
Joined: Fri Mar 23, 2012 4:58 pm

Re: Is there a Smarty plugin for Sublime Text?

Postby jitendravyas on Wed Mar 28, 2012 1:10 pm

Not working for me. I followed Tito's instructions. I'm using build 2181 and my OS is Windows 7 - 64 bit
jitendravyas
 
Posts: 28
Joined: Wed Nov 16, 2011 3:07 am

Next

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 5 guests