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?
为情所困2017-05-16 16:42:37
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🎜漂亮男人2017-05-16 16:42:37
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. .
曾经蜡笔没有小新2017-05-16 16:42:37
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
我想大声告诉你2017-05-16 16:42:37
Recommend exVim
Searching for symbols is very convenient
For non-symbolic text (such as Chinese), use vimgrep
phpcn_u15822017-05-16 16:42:37
:set grepprg=ag