Open PhantomCloak opened 1 year ago
man fzf
Preview window does not show the line correctly when used with '--delimiter', '/', '--with-nth', '-2..']
'--delimiter', '/', '--with-nth', '-2..']
Wrap or shorten long path names so matches can be more readable
example:
I used base confing from advanced ripgrep integration then according to this issue https://github.com/junegunn/fzf.vim/issues/741 I add '--delimiter', '/', '--with-nth', '-2..'] to my config that looks like
command! -bang -nargs=* Rg \ call fzf#vim#grep( \ 'rg --column --line-number --no-heading --color=never --smart-case '.shellescape(<q-args>), 1, \ fzf#vim#with_preview(), <bang>0) function! RipgrepFzf(query, fullscreen) let command_fmt = 'rg -g "*.yml" -g "*.cs" -g "*.cpp" -g "*.h" --column --line-number --no-heading --color=always --smart-case %s | sed "s/ \{1,\}/ /g" || true' let initial_command = printf(command_fmt, shellescape(a:query)) let reload_command = printf(command_fmt, '{q}') let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command, '--delimiter', '/', '--with-nth', '-2..']} call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen) endfunction command! -nargs=* -bang RG call RipgrepFzf(<q-args>, <bang>0) ]])
After that issue looks like this instead showing the line that words placed in it only shows beginning of the file
man fzf
)Issue
Preview window does not show the line correctly when used with
'--delimiter', '/', '--with-nth', '-2..']
What I try to achieve
Wrap or shorten long path names so matches can be more readable
example:
What I tried
I used base confing from advanced ripgrep integration then according to this issue https://github.com/junegunn/fzf.vim/issues/741 I add
'--delimiter', '/', '--with-nth', '-2..']
to my config that looks likeAfter that issue looks like this instead showing the line that words placed in it only shows beginning of the file