3月 212012
 

在指定文件中找关键字:
:vimgrep keyword file

在指定目录下找关键字:
:vimgrep keyword **

在指定目录下的php文件中找关键字:
:vimgrep keyword **/*.php

查找所有匹配的关键字:
:vimgrep /keyword/g **/*.php

——————————————
:vimgrep 是vim来实现的,内置的,跨平台的搜索工具,但是效率上是差一些的,但是有很好的正则的支持
:grep 是外部工具

还有专门用来搜索的vim插件:http://www.vim.org/scripts/script.php?script_id=311

 Posted by at 上午 6:07

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据