VIM快速“在文件中查找”?

[英]Fast 'Find in Files' for VIM?


What are some options for getting really fast 'Find in Files' searching in VIM?

有什么选择可以在VIM中快速搜索“在文件中查找”?

Our codebase is large enough that searching needs to work off an index. grep/vimgrep/etc are too slow.

我们的代码库足够大,搜索需要处理索引。 grep / vimgrep / etc太慢了。

Indexing doesn't need to be particularly fast; I can index overnight.

索引不需要特别快;我可以一夜之间索引。

Thanks,

[EDIT] I'm also working in a Windows environment.

[编辑]我也在Windows环境中工作。

6 个解决方案

#1


If it's source code (rather than full text search), then ctags with the TagList plugin should work well for your needs. See, for example:

如果是源代码(而不是全文搜索),则使用TagList插件的ctags应该可以很好地满足您的需求。例如,见:

http://www.thegeekstuff.com/2009/04/ctags-taglist-vi-vim-editor-as-sourece-code-browser/

EDIT: TagList and ctags will work on Windows as well (that's what I use). See the TagList install page and FAQ. The following links might prove useful:

编辑:TagList和ctags也适用于Windows(这就是我使用的)。请参阅TagList安装页面和FAQ。以下链接可能有用:

There's also a TagList forum where you can get further help:

还有一个TagList论坛,您可以在这里获得进一步的帮助:

http://tech.groups.yahoo.com/group/taglist/

I set it up on my windows machine a while back, but I don't remember encountering any problems.

我暂时将它设置在我的Windows机器上,但我不记得遇到任何问题。

#2


Something that I use, but not through vim, is ack: http://betterthangrep.com/

我使用的东西,但不是通过vim,是ack:http://betterthangrep.com/

It is a perl based tool, and it should be usable in Windows.

它是一个基于perl的工具,它应该可以在Windows中使用。

#3


If you're working with a large codebase, then it might be time to look for a more powerful solution than conventional tools. OpenGrok is a very fast source code search and cross-reference engine. On top of its great performance, it integrates with Subversion, Mercurial, and ClearCase, among other source revision control software. It sounds a lot like something you could use.

如果您正在使用大型代码库,那么可能是时候寻找比传统工具更强大的解决方案了。 OpenGrok是一个非常快速的源代码搜索和交叉引用引擎。除了出色的性能外,它还集成了Subversion,Mercurial和ClearCase等源代码修订控制软件。这听起来很像你可以使用的东西。

If you want support to use OpenGrok from within Vim, you could easily write a vim function that would call system() to start the search for you. To read more about writing new vim commands, look up :help 40.2 within vim.

如果您希望支持在Vim中使用OpenGrok,您可以轻松编写一个调用system()来启动搜索的vim函数。要阅读有关编写新vim命令的更多信息,请在vim中查找:help 40.2。

I hope that's what you were looking for.

我希望这就是你要找的东西。

#4


I don't know how I found this, but looks like someone has written a plugin for google desktop

我不知道我是如何找到这个的,但看起来有人为谷歌桌面编写了一个插件

#5


Try to install https://github.com/mileszs/ack.vim, http://beyondgrep.com/ ,

尝试安装https://github.com/mileszs/ack.vim,http://beyondgrep.com/,

then make a link

然后建立一个链接

ln -s /usr/bin/ack-grep /usr/bin/ack 

and add

noremap <C-f> :copen<CR>:Ack -aQi --ignore-dir someignoringdir

to your .vimrc, after you can find in files through Ctrl+F, enjoy

到你的.vimrc后,你可以通过Ctrl + F找到文件,享受

_   /|
\'o.O'
=(___)=
   U  

#6


You can try this

你可以试试这个

:vimgrep /something/ */

:vimgrep / something / * /

and dont forget to open search result window after

并且不要忘记之后打开搜索结果窗口

:cw

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2009/07/07/54cecfd378dd5f4c7b874fdee5935dc1.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告