mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-28 02:43:50 -07:00
[vim] Add g:Fzf_launcher for funcrefs (#212)
This commit is contained in:
@@ -294,7 +294,8 @@ of the selected items.
|
|||||||
| `dir` | string | Working directory |
|
| `dir` | string | Working directory |
|
||||||
| `up`/`down`/`left`/`right` | number/string | Use tmux pane with the given size (e.g. `20`, `50%`) |
|
| `up`/`down`/`left`/`right` | number/string | Use tmux pane with the given size (e.g. `20`, `50%`) |
|
||||||
| `window` (*Neovim only*) | string | Command to open fzf window (e.g. `vertical aboveleft 30new`) |
|
| `window` (*Neovim only*) | string | Command to open fzf window (e.g. `vertical aboveleft 30new`) |
|
||||||
| `launcher` | string | External terminal emulator to start fzf with (Only used in GVim) |
|
| `launcher` | string | External terminal emulator to start fzf with (GVim only) |
|
||||||
|
| `launcher` | funcref | Function for generating `launcher` string (GVim only) |
|
||||||
|
|
||||||
_However on Neovim `fzf#run` is asynchronous and does not return values so you
|
_However on Neovim `fzf#run` is asynchronous and does not return values so you
|
||||||
should use `sink` or `sink*` to process the output from fzf._
|
should use `sink` or `sink*` to process the output from fzf._
|
||||||
|
@@ -206,8 +206,9 @@ function! s:execute(dict, command, temps)
|
|||||||
call s:pushd(a:dict)
|
call s:pushd(a:dict)
|
||||||
silent! !clear 2> /dev/null
|
silent! !clear 2> /dev/null
|
||||||
if has('gui_running')
|
if has('gui_running')
|
||||||
let launcher = get(a:dict, 'launcher', get(g:, 'fzf_launcher', s:launcher))
|
let Launcher = get(a:dict, 'launcher', get(g:, 'Fzf_launcher', get(g:, 'fzf_launcher', s:launcher)))
|
||||||
let command = printf(launcher, "'".substitute(a:command, "'", "'\"'\"'", 'g')."'")
|
let fmt = type(Launcher) == 2 ? call(Launcher, []) : Launcher
|
||||||
|
let command = printf(fmt, "'".substitute(a:command, "'", "'\"'\"'", 'g')."'")
|
||||||
else
|
else
|
||||||
let command = a:command
|
let command = a:command
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user