vim和snipmate/代码片段:如何创建自定义行为
以下是我的片段:vim和snipmate/代码片段:如何创建自定义行为,vim,code-snippets,snipmate,Vim,Code Snippets,Snipmate,以下是我的片段: # Get repository of a table: snippet repo $$2 = $this->getRepository('${1:Bundle}:${2:TableName}') ${3} 当我使用它时,它可能会产生以下结果: $Person = $this->getRepository('MyBundle:Person') $Address = $this->getRepository('MyBundle:Address'
# Get repository of a table:
snippet repo
$$2 = $this->getRepository('${1:Bundle}:${2:TableName}')
${3}
当我使用它时,它可能会产生以下结果:
$Person = $this->getRepository('MyBundle:Person')
$Address = $this->getRepository('MyBundle:Address')
我希望第一个字母是小写的,总是小写的,给我一些类似于:
$person = $this->getRepository('MyBundle:Person')
$address = $this->getRepository('MyBundle:Address')
...
。有没有办法用snipmate做到这一点?我认为使用snipmate是不可能的,但您可以看看UltiSnips。UltiSnips使用非常相似的模板语法(非常容易转换),并且用途更广泛。 这不能用snipMate完成。我已经尝试过实现这个,但是(特别是当转换改变了字符数时),用当前的实现是不可能的困难
这可能是转向一个现代的、维护的替代方案(但需要Python支持)的最佳理由。在这里,这个特性叫做转换,并使用了一个
${我也在寻找递归代码段(代码段中的代码段)。非常感谢您提供的这些信息。