Questions tagged [grep]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
55 views

grep in my specific dictionary

I often need to make a case-insensitive search of the current word (under cursor) in a dictionary file which has a simple txt format, one entry per line. One possible solution is to record a macro in ...
-1
votes
1answer
24 views

Neovim - vim-grepper shows no result

I use Vim daily and use vim-grepper (https://github.com/mhinz/vim-grepper) as my grep plugin. But since last week, it doesn't work anymore and every request I do result in... nothing found. I tried to ...
0
votes
2answers
59 views

Find the specific line with character in specific position

Finding the line with a specific character before the last character. Suppose, I have the following string 1. addar_ctrl1,1,2,0,0,1 2. addar_ctrl2,3,2,0,1,0 3. addar_ctrl3,4,8,0,0,0 4. addar_ctrl4,2,6,...
1
vote
1answer
83 views

How to use read instead of execute in a function?

I'm trying to search for the selected line of a file using the following: function! GrepSelection() normal! gvy let result = escape(@", '\\/.*$^~[]#') let result = substitute(result, &...
0
votes
1answer
84 views

How to open a command in a split window?

I'm using grep in vim to do something such as: :grep pattern file and have a key-map for it that looks like that: function! Escaped() call inputsave() let result = escape(@", '\\/.*$^~[]#...
0
votes
1answer
57 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
2answers
339 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
94 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
48 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
100 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 ...
1
vote
2answers
2k 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
71 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()...