Here's my snippet:
# Get repository of a table:
snippet repo
$$2 = $this->getRepository('${1:Bundle}:${2:TableName}')
${3}
When I use it, here's what it may generate:
$Person = $this->getRepository('MyBundle:Person')
$Address = $this->getRepository('MyBundle:Address')
I would like the first one to be lowercase, always lowercase, and give me something like:
$person = $this->getRepository('MyBundle:Person')
$address = $this->getRepository('MyBundle:Address')
...
. Is there a way to do this with the snipmate?
This cannot be done with snipMate. I've tried to implement this, but (especially when the transformation changes the number of characters), it's impossibly hard with the current implementation.
That may be the best reason to move to the UltiSnips plugin, a modern, maintained alternative (that however requires Python support). There, the feature is called transformation, and uses a ${<tab stop no/regular expression/replacement/options}
syntax. You can use the \L
regular expression atom to lowercase the replacement.