vim 将带有冒号的参数解释为文件名 :line:column

标签 vim

是否可以以这样的方式配置 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/

相关文章:

Vim - 根据输入猜测编程语言?

VIM 撤消 : Why does the cursor jump to the wrong position when undoing `undojoin` ?

html - 使用 Vim 掌握 CSS 和 XHTML

vim - 如何为 CoffeeScript 生成 ctags?

python - "scripting"vim 使用更细粒度的 python

vim - Grails gdoc 编辑器支持(尤其是 IntelliJ)

vim - 在vim中映射键时,nore是什么意思?

vim - 到字母,然后删除直到字母,然后重复

ubuntu - Vim 映射错误。 <A-j> 的映射导致在 ë 中的映射在 ubuntu 19.10 eoan

vim - 在 Vim 中,如何在搜索后获得匹配总数?