Vim:打开Grep给出的代码匹配的文件? [英] Vim: open files of the matches on the lines given by Grep?

查看:191
本文介绍了Vim:打开Grep给出的代码匹配的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在命令行中使用grepping命令后自动获取Vim中结果的位置。是否有这样的功能?

I want to get automatically to the positions of the results in Vim after grepping, on command line. Is there such feature?

文件在Vim中以grep给出的行打开:

% grep --colour -n checkWordInFile *
SearchToUser.java:170:  public boolean checkWordInFile(String word, File file) {
SearchToUser.java~:17:  public boolean checkWordInFile(String word, File file) {
SearchToUser.java~:41:          if(checkWordInFile(word, f))


推荐答案

查看 Grep搜索工具与Vim的集成在Vim中找到文件。基本上vim提供了这些命令来搜索文件:

Have a look at "Grep search tools integration with Vim" and "Find in files within Vim". Basically vim provides these commands for searching files:

:grep
:lgrep
:vimgrep
:lvimgrep

这些文章提供了更多关于它们用法的信息。

The articles feature more information regarding their usage.

这篇关于Vim:打开Grep给出的代码匹配的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆