From cf8dbf804769fd41bea6982a9c17dda3b74fb106 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 28 Mar 2014 17:15:32 +0900 Subject: Allow setting tmux split height in % --- plugin/fzf.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'plugin') diff --git a/plugin/fzf.vim b/plugin/fzf.vim index ba0d0b33..c1b68cef 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -22,7 +22,7 @@ " WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. let s:min_tmux_height = 3 -let s:default_tmux_height = 15 +let s:default_tmux_height = '40%' let s:cpo_save = &cpo set cpo&vim @@ -114,7 +114,17 @@ function! s:execute_tmux(dict, command, temps) else let command = a:command endif - let height = a:dict.tmux + + if type(a:dict.tmux) == 1 + if a:dict.tmux =~ '%$' + let height = screenrow() * str2nr(a:dict.tmux[0:-2]) / 100 + else + let height = str2nr(a:dict.tmux) + endif + else + let height = a:dict.tmux + endif + let s:pane = substitute( \ system( \ printf( -- cgit v1.2.3