[英]Vim to accept commands like `vi path:line:column`
It's often that I get paths in the format <path>:<line>:<column>
(from text matches such as grep
or errors on code).我经常以<path>:<line>:<column>
格式获取路径(来自文本匹配,例如grep
或代码错误)。
When I double click, it matches the whole string, including line and column, then I usually remove the column, and replace :line
with +line
to match vi
parameter.当我双击时,它匹配整个字符串,包括行和列,然后我通常删除列,并将:line
替换为+line
以匹配vi
参数。
Therefore, I'd like having a hack to rapidly open vim at the right point just with a paste.因此,我想有一个 hack,只需使用粘贴即可在正确的点快速打开 vim。 Is there any config on vim level or alias I could use?!我可以使用vim级别或别名的任何配置吗?!
Thanks谢谢
There are plugins that trap the BufNewFile,BufRead
events, parse out the file name and number(s), and redirect to the corresponding file:有一些插件可以捕获BufNewFile,BufRead
事件,解析出文件名和编号,并重定向到相应的文件:
Use the quickfix list instead : 改用快速修复列表:
Vim has a startup option
-q
to read a quickfix file. Vim 有一个启动选项-q
来读取 quickfix 文件。 So we have options (depending on your shell):cmd > results ; vim -q results
所以我们有选项(取决于你的外壳):cmd > results ; vim -q results
cmd > results ; vim -q results
Or my favorite:
vim -q <(cmd)
或者我最喜欢的:vim -q <(cmd)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.