summaryrefslogtreecommitdiff
path: root/plugin/fzf.vim
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-03-28 17:15:32 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-03-28 17:15:45 +0900
commitcf8dbf804769fd41bea6982a9c17dda3b74fb106 (patch)
tree172c96688097b8081ddda2784b9262385a519667 /plugin/fzf.vim
parent995d38020016ee1074a6d4ab2fa7f6ce29faf8ff (diff)
downloadfzf-cf8dbf804769fd41bea6982a9c17dda3b74fb106.tar.gz
Allow setting tmux split height in %
Diffstat (limited to 'plugin/fzf.vim')
-rw-r--r--plugin/fzf.vim14
1 files changed, 12 insertions, 2 deletions
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(