在较早版本的Textmate中,当我双击Rails实例变量(例如@contract)时,所选内容忽略了@符号--这很棒。纸板上只有“合同”。
在Textmate 2.0版本- as .9459中,双击实例变量可以选择@符号和字符。纸板现在包含"@contract“。
是否有方法配置TextMate2.0,以便在select上省略实例变量的@?
发布于 2013-10-22 11:44:07
您可以编辑Ruby包的语言语法来定义"words“。有一个名为"variable.other.readwrite.instance.ruby“的部分,如下所示:
name = 'variable.other.readwrite.instance.ruby';
match = '(@)[a-zA-Z_]\w*';
captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; };从正则表达式中删除@-标志,它的行为将与您所描述的一样:
name = 'variable.other.readwrite.instance.ruby';
match = '[a-zA-Z_]\w*';
captures = { 1 = { name = 'punctuation.definition.variable.ruby'; }; };请注意,现在语法突出显示也不会捕获@。
发布于 2015-06-29 20:06:04
根据https://github.com/textmate/textmate/wiki/FAQ的说法:
如果您不希望标点符号被视为(完成)单元的一部分,那么:
https://stackoverflow.com/questions/18098342
复制相似问题