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

[fzf#vim#grep / Ag / Rg / RG] Multi-line display for narrow screens #1549

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

junegunn
Copy link
Owner

@junegunn junegunn commented Jun 6, 2024

Display PATH:LINE:COL on a separate line for narrow screens. Requires Perl and fzf 0.53.0 (not yet released).

Usage

" [Ag|Rg|RG] Display path on a separate line for narrow screens (default: 0)
" * Requires Perl and fzf 0.53.0 or later
let g:fzf_vim.grep_multi_line = 0
   " PATH:LINE:COL:LINE
let g:fzf_vim.grep_multi_line = 1
   " PATH:LINE:COL:
   " LINE
let g:fzf_vim.grep_multi_line = 2
   " PATH:LINE:COL:
   " LINE
   " (empty line)

Screenshots

let g:fzf_vim.grep_multi_line = 0

image

let g:fzf_vim.grep_multi_line = 1

image

let g:fzf_vim.grep_multi_line = 2

image

@junegunn junegunn self-assigned this Jun 6, 2024
@junegunn junegunn merged commit 279e1ec into master Jun 6, 2024
@junegunn junegunn deleted the grep_multi_line branch June 6, 2024 23:38
ibhagwan added a commit to ibhagwan/fzf-lua that referenced this pull request Jun 7, 2024
Credit to: junegunn/fzf.vim#1549

```lua
-- The default:
-- PATH:LINE:COL:TEXT
multiline = false or nil
-- PATH:LINE:COL
-- TEXT
multiline = true or 1
-- PATH:LINE:COL
-- TEXT
-- (empty line)
multiline = 2
```

Examples:
```lua
:FzfLua live_grep  multiline=2
:FzfLua lsp_finder  multiline=1
:lua require("fzf-lua").live_grep({  multiline = 2 })
:lua require("fzf-lua").lsp_finder({  multiline = 1 })
```
@amariusz
Copy link

amariusz commented Jul 4, 2024

I found this pull from link in the documentation - https://junegunn.github.io/fzf/releases/0.53.0/
Multi-line feature is such a great news!

BTW There's probably a typo in the description - should be g:fzf_grep_multi_line not g:fzf_vim.grep_multi_line

@junegunn
Copy link
Owner Author

junegunn commented Jul 4, 2024

No it's not a typo. While the former name is still supported for backward compatibility, we recommend putting all configs in g:fzf_vim dictionary.

See https://github.com/junegunn/fzf.vim?tab=readme-ov-file#configuration-options-for-fzfvim.

function! s:conf(name, default)
let conf = get(g:, 'fzf_vim', {})
return get(conf, a:name, get(g:, 'fzf_' . a:name, a:default))
endfunction

@amariusz
Copy link

amariusz commented Jul 4, 2024

Thanks for clarification. I've missed that change.
Can't wait for 0.54 with --wrap support.

You're amazing! Thank you so much for everything you do! Can't live without fzf anymore :D

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

Successfully merging this pull request may close these issues.

None yet

2 participants