C++ 如何浏览当前在vim中打开的文件中包含的所有文件?
假设我在C++ 如何浏览当前在vim中打开的文件中包含的所有文件?,c++,vim,C++,Vim,假设我在vim中打开了以下.hpp文件: #pragma once #include "a.hpp" #include "b.hpp" #include "c.hpp" #include <boost/something.hpp> // some code #pragma一次 #包括“a.hpp” #包括“b.hpp” #包括“c.hpp” #包括 //一些代码 现在,让我们假设我想搜索任何包含的文件中出现的术语Token(可能也包括在它们包含的文件中)。我怎样才能轻松做到这一
vim
中打开了以下.hpp
文件:
#pragma once
#include "a.hpp"
#include "b.hpp"
#include "c.hpp"
#include <boost/something.hpp>
// some code
#pragma一次
#包括“a.hpp”
#包括“b.hpp”
#包括“c.hpp”
#包括
//一些代码
现在,让我们假设我想搜索任何包含的文件中出现的术语Token
(可能也包括在它们包含的文件中)。我怎样才能轻松做到这一点
我想跳过当前
vimpath
中无法定位的任何文件,例如,在这种情况下,我的路径中可能没有boost
,因此我希望它不要在boost/something.hpp
中搜索。请参见:帮助包括search
,了解自动搜索Vim中包含的文件的几种方法。对于简单的令牌搜索,[i
可能是最简单的解决方案。如果您需要一个完整的正则表达式,或者如果您没有将光标放在正则表达式上的标记,您可以使用:isearch
命令。您可以使用vim中提供的功能。特别是,这是搜索所有出现的标记所需的命令当光标位于该单词上时:
[I Display all lines that contain the keyword under the
cursor. Filenames and line numbers are displayed
for the found lines. The search starts at the
beginning of the file. {not in Vi}
要跳转到第一个引用,可以使用:
[<Tab>
是否也要在STD中搜索Token
?@NaCl仅当它位于路径中时,例如,如果我可以gf
文件,则它应该搜索该文件。
[ CTRL-I Jump to the first line that contains the keyword
under the cursor. The search starts at the beginning
of the file. Lines that look like a comment are
ignored (see 'comments' option). If a count is given,
the count'th matching line is jumped to, and comment
lines are not ignored. {not in Vi}