Message from discussion
LESS support
Received: by 10.52.240.229 with SMTP id wd5mr38434369vdc.8.1342007061048;
Wed, 11 Jul 2012 04:44:21 -0700 (PDT)
X-BeenThere: zen-coding@googlegroups.com
Received: by 10.52.179.69 with SMTP id de5ls128896vdc.1.gmail; Wed, 11 Jul
2012 04:44:20 -0700 (PDT)
Received: by 10.52.20.51 with SMTP id k19mr1696857vde.8.1342007060715;
Wed, 11 Jul 2012 04:44:20 -0700 (PDT)
Date: Wed, 11 Jul 2012 04:44:20 -0700 (PDT)
From: jakethesnake <jake....@gmail.com>
To: zen-coding@googlegroups.com
Message-Id: <9c33ded1-cbcb-4727-8d87-ee19d883d8e2@googlegroups.com>
In-Reply-To: <9963B403B2DF43BB8E3C061C23D9A779@gmail.com>
References: <d520b37f-c333-49eb-88fc-4b33ed6bf33f@googlegroups.com>
<9963B403B2DF43BB8E3C061C23D9A779@gmail.com>
Subject: Re: LESS support
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_75_8248933.1342007060286"
------=_Part_75_8248933.1342007060286
Content-Type: multipart/alternative;
boundary="----=_Part_76_26472584.1342007060286"
------=_Part_76_26472584.1342007060286
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi there,
Is there a way to add Zen coding support to LESS files with Espresso for=20
mac? I am also looking to see if this is supported within PHPstorm software=
=20
also?
Thanks in advance
On Wednesday, July 4, 2012 9:01:53 AM UTC+1, Sergey Chikuyonok wrote:
>
> The simplest solution is to modify zencoding/interface/editor.py file.=
=20
> You should update get_syntax() method (line 168) so it matches LESS scope=
=20
> but returns it as CSS.=20
>
> This method may look like this:
>
> def get_syntax(self):
> """
> Returns current editor's syntax mode
> @return: str
> """
> view =3D active_view()
> scope =3D view.syntax_name(view.sel()[0].begin())
> default_type =3D 'html'
> doc_type =3D None
>
> try:
> if 'xsl' in scope:
> doc_type =3D 'xsl'
> else:
> doc_type =3D re.findall(r'\bhtml|js|less|css|xml|haml\b',=20
> scope)[0]
> # Sublime has back to front scopes ....
> except:
> doc_type =3D default_type
>
> if doc_type =3D=3D 'less':
> # serve LESS documents as CSS
> doc_type =3D 'css'
>
> if not doc_type: doc_type =3D default_type
> return doc_type
>
> ___________________________________________
> =D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9 =D0=A7=D0=B8=D0=BA=D1=83=D1=91=D0=BD=
=D0=BE=D0=BA
> http://chikuyonok.ru
> serge....@gmail.com
>
> On Wednesday, July 4, 2012 at 10:46 AM, IschaGast wrote:
>
> I am a big fan of zencoding but it looks like there is no LESS support in=
=20
> Sublime Text, is there a way to get this working?
>
> =20
>
------=_Part_76_26472584.1342007060286
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi there,<br><br>Is there a way to add Zen coding support to LESS files wit=
h Espresso for mac? I am also looking to see if this is supported within PH=
Pstorm software also?<br><br>Thanks in advance<br><br>On Wednesday, July 4,=
2012 9:01:53 AM UTC+1, Sergey Chikuyonok wrote:<blockquote class=3D"gmail_=
quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pa=
dding-left: 1ex;">
<div>
The simplest solution is to modify zencoding/interface/=
editor.py file.
</div><div>You should update get_syntax() method (line=
168) so it matches LESS scope but returns it as CSS. </div><div><br><=
/div><div>This method may look like this:</div><div><br></div><div><div>def=
get_syntax(self):</div><div> """</div><div> Retu=
rns current editor's syntax mode</div><div> @return: str</div>=
<div> """</div><div> view =3D active_view()</div>=
<div> scope =3D view.syntax_name(view.sel()[0]<wbr>.begin())</=
div><div> default_type =3D 'html'</div><div> doc_=
type =3D None</div><div><br></div><div> try:</div><div> =
if 'xsl' in scope:</div><div> &nbs=
p; doc_type =3D 'xsl'</div><div> e=
lse:</div><div> doc_type =3D re.fi=
ndall(r'\bhtml|js|less|<wbr>css|xml|haml\b', scope)[0]</div><div> &nb=
sp; # Sublime has back to front scopes ....</di=
v><div> except:</div><div> doc_type=
=3D default_type</div><div><br></div><div> if doc_type =3D=3D=
'less':</div><div> # serve LESS documents =
as CSS</div><div> doc_type =3D 'css'</div><div><=
br></div><div> if not doc_type: doc_type =3D default_type</div=
><div> return doc_type</div></div>
<div><div><br></div><div style=3D"font-family:'Lucida Grand=
e';font-size:13px">______________________________<wbr>_____________</div><d=
iv style=3D"font-family:'Lucida Grande';font-size:13px">=D0=A1=D0=B5=D1=80=
=D0=B3=D0=B5=D0=B9 =D0=A7=D0=B8=D0=BA=D1=83=D1=91=D0=BD=D0=BE=D0=BA</div><s=
pan style=3D"font-family:'Lucida Grande';font-size:13px"><a href=3D"http://=
chikuyonok.ru" target=3D"_blank">http://chikuyonok.ru</a></span><span style=
=3D"font-family:'Lucida Grande';font-size:13px"><br></span><span style=3D"f=
ont-family:'Lucida Grande';font-size:13px"><a href=3D"mailto:serge.che@gmai=
l.com" target=3D"_blank">serge....@gmail.com</a></span><div><br></div></div=
>
=20
<p style=3D"color:#a0a0a8">On Wednesday, July 4, 2012 at 10=
:46 AM, IschaGast wrote:</p>
<blockquote type=3D"cite" style=3D"border-left-style:solid;=
border-width:1px;margin-left:0px;padding-left:10px">
<span><div><div>I am a big fan of zencoding but it look=
s like there is no LESS support in Sublime Text, is there a way to get this=
working?</div></div></span>
=20
=20
=20
=20
</blockquote>
=20
<div>
<br>
</div>
</blockquote>
------=_Part_76_26472584.1342007060286--
------=_Part_75_8248933.1342007060286--