From 2f3225fc6042c16a507b44eedff2c948d535dd5b Mon Sep 17 00:00:00 2001 From: Miles Whittaker Date: Mon, 18 Aug 2014 23:12:22 -0400 Subject: [PATCH] User can now specify how plug window opens Using 'let g:plug_window = "topleft new"' or something similar, the user can specify how they would like the plug window to open. --- plug.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plug.vim b/plug.vim index b771e5c..f28be58 100644 --- a/plug.vim +++ b/plug.vim @@ -458,11 +458,16 @@ function! s:lastline(msg) return get(lines, -1, '') endfunction +function! s:new_window() + let window_cmd = get(g:, 'plug_window', 'vertical topleft new') + execute window_cmd +endfunction + function! s:prepare() if bufexists(s:plug_buf) let winnr = bufwinnr(s:plug_buf) if winnr < 0 - vertical topleft new + call s:new_window() execute 'buffer ' . s:plug_buf else execute winnr . 'wincmd w' @@ -470,7 +475,7 @@ function! s:prepare() setlocal modifiable silent %d _ else - vertical topleft new + call s:new_window() nnoremap q :if b:plug_preview==1pcendifq nnoremap R :silent! call retry() nnoremap D :PlugDiff