Home Download Buy Blog Forum Support

Addition to CSS zen coding

Re: Addition to CSS zen coding

Postby agibsonsw on Mon Feb 20, 2012 4:30 pm

No worries 8-)

I created a version of my Snippet that refers to the current line, and the Python code eventually deletes this line:

Code: Select all
self.view.run_command("insert_snippet",{"name": "Packages/CSS/Andypropxs.sublime-snippet"})
cur_linef = self.view.full_line(sel)
self.view.erase(edit, cur_linef)

This works great! But I'm more interested in working interactively with the console/output window. Next adventure :D
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Addition to CSS zen coding

Postby sublimator on Tue Feb 21, 2012 11:06 am

sorry, busy as shit dude!

re: inserting snippet ... meant for your regex snippet so you could use a hotkey for the snippet ... instead of propx-tab ...

Similar to this builtin ruby jobbie ...
  { "keys": ["#"], 
"command": "insert_snippet",
"args": {"contents": "#{${1:$SELECTION}}$0"} }


>>> more interested in working interactively with the console/output window

not quite sure what you meant there ...
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: Addition to CSS zen coding

Postby agibsonsw on Tue Feb 21, 2012 6:26 pm

Hi @castles

I'm playing with plug-ins. I can grab text from the input panel, insert it into the main view and run a version of my snippet that uses this text (via TM_CURRENT_LINE) and then deletes the line I inserted:

Code: Select all
self.view.run_command("insert_snippet",{"name": "Packages/CSS/Andypropxs.sublime-snippet"})

But what I'd prefer to do is to pass the input text directly to the snippet as a variable, without having to create, and subsequently erase, a line of text.

Do you know if this is possible? Regards, Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Previous

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 8 guests