diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-07-21 01:46:45 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-07-21 01:47:08 +0900 |
commit | a7c9c08371d27b550f3896ab554f6490871a7a0a (patch) | |
tree | a69114f063541b73fd2955a3fb231af23fbaed36 /plugin | |
parent | fccc93176bbad6658324ffe121775dc2e0d66c07 (diff) |
[vim] Make :FZF command configurable with g:fzf_layout
To make it consistent with the other commands in fzf.vim
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/fzf.vim | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 76d9cfa9..668af7d5 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -21,7 +21,7 @@ " OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION " WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -let s:default_height = '40%' +let s:default_layout = { 'down': '~40%' } let s:fzf_go = expand('<sfile>:h:h').'/bin/fzf' let s:install = expand('<sfile>:h:h').'/install' let s:installed = 0 @@ -481,7 +481,12 @@ function! s:cmd(bang, ...) abort let opts.dir = substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g') endif if !a:bang - let opts.down = get(g:, 'fzf_height', get(g:, 'fzf_tmux_height', s:default_height)) + " For backward compatibility + if !exists('g:fzf_layout') && exists('g:fzf_height') + let opts.down = g:fzf_height + else + let opts = extend(opts, get(g:, 'fzf_layout', s:default_layout)) + endif endif call fzf#run(extend({'options': join(args), 'sink*': function('<sid>cmd_callback')}, opts)) endfunction |