junegunn / fzf.vim

fzf :heart: vim
MIT License
9.51k stars 581 forks source link

Add option to use location list instead of quickfix list #1500

Closed nkouevda closed 10 months ago

nkouevda commented 10 months ago

Fixes #432, fixes #448.

Feel free to close this if you don't want it; I see the readme says this repo is "not designed to be flexible or configurable", so totally understandable.

junegunn commented 10 months ago

You might want to check out #846.

Can you explain why you want to (have to) use the location list instead of the quickfix list?

nkouevda commented 10 months ago

Partially habit / convenience / consistency; I'm used to using location lists instead of the quickfix list, and navigating items with vim-unimpaired's [l / ]l instead of [q / ]q. e.g. I use your s:build_quickfix_list example, but using location list instead. (But as you explained that doesn't work for :Rg, which is how I ended up here.)

And in terms of functionality, this allows having multiple lists, e.g. I have wanted to search for different things in different windows, and to iterate through the results separately.

But admittedly (1) is entirely subjective, and (2) is not a particularly common use case in my experience.

junegunn commented 10 months ago

Thanks for the clarification.

this allows having multiple lists

If that's the case, we should probably provide a way to use a different list type per command. I'll see what I can do.

junegunn commented 10 months ago

See 832a090870a79d8be87d8856c821806512a45b23.

It's a pretty big change, so please give it a try and let me know how it works.

let g:fzf_vim = {}
let g:fzf_vim.listproc = { list -> fzf#vim#listproc#location(list) }
nkouevda commented 10 months ago

Works great; thank you!

I don't use preview_bash, but noticed that needs a little fix: #1502