几个vim问题
所以我希望一些老派的 Vim'ers 能够帮助我。 这些都是单独的问题,通常我会把它们单独提出,但我不确定这是否符合这里的问题。
另外,我认为如果您了解得足够多,可以提出这些问题,那么它们都会在不久的将来出现:
- 我正在编写一个库以及一系列使用该库的应用程序。 似乎没有一种简单的方法(据我所知)为库构建一个 ctags 文件 并为我的每个应用程序构建一个文件,并确保当我“时一个引用另一个”我在 vim 中。
- 使用 gf 从命令模式打开文件非常棒,但是我的很多包含文件 不包含完整路径。 它们引用了我在 IDE 中设置的包含目录。 如何将此目录设置为 Vim 开始查找文件的另一个点?
- 有没有办法在 Vim 中编译文件并将输出发送到缓冲区? 我目前正在使用 MSVS 2k3,但几周后我将移植到 Linux,因此如果这在任一系统上可行,我将不胜感激。
So I was hoping that some old school Vim'ers could help me out. These are all separate questions and normally I would put them up each on their own but I'm not sure if that qualifies as question whoring here.
Plus I think if you know enough to be asking any of these questions they will all be coming up in the near future:
- I have a library I'm writing and a series of applications that use that library. There doesn't seem to be an easy way(from what I can tell) to build a ctags file for the library and build one for each of my applications and make sure one references the other when I'm in vim.
- Using gf to open files from command mode is awesome, but a lot of my include files
don't contain the full path. They refer to an include directory I set in the IDE. How can I set this directory as another point for Vim to start looking for files? - Is there a way to compile a file inside Vim and send the output to a buffer? I'm currently using MSVS 2k3 but I'll be porting over to Linux in a few weeks so if this is possible on either system I'd appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
回复 3)
如果你将 makefile 放在根目录中,你可以简单地写
:make
这将运行 make 并 (iirc) 将任何错误放入单独的缓冲区中,并使 vim 转到第一个编译错误。 从那里您可以使用 :next-error 导航所有错误行
另外,请参阅此页面
http://wiki.beyondunreal.com/Legacy:Vim
和
http://linux.byexamples.com/archives /287/perform-grep-and-make-in-vim/
了解如何在单独的控制台中显示结果的详细信息。
Re 3)
If you put a makefile in your root dir, you can simply write
:make
This will run make and (iirc) put any errors into a seperate buffer, and make vim goto the first compile error. From there you can navigate all erroring lines using :next-error
Also, see this page
http://wiki.beyondunreal.com/Legacy:Vim
and
http://linux.byexamples.com/archives/287/perform-grep-and-make-in-vim/
for details on how to show the result in a seperate console.
1-标签文件是独立的,可以一起使用。 请参阅
:h 'tags'
我不知道构建标签文件的简单方法是什么。 我有一个包含使用我的两个插件的插件:
2-
:h 'path
'3-
:h :make
HTH。
1- tags files are independent, and can be used together. See
:h 'tags'
I can't tell what is the easy way to build tags files. I have one that consists in using two plugins of mine:
2-
:h 'path
'3-
:h :make
HTH.
2)
寻求帮助:
其他一些如
:lcd
可能更适合。 只需向下滚动该帮助页面即可。2)
For help:
A few others like
:lcd
might be better suited. Just scroll down that help page.这是相当偏离主题的,但可能仍然有用:如果您经常使用 Visual Studio 并且喜欢 Vim,您可能需要查看 ViEmu。 这是我所见过的最好的 Vim 仿真 IDE,而且成本非常低。 :) 不,我没有得到佣金。 :P
This is rather off topic, but might still be useful: if you're using Visual Studio a lot and like Vim, you might want to look at ViEmu. It's the best Vim-emulation for any IDE I've yet seen, and the cost is really low. :) And no, I'm not getting a commission. :P
这并不明显,但如果您打开目录而不是文件,则可以很好地浏览。
例如
:e。 (冒号-e-点)
:e ..(冒号-e-点-点)
将允许您从当前目录或其父目录进行浏览。
(了解您可能希望能够让 vim 接受例如
:e abc.txt
并让它在多个目录中查找,我不知道该怎么做。)
It's not obvious, but if you open a directory instead of a file, it's nicely browseable.
e.g.
:e . (colon-e-dot)
:e .. (colon-e-dot-dot)
will let you browse from your current directory or its parent.
(understanding that you were probably hoping for a capability to have vim accept e.g.
:e abc.txt
and have it look in several directories, which I don't know how to do.)