是否可以以这样的方式配置 VIM,如果我输入
vim filename:123:89
它打开文件
filename
转到第 123 行和第 89 列?如果不是通过 VIM 可能会对 shell 进行黑客攻击?
最佳答案
您可以安装 file-line插件打开文件到文件名后指定的行和列。 ( github mirror )
来自 github 上的自述文件
When you open a
file:line
, for instance when coping and pasting from an error from your compiler vim tries to open a file with a colon in its name.Examples:
vim index.html:20 vim app/models/user.rb:1337
With this little script in your plugins folder if the stuff after the colon is a number and a file exists with the name especified before the colon vim will open this file and take you to the line you wished in the first place.
关于vim 将带有冒号的参数解释为文件名 :line:column,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26733668/