ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.83k stars 451 forks source link

lack lgrep #1199

Closed mjkx5 closed 3 months ago

mjkx5 commented 3 months ago

Feature description

when I input :lgrep in command model. It's like grep.

It's lgrep in help.

lgr[ep][!] [arguments] Same as ":grep", except the location list for the current window is used instead of the quickfix list.

Additional information

when I input grep !rg --hidden --vimgrep --smart-case -- 2>&1| tee /tmp/ when I input lgrep !rg --hidden --vimgrep --smart-case -- 2>&1| tee /tmp/

lgrep cannot search in local file, but in all file.

ayamir commented 3 months ago

If you want to search in current buffer, you should give the file path i.e. % as an argument like this: :lgrep core % image

mjkx5 commented 3 months ago

I understand that. It's weird. In that case, :grep and :lgrep are the same. :lgrep core % == :grep core %

mjkx5 commented 3 months ago

lgrep core == grep core

mjkx5 commented 3 months ago

It's indeedly solve my current problem. thanks.

Jint-lzxy commented 3 months ago

I'm going to close this issue as not planned to avoid further confusion. The only distinction between :lgrep and :grep lies in the storage location of the results. A location-list (or a window-local quickfix-list) is used for :lgrep while the quickfix-list is used for :grep. The search process itself remains identical for both (with results obtained using |grepprg|).