vim-ripgrep icon indicating copy to clipboard operation
vim-ripgrep copied to clipboard

:Rg command not working in NeoVim on Windows 10

Open AaronM04 opened this issue 6 years ago • 11 comments

Hi,

I have a problem where any search string supplied to the :Rg command will result in No match found for <search>. I installed ripgrep with cargo install ripgrep and I installed NeoVim v0.3.2-6-g5ff90a100 via choco install neovim. vim-ripgrep was installed with vim-plug.

I attempted to debug it by running let &grepprg = g:rg_command and then running :exe 'grep! ' . '<search>', which displayed:

!rg --vimgrep <search>  > C:\path\to\nvim\temp\file\1

shell returned 1

However, if I run this same command in cmd.exe and then check the return code with echo %errorlevel%, it shows 0.

Please let me know how I can fix this. Thanks! :)

AaronM04 avatar Jul 23 '18 22:07 AaronM04

I had the same problem in Neovim on MacOS, I rolled back vim-ripgrep plugin to commit 0df3ac2c3e51d27637251a5849f892c3a0f0bce0 which solved the problem.

I also had both version 0.8.1 and 0.9.0 of ripgrep installed in parallel so I uninstalled both and reinstalled 0.9.0, I don't think that was a part of the problem but it might have something to do with it might still be worth mentioning.

pean avatar Aug 16 '18 08:08 pean

@pean thanks for the tip. Unfortunately rolling back to that commit didn't help me. I also tried upgrading ripgrep from 0.8.1 to 0.9.0 but that didn't help me either.

AaronM04 avatar Aug 17 '18 23:08 AaronM04

I was slowly upgrading so only hit this last week, but definitely having the same result. Took my a while to figure this out as well as I legit thought for a while, that there just were "no results".

hojberg avatar Sep 04 '18 13:09 hojberg

Facing the same problem on vim v8.0.1453, rg v0.10.0, ubuntu 18.04.

jarun avatar Oct 19 '18 03:10 jarun

Same problem here on vim v8.1.1050, rg v0.10.0, macOS 10.14.4. Rolling back to https://github.com/jremmen/vim-ripgrep/commit/0df3ac2c3e51d27637251a5849f892c3a0f0bce0 as @pean suggested fixes it

OskarPersson avatar Apr 01 '19 11:04 OskarPersson

Did anyone find a solution to this? Rolling back the commit above also didn't work for me. Everything is working just fine on OSX 10.13.6 (my laptop) but not 10.14.4 (my desktop) for some reason.

nvim v0.3.8 | osx 10.14.4 | rg 11.0.2 | iterm 3.3.3

sntk avatar Sep 10 '19 21:09 sntk

zsh:1: command not found: rg vim 8.1.1401 zsh on linux

ahillio avatar Dec 25 '20 22:12 ahillio

I've just hit this issue myself. Any suggestions?

PhilT avatar Feb 27 '21 21:02 PhilT

Here's a one-liner I put together that removes the need for vim-ripgrep if your needs are simple.

It allows you to:

  • Run Rg <pattern> - Search for the specified pattern, jumping to first occurrence and opening the quickfix window
  • Run Rg - Search for the word under the cursor, jumping to first occurrence and opening the quickfix window

It requires that rg is in your path.

command! -nargs=* Rg :cexpr system('rg --vimgrep '.('<args>' == '' ? expand('<cword>') : '<args>'))|:copen

It'll still open the quickfix window when no search results but it does the job.

I hope someone finds it useful.

PhilT avatar Feb 28 '21 17:02 PhilT

zsh:1: command not found: rg vim 8.1.1401 zsh on linux

I had a similar problem "/bin/bash : rg: command not found" when using ":Rg" in vim. As it suggests, i just had to install ripgrep in my terminal with " sudo apt install ripgrep ". At the moment wasn't obvious for me, so I leave it here if someone needs it.

Carlos-918 avatar Dec 28 '21 19:12 Carlos-918

https://github.com/duane9/nvim-rg seems to do most of what I wanted from this repo. Doesn't have result highlighting in search results though!

tankorsmash avatar Jan 09 '24 22:01 tankorsmash