Update g:fzf_preview_window to be a list with optional toggle keys

- The default preview window option will be ['right', 'ctrl-/']
  regardless of screen width or <bang>
- This will also fix #1010
This commit is contained in:
Junegunn Choi
2020-10-22 16:58:43 +09:00
parent 0eb385065b
commit 44057cce0e
4 changed files with 51 additions and 30 deletions

View File

@@ -110,16 +110,23 @@ through [README-VIM][README-VIM] to learn more about them.
#### Preview window
If the width of the screen is wider than 120 columns, some commands will show
the preview window on the right. You can customize the behavior with
`g:fzf_preview_window`. Here are some examples:
Some commands will show the preview window on the right. You can customize the
behavior with `g:fzf_preview_window`. Here are some examples:
```vim
" Empty value to disable preview window altogether
let g:fzf_preview_window = ''
" This is the default option:
" - Preview window on the right with 50% width
" - CTRL-/ will toggle preview window.
" - Note that this array is passed as arguments to fzf#vim#with_preview function.
" - To learn more about preview window options, see `--preview-window` section of `man fzf`.
let g:fzf_preview_window = ['right:50%', 'ctrl-/']
" Always enable preview window on the right with 60% width
let g:fzf_preview_window = 'right:60%'
" Preview window on the upper side of the window with 40% height,
" hidden by default, ctrl-/ to toggle
let g:fzf_preview_window = ['up:40%:hidden', 'ctrl-/']
" Empty value to disable preview window altogether
let g:fzf_preview_window = []
```
### Command-local options