How to search files in a folder by content with VIM?
怪我咯
怪我咯 2017-05-16 16:42:54
0
5
971

vim can use regular expressions to search in a file. Is there a way to search for matching files in a folder?

怪我咯
怪我咯

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

reply all(5)
黄舟

You can refer to: http://vim.wikia.com/wiki/Find_in_fil...

给我你的怀抱

Recommended Grep.vim plug-in

http://www.vim.org/scripts/script.php...

After entering :Grep in the vim command line, the grep plug-in will prompt you to enter the keywords to be found, and then
For the file type you are looking for, press Enter to perform the search, and the search results will be listed in quickfix (note, vim and
Many external commands and plug-in interaction information will be presented in quickfix).

If you want to suddenly change the case, execute it

:Grep -i

If you want to search subdirectories recursively, execute it

:Grep -r

If you execute the :Grep command in a non-blank space, the grep plug-in will automatically search for the word currently under the cursor as a keyword

Separating line

grep.vim will open the quickfix window
:cwOpen the quickfix window:cw打开 quickfix 窗口
:q:qExit quickfix

Peter_Zhu

Yes. See details

:help grep
Peter_Zhu

Use ack

阿神

grep -rl

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template