Questions tagged [grep]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
20 views

Given a set of patterns, list (in the quickfix window) the ocurrences in those files that contain all the patterns from a given directory

The context Given a {pattern}, I can list the ocurrences of {pattern} in all files from a {directory}, in the quickfix window with the following command :chdir {directory} :vimgrep /{pattern}/ **/* :...
0
votes
0answers
13 views

buffer gone blank after running execute grep [duplicate]

I'm trying to follow the one of the tutorials in learn vimscript the hard way. The command I'm trying to replicate is: :nnoremap <leader>g :silent execute "grep! -R " . shellescape(expand("<...
0
votes
2answers
66 views

Highlight results of :grep while in quickfix window

To my .vimrc I added a hook which automates entering the quickfix after :grep processing: autocmd QuickFixCmdPost [^l]* nested cwindow 20 Another thing I care about but can't achieve is automation ...
1
vote
2answers
44 views

How to get the number of the output of `vimgrep`

I wrote a vim-script function, which allows me to grep a keyword in my project. function! CustomGrep(...) if a:0 == 0 silent vimgrep <cword> **/*.h **/*.hpp **/*.c **/*.cpp else ...
0
votes
0answers
33 views

How to reload vim buffer

I built a cpp environment with YCM, EasyGrep and some other plugins. With YCM, I can jump to declaration/definition, with EasyGrep, I can grep a keyword easily. But I found something weird: Saying ...
2
votes
0answers
56 views

What is the green <92> that's in my file?

I have a file exported from some system, and in vi when I open the file, there's a green <92> in it when I open it up where an ' ought to be. It messed up my bash script and left a line that ...
0
votes
2answers
498 views

Prevent “Press ENTER or type command to continue” prompt after external command executes

I am using :grep to search for occurences of a string within a set of files: :grep rainbow *.txt This result is then shown in the terminal: doc1.txt:2:saw a rainbow today doc2.txt:17:it was not a ...
1
vote
1answer
53 views

Echoing a message when grep has no result

Is there a way echoing a message if grep has no result and getqflist() is empty? I've tried this, but it doesn't work: au QuickFixCmdPost grep call g:GrepPostActions() function! g:GrepPostActions()...