Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:Rg command not working in NeoVim on Windows 10 #26

Open
AaronM04 opened this issue Jul 23, 2018 · 11 comments
Open

:Rg command not working in NeoVim on Windows 10 #26

AaronM04 opened this issue Jul 23, 2018 · 11 comments

Comments

@AaronM04
Copy link

AaronM04 commented Jul 23, 2018

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! :)

@pean
Copy link

pean commented Aug 16, 2018

I had the same problem in Neovim on MacOS, I rolled back vim-ripgrep plugin to commit 0df3ac2 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.

@AaronM04
Copy link
Author

@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.

@hojberg
Copy link

hojberg commented Sep 4, 2018

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".

@jarun
Copy link

jarun commented Oct 19, 2018

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

@OskarPersson
Copy link

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

@sntk
Copy link

sntk commented Sep 10, 2019

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

@ahillio
Copy link

ahillio commented Dec 25, 2020

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

@PhilT
Copy link

PhilT commented Feb 27, 2021

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

@PhilT
Copy link

PhilT commented Feb 28, 2021

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.

@Carlos-918
Copy link

Carlos-918 commented Dec 28, 2021

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.

@tankorsmash
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants