nvim-pack / nvim-spectre

Find the enemy and replace them with dark power.
MIT License
2.04k stars 70 forks source link

Having trouble using this plugin #212

Closed resistorsoftware closed 6 months ago

resistorsoftware commented 6 months ago

Never mind, Noticed the missing executable was ripgrep.

I am using Lazy and trying to use spectre, but I have trouble right off the hop using it. My current commit is 3712ff0cdf4f9f877d9ca708d835a877d9a0abaf . I also see I have plenary.nvim in my lockfile at branch: f7adfc4b3f4f91aab6caebf42b3682945fbc35be

I am using a very new Arch install and the LazyVim method of setting up NeoVim.

So these files are recent. What happens for me, is I hit leader-sr and Spectre pops up, not in insert mode, so I switch to insert mode and provide some text to search on. No results pop up. So essentially, nothing is happening. OK. So I hit esc and then I get a lot of error messages popping up, starting with the plenary plugin and plenary jobs.

I am not sure at all how to go about fixing this. I am really new to the NeoVim concept, and the lazyvim setup, and I have found little in the way of things I can do to identify exactly what is wrong, but it does seem to point to Spectre and Plenary together not working at this moment.

E5108: Error executing lua .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:107: rg: Executable not found
stack traceback:
    .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:107: in function 'new'
    ...share/nvim/lazy/nvim-spectre/lua/spectre/search/base.lua:122: in function 'search'
    ....local/share/nvim/lazy/nvim-spectre/lua/spectre/init.lua:610: in function 'search'
    ....local/share/nvim/lazy/nvim-spectre/lua/spectre/init.lua:329: in function 'on_search_change'
    [string ":lua"]:1: in main chunk
stack traceback:
    [C]: in function 'error'
    .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:107: in function 'new'
    ...share/nvim/lazy/nvim-spectre/lua/spectre/search/base.lua:122: in function 'search'
    ....local/share/nvim/lazy/nvim-spectre/lua/spectre/init.lua:610: in function 'search'
    ....local/share/nvim/lazy/nvim-spectre/lua/spectre/init.lua:329: in function 'on_search_change'
    [string ":lua"]:1: in main chunk
dmmulroy commented 6 months ago

How did you fix this?

resistorsoftware commented 6 months ago

I read the error message carefully. It was telling me an executable was not found. So I thought about that for a second. Aha! I need to install something. Sure enough, installed whatever plenary needed, fixed the issue. Turns out, naive me, I had no idea that this LazyVim approach does not hold your hand and install all the little Rust extras these neovim plugins depend on. Once I got all my little rusty things installed, me neovim functions without troubles. like this.

mairs8 commented 6 months ago

@resistorsoftware are you able to provide some more detail? i am getting exact same error. Did you just need to install the rg package?

mairs8 commented 6 months ago

i can confirm that i needed to add ripgrep.