Regex TriggerText? #26

Open
mreq opened this Issue Mar 13, 2012 · 6 comments

Comments

Projects
None yet
2 participants

mreq commented Mar 13, 2012

Would it be hard to make it able to define the TriggerText via regex? It would be awesome for CSS/LESS/SASS.

BTW: Don't you have a donate button somewhere? People like you are exactly the type I want to support by sending a few bucks. Great work.

Owner

erinata commented Mar 13, 2012

Can you explain more about what you mean by define triggertext via regex?
Does it mean that you want to be able to trigger the same snippet by typing a bunch of different triggertexts?

For the donation button.....I will tell you when I have one. Thanks for your support ^_^
For now, to show support to this project, just make more snippets, use fingertext and tell your friends.

mreq commented Mar 13, 2012

Exactly.

Say I want to trigger it on .sometext or .something-else with a single snippet (for a regex-defined string; classes are always different...).

Owner

erinata commented Mar 13, 2012

if possible can you provide me a real use case (say in CSS) ?

I think it can be done with a very stupid method, which will harm the performance a lot. Let me see if I can figure out a better way to do it.....

mreq commented Mar 15, 2012

.someClass<tab>
becomes
.someClass { $[![]!] }

.anotherClass<tab>
becomes
.anotherClass { $[![]!] }

currently I have to do .someClass q<tab> where q does the
{ $[![]!] }

Hope it's clear, hate github markdown ;]

Owner

erinata commented Mar 15, 2012

I see......

I guess what I expect you do do is to have a snippet named "q"

.$[![name]!]Class {
$[![]!]
}

and type the name after you trigger the snippet.

And if you do not want to type the class name after you trigger the snippet, you can also do q(some) or q(another) , then the $[![name]!] hotspot will be filled automatically with "some" and "another". (you can "pass parameters" when you trigger a snippet)

I know these are not exactly what you want but I still do not have a good way to implement the regex thing. Let see if I can come up with some clever method later.

mreq commented Mar 15, 2012

No I did a bad example ;) The word(s) after the dot are completely random.

Don't worry about it. It's just an extra keystroke. I thought it maybe wouldn't be that hard so I brought that up.

Currenty I use
q for
{ $[![]!] }
and d for
.$[![]!] { $[![]!] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment