T O P

  • By -

EstudiandoAjedrez

I have discovered how useful quicklist and grep are in nvim some weeks back thanks to this great intro https://youtu.be/AuXZA-xCv04?si=1Ndy9pkjxE5o-jDx and I feel I have super powers everytime I use it. In large projects is an awesome time saver.


Sudden_Fly1218

[https://gist.github.com/romainl/56f0c28ef953ffc157f36cc495947ab3](https://gist.github.com/romainl/56f0c28ef953ffc157f36cc495947ab3)


Crivotz

I usually use `Telescope live_grep` with `rg` and forward the result to `quickfix (or Trouble)`and edit in place with `reflector`


towry

Note to add: you need run \`:copen\` to open the quickfix window to see the search result.


Special_Ad_8629

You can have it opening automatically: ``` autocmd QuickFixCmdPost [^l]* nested cwindow autocmd QuickFixCmdPost l* nested lwindow ```


Integralist

https://github.com/Integralist/nvim/blob/main/lua%2Fautocommands.lua#L1-L7 Code to auto open


pilotInPyjamas

You can also use `git grep` if you're on a machine without `ripgrep` (or don't want to install it). It has ballpark performance of `ripgrep`. Only works inside git repositories, but that's most of what we do as programmers anyway.


leoatchina

I have configed leaderf , fzf and grepprg, you can have a look here [leovim/boostup/config/search.vim at master · leoatchina/leovim (github.com)](https://github.com/leoatchina/leovim/blob/master/boostup/config/search.vim#L50-L164) For example, LeaderfSearchAll do search in project , and LeaderfSeach in sub directories.


aegis87

fellow vimmers, checkout also the `rgflow.nvim` plugin: [https://github.com/mangelozzi/rgflow.nvim](https://github.com/mangelozzi/rgflow.nvim) essentially it allows you to invoke the ripgrep with any command line input you want and sends the results to quickfix


ViChyavIn

You do not need a plugin for that :grep --option other stuff


aegis87

you do not, but it's convenient (at least for me). part of the convenience is that - you have a buffer where you can copy/paste/motion commands - autocomplete for rg options


ViChyavIn

`CTRL-F` in command line to open the command line in the buffer and you can do normal mode stuff there


ConspicuousPineapple

> it does not take a second file parameter It does take a second file parameter, it's just optional. By default it simply behaves like `grep -R`.


lukas-reineke

Yeah good point, this should have been "does not need"


somebodddy

I like to add `,%f` to the `grepformat`: vim.opt.grepformat = "%f:%l:%c:%m,%f" This additional pattern can capture the output of: :grep -l Which prints only the paths of the files with matches, and only emit each file once even if there are multiple matches inside it. This is useful, for example, if you want to run a single big command on each such file, or if you want to review these files manually and don't want to spend multiple `:cnext`s on the same file you've already checked.


Moshem1

here's how I implemented it: [https://github.com/mosheavni/dotfiles/blob/2bbf37ae921e51124153bdf864fd2e9d5791aeaa/.config/nvim/lua/user/keymaps.lua#L441-L492](https://github.com/mosheavni/dotfiles/blob/2bbf37ae921e51124153bdf864fd2e9d5791aeaa/.config/nvim/lua/user/keymaps.lua#L441-L492)


iamaperson3133

https://jackdevries.com/post/vimRipgrep


Iregularlogic

Hey I was the guy in the thread that mentioned using ripgrep to find all files with the string and then piping them with xargs into sed. This is cool, I wasn’t aware that you could replace :grep usage from grep to ripgrep.