这是 urxvt-selection-autotransform 命令,可以使用我们的多个免费在线工作站之一在 OnWorks 免费托管服务提供商中运行,例如 Ubuntu Online、Fedora Online、Windows 在线模拟器或 MAC OS 在线模拟器
程序:
您的姓名
selection-autotransform - 自动转换选择文本
商品描述
此选择允许您在选择时对选择进行自动变换
是。
它通过指定 perl 片段(最有用的是单个“s///”运算符)来工作
$_ 作为资源:
URxvt.selection-autotransform.0:变换
URxvt.selection-autotransform.1:变换
...
例如,以下将转换“文件名:编号”形式的选择,通常
在编译器消息中看到,进入“vi +$filename $word”:
URxvt.selection-autotransform.0: s/^([^:[:space:]]+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/
和这个例子匹配相同,但用vi-commands替换它你可以直接粘贴
进入你的 (vi :) 编辑器:
URxvt.selection-autotransform.0: s/^([^:[:space:]]+(\\d+):?$/:e \\Q$1\\E\\x0d:$2\\x0d/
当然,这可以修改以满足您的需要和您的编辑器:)
要将上面的示例扩展为典型的 perl 错误消息(“XXX at FILENAME line YYY.”),
你需要一个稍微复杂的解决方案:
URxvt.selection.pattern-0: ( 在 .*? 行 \\d+[,.])
URxvt.selection-autotransform.0: s/^ 在 (.*?) 行 (\\d+)[,.]$/:e \\Q$1\E\\x0d:$2\\x0d/
第一行告诉选择代码处理每个错误的不变部分
消息作为选择模式,第二行将消息转换为 vi
加载文件的命令。
使用 onworks.net 服务在线使用 urxvt-selection-autotransform