README-VIM: g:fzf_action doesn't work with custom sink
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Fix https://github.com/junegunn/fzf.vim/issues/1131
authored by Junegunn Choi · committed by Junegunn Choi · parent 6c9adea · Browse files · 2 files·+47 added−18 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+47 added−18 removed
- other:+47 added−18 removed
Provenance
- Commit
305896f- Tree
b498fd4- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
6c9adea
2 files changed+47 added−18 removed
modified:doc/fzf.txt+28 added-13 removed
1-fzf.txt fzf Last change: April 4 20201+fzf.txt fzf Last change: October 18 20202 FZF - TABLE OF CONTENTS *fzf* *fzf-toc*3 ==============================================================================4 5 FZF Vim integration4 unmodified lines10 Examples11 Explanation of g:fzf_colors12 fzf#run13 fzf#wrap14+ Global options supported by fzf#wrap15 Tips16 fzf inside terminal buffer17 Starting fzf in a popup window18 Hide statusline86 unmodified lines105 106 " Bang version starts fzf in fullscreen mode107 :FZF!108 <108-Similarly to {ctrlp.vim}{2}, use enter key, CTRL-T, CTRL-X or CTRL-V to open109+Similarly to {ctrlp.vim}{3}, use enter key, CTRL-T, CTRL-X or CTRL-V to open110 selected files in the current window, in new tabs, in horizontal splits, or in111 vertical splits respectively.112 113 Note that the environment variables `FZF_DEFAULT_COMMAND` and114 `FZF_DEFAULT_OPTS` also apply here.115 115- {2} https://github.com/kien/ctrlp.vim116+ {3} https://github.com/kien/ctrlp.vim117 118 119 < Configuration >_____________________________________________________________~120 *fzf-configuration*33 unmodified lines154 \ 'ctrl-x': 'split',155 \ 'ctrl-v': 'vsplit' }156 157 " Default fzf layout157- " - down / up / left / right / window158- let g:fzf_layout = { 'down': '~40%' }158+ " - Popup window159 let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }160 161- " You can set up fzf window using a Vim command (Neovim or latest Vim 8 required)161+ " - down / up / left / right162+ let g:fzf_layout = { 'down': '40%' }163+164+ " - Window using a Vim command165 let g:fzf_layout = { 'window': 'enew' }166 let g:fzf_layout = { 'window': '-tabnew' }167 let g:fzf_layout = { 'window': '10new' }168 180 unmodified lines349 After we "wrap" our spec, we pass it to `fzf#run`.350 >351 call fzf#run(fzf#wrap({'source': 'ls'}))352 <350-Now it supports CTRL-T, CTRL-V, and CTRL-X key bindings and it opens fzf351-window according to `g:fzf_layout` setting.353+Now it supports CTRL-T, CTRL-V, and CTRL-X key bindings (configurable via354+`g:fzf_action`) and it opens fzf window according to `g:fzf_layout` setting.355 356 To make it easier to use, let's define `LS` command.357 >358 command! LS call fzf#run(fzf#wrap({'source': 'ls'}))21 unmodified lines380 command! -bang -complete=dir -nargs=* LS381 \ call fzf#run(fzf#wrap('ls', {'source': 'ls', 'dir': <q-args>}, <bang>0))382 <383 384+< Global options supported by fzf#wrap >______________________________________~385+ *fzf-global-options-supported-by-fzf#wrap*386+387+ - `g:fzf_layout`388+ - `g:fzf_action`389+ - Works only when no custom `sink` (or `sink*`) is provided390+ - Having custom sink usually means that each entry is not an ordinary391+ file path (e.g. name of color scheme), so we can't blindly apply the392+ same strategy (i.e. `tabedit some-color-scheme` doesn't make sense)393+ - `g:fzf_colors`394+ - `g:fzf_history_dir`395+396+397 TIPS *fzf-tips*398 ==============================================================================399 400 12 unmodified lines413 Starting fzf in a popup window~414 *fzf-starting-fzf-in-a-popup-window*415 >416 " Required:401- " - width [float range [0 ~ 1]]402- " - height [float range [0 ~ 1]]417+ " - width [float range [0 ~ 1]] or [integer range [8 ~ ]]418+ " - height [float range [0 ~ 1]] or [integer range [4 ~ ]]419 "420 " Optional:421 " - xoffset [float default 0.5 range [0 ~ 1]]422 " - yoffset [float default 0.5 range [0 ~ 1]]19 unmodified lines442 When fzf starts in a terminal buffer, the file type of the buffer is set to443 `fzf`. So you can set up `FileType fzf` autocmd to customize the settings of444 the window.445 430-For example, if you use a non-popup layout (e.g. `{'down': '40%'}`) on431-Neovim, you might want to temporarily disable the statusline for a cleaner432-look.446+For example, if you use a non-popup layout (e.g. `{'down': '40%'}`) on Neovim,447+you might want to temporarily disable the statusline for a cleaner look.448 >449 if has('nvim') && !exists('g:fzf_layout')450 autocmd! FileType fzf451 autocmd FileType fzf set laststatus=0 noshowmode noruler13 unmodified linesmodified:README-VIM.md+19 added-5 removed
125 unmodified lines126 \ 'ctrl-x': 'split',127 \ 'ctrl-v': 'vsplit' }128 129 " Default fzf layout130-" - down / up / left / right / window131-let g:fzf_layout = { 'down': '40%' }130+" - Popup window131 let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }132 134-" You can set up fzf window using a Vim command (Neovim or latest Vim 8 required)133+" - down / up / left / right134+let g:fzf_layout = { 'down': '40%' }135+136+" - Window using a Vim command137 let g:fzf_layout = { 'window': 'enew' }138 let g:fzf_layout = { 'window': '-tabnew' }139 let g:fzf_layout = { 'window': '10new' }140 192 unmodified lines333 ```vim334 call fzf#run(fzf#wrap({'source': 'ls'}))335 ```336 335-Now it supports `CTRL-T`, `CTRL-V`, and `CTRL-X` key bindings and it opens fzf336-window according to `g:fzf_layout` setting.337+Now it supports `CTRL-T`, `CTRL-V`, and `CTRL-X` key bindings (configurable338+via `g:fzf_action`) and it opens fzf window according to `g:fzf_layout`339+setting.340 341 To make it easier to use, let's define `LS` command.342 343 ```vim28 unmodified lines372 command! -bang -complete=dir -nargs=* LS373 \ call fzf#run(fzf#wrap('ls', {'source': 'ls', 'dir': <q-args>}, <bang>0))374 ```375 376+### Global options supported by `fzf#wrap`377+378+- `g:fzf_layout`379+- `g:fzf_action`380+ - **Works only when no custom `sink` (or `sink*`) is provided**381+ - Having custom sink usually means that each entry is not an ordinary382+ file path (e.g. name of color scheme), so we can't blindly apply the383+ same strategy (i.e. `tabedit some-color-scheme` doesn't make sense)384+- `g:fzf_colors`385+- `g:fzf_history_dir`386+387 Tips388 ----389 390 ### fzf inside terminal buffer60 unmodified lines