Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Regex TriggerText? #26

Open
mreq opened this Issue · 6 comments

2 participants

@mreq

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.

@erinata
Owner

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

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...).

@erinata
Owner

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

.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 ;]

@erinata
Owner

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

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
Something went wrong with that request. Please try again.