mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-07 05:04:30 +08:00
Show how to set up fzf#vim#files with fzf#vim#with_preview
This commit is contained in:
10
README.md
10
README.md
@@ -133,12 +133,6 @@ let g:fzf_history_dir = '~/.local/share/fzf-history'
|
||||
#### Command-local options
|
||||
|
||||
```vim
|
||||
" [Files] Extra options for fzf
|
||||
" e.g. File preview using Highlight
|
||||
" (http://www.andre-simon.de/doku/highlight/en/highlight.html)
|
||||
let g:fzf_files_options =
|
||||
\ '--preview "(highlight -O ansi {} || cat {}) 2> /dev/null | head -'.&lines.'"'
|
||||
|
||||
" [Buffers] Jump to the existing window if possible
|
||||
let g:fzf_buffers_jump = 1
|
||||
|
||||
@@ -187,6 +181,10 @@ command! -bang -nargs=* Rg
|
||||
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
||||
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
||||
\ <bang>0)
|
||||
|
||||
" Likewise, Files command with preview window
|
||||
command! -bang -nargs=? -complete=dir Files
|
||||
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
|
||||
```
|
||||
|
||||
Mappings
|
||||
|
||||
@@ -160,11 +160,6 @@ Global options~
|
||||
Command-local options~
|
||||
|
||||
>
|
||||
" [Files] Extra options for fzf
|
||||
" e.g. File preview using coderay (http://coderay.rubychan.de/)
|
||||
let g:fzf_files_options =
|
||||
\ '--preview "(coderay {} || cat {}) 2> /dev/null | head -'.&lines.'"'
|
||||
|
||||
" [Buffers] Jump to the existing window if possible
|
||||
let g:fzf_buffers_jump = 1
|
||||
|
||||
@@ -212,6 +207,10 @@ You can use autoload functions to define your own commands.
|
||||
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
||||
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
||||
\ <bang>0)
|
||||
|
||||
" Likewise, Files command with preview window
|
||||
command! -bang -nargs=? -complete=dir Files
|
||||
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
|
||||
<
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user