diff --git a/README.md b/README.md index a3aa740..dbeb900 100644 --- a/README.md +++ b/README.md @@ -121,11 +121,12 @@ behavior with `g:fzf_preview_window`. Here are some examples: " - 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-/'] +let g:fzf_preview_window = ['right,50%', 'ctrl-/'] -" 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-/'] +" Preview window is hidden by default. You can toggle it with ctrl-/. +" It will show on the right with 50% width, but if the width is smaller +" than 70 columns, it will show above the candidate list +let g:fzf_preview_window = ['hidden,right,50%,<70(up,40%)', 'ctrl-/'] " Empty value to disable preview window altogether let g:fzf_preview_window = [] diff --git a/doc/fzf-vim.txt b/doc/fzf-vim.txt index a04a17b..188abd0 100644 --- a/doc/fzf-vim.txt +++ b/doc/fzf-vim.txt @@ -186,11 +186,12 @@ behavior with `g:fzf_preview_window`. Here are some examples: " - 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-/'] + let g:fzf_preview_window = ['right,50%', 'ctrl-/'] - " 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-/'] + " Preview window is hidden by default. You can toggle it with ctrl-/. + " It will show on the right with 50% width, but if the width is smaller + " than 70 columns, it will show above the candidate list + let g:fzf_preview_window = ['hidden,right,50%,<70(up,40%)', 'ctrl-/'] " Empty value to disable preview window altogether let g:fzf_preview_window = []