Vim:在不同行上打开多个文件 [英] Vim : Open multiples files on different lines
问题描述
我想知道是否有办法用 Vim 打开多个文件,但每个文件都在特定的行号上.我解释:
I was wondering if there's a way to open multiples files with Vim, but each file on a specific line number. I explain :
我经常使用的语法是:vim my/way/too/far/file +120为了在第 120 行编辑此文件,因为 gcc 也告诉了我:)
I often use the syntax : vim my/way/too/far/file +120 in order to edit this file at line 120 because gcc told me too :)
现在我正在寻找一种同时对多个文件执行此操作的方法!
Now what i'm looking for is a way to do this for multiples files at the same time!
当然,vim file1 +xx file2 +xx ... 不行(+ 选项只影响第一个文件...别问我为什么)
Of course, vim file1 +xx file2 +xx ... won't work (the + option only affect first file ... don't ask me why)
所以如果有人知道解决这个问题的方法吗?我没有在联机帮助页中找到它...
So if anyone know a way to fix this? I didn't found it in the manpage...
顺便说一下,有时,file1 可能和 file2 是同一个文件...
By the way, sometimes, file1 maybe the same file as file2 ...
推荐答案
这里有一个方法:vim +6 file1 +"sp +3 file2"
.如果您更喜欢标签,请将 sp
更改为 tabnew
.
Here's a way : vim +6 file1 +"sp +3 file2"
.
Change sp
to tabnew
if you prefer tabs.
但只有有人可以用它制作脚本,它才会真正有用......
But it would be really useful only if someone could make a script with it...
这篇关于Vim:在不同行上打开多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!