diff options
author | Kassio Borges <kassioborgesm@gmail.com> | 2017-01-31 16:06:52 +0000 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-02-01 01:06:52 +0900 |
commit | 712b7b218815fe2368884515852327401311a215 (patch) | |
tree | 63eb2a9845b6c73585e43fd82bd4ebf8099086b2 /plugin | |
parent | 5b749e2d5c469f85ec7f77923829b5981c2a4ca6 (diff) |
[vim] Expose buffer variable with the current fzf setup (#828)
Exposing the `b:fzf` variable will be useful to get information about
which command is being executed on the current fzf window. With that,
now, it's possible to use the current command name on the statusline:
```viml
au User FzfStatusLine call <SID>fzf_statusline()
function! s:fzf_statusline()
let fzf_cmd_name = get(b:fzf, 'name', 'FZF')
let &l:statusline = '> '.fzf_cmd_name
endfunction
```
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/fzf.vim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 1cd6ff70..9473c442 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -201,6 +201,10 @@ function! fzf#wrap(...) endfor let [name, opts, bang] = args + if len(name) + let opts.name = name + end + " Layout: g:fzf_layout (and deprecated g:fzf_height) if bang for key in s:layout_keys @@ -521,6 +525,7 @@ function! s:execute_term(dict, command, temps) abort let winrest = winrestcmd() let pbuf = bufnr('') let [ppos, winopts] = s:split(a:dict) + let b:fzf = a:dict let fzf = { 'buf': bufnr(''), 'pbuf': pbuf, 'ppos': ppos, 'dict': a:dict, 'temps': a:temps, \ 'winopts': winopts, 'winrest': winrest, 'lines': &lines, \ 'columns': &columns, 'command': a:command } |