How to search all files in a directory in vim
怪我咯
怪我咯 2017-05-16 16:40:37
0
5
761

You can use ctrl+shift+f in a general editor to conveniently search all files under a certain directory (or project). How to achieve this in vim?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(5)
为情所困

The simplest: :vimgrep /{pattern}/ /yourpath
Traverse the search results using:
:cprev[ious] Previous file :cprev[ious] 前一个文件
:cnext 下一个文件
:cfirst 第一个文件
:clast:cnext Next file

:cfirst First file 🎜 :clast The last file🎜
漂亮男人

Make it simple, install the plug-in. What you want is to search based on the file name. We recommend CtrlP, Command-T, FuzzFinder, Unite, etc. Start with CtrlP or CommandT. After you are familiar with it, you can try the more powerful Unite. .

曾经蜡笔没有小新

Find in files within Vim

For example, if I want to search for layout in the current directory, I only need:

:lvim /\<\(house\|home\)\>/gj *

Then use the following command to display the query results:

:lw

Screenshots are as follows:

You can also read this article: Search multiple files with :vimgrep

我想大声告诉你

Recommend exVim
Searching for symbols is very convenient
For non-symbolic text (such as Chinese), use vimgrep

as mentioned above
phpcn_u1582
  1. Install ag or ack
  2. Execute the following command in VIM :set grepprg=ag
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template