Closed ccshao closed 1 year ago
Given that you installed bat
, you can set $BAT_STYLE
to display the name of the file and add something like ~3
to --preview-window
option like so.
let $BAT_STYLE = 'header-filename,numbers,grid'
command! -bang -nargs=* ORg
\ call fzf#vim#grep(
\ 'rg --column --line-number --with-filename --no-heading --color=always --smart-case '
\ .shellescape(<q-args>), 1, fzf#vim#with_preview({'options': ['--preview-window', '+{2}-5,~3']},
\ 'right:50%', 'ctrl-/'), <bang>0)
Thanks very much for the quick solution!
man fzf
)I use the following snippets to search a particular folder.
It works quite nicely, however, when there are lots of match and file paths are long, I get lost on which files the match is found. How to set a sticky header at the top of preview window? Many thanks!