mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-08 05:24:47 +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
|
#### Command-local options
|
||||||
|
|
||||||
```vim
|
```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
|
" [Buffers] Jump to the existing window if possible
|
||||||
let g:fzf_buffers_jump = 1
|
let g:fzf_buffers_jump = 1
|
||||||
|
|
||||||
@@ -187,6 +181,10 @@ command! -bang -nargs=* Rg
|
|||||||
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
||||||
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
||||||
\ <bang>0)
|
\ <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
|
Mappings
|
||||||
|
|||||||
@@ -160,11 +160,6 @@ Global options~
|
|||||||
Command-local 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
|
" [Buffers] Jump to the existing window if possible
|
||||||
let g:fzf_buffers_jump = 1
|
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%')
|
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
||||||
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
||||||
\ <bang>0)
|
\ <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