From 2c3c4a7776eb5810c6448a5ca5d29e4f0389b3cc Mon Sep 17 00:00:00 2001 From: petobens Date: Thu, 28 Aug 2014 09:34:33 -0300 Subject: [PATCH] Add 'context' value to g:UltiSnipsEditSplit --- autoload/UltiSnips.vim | 5 +++++ doc/UltiSnips.txt | 2 ++ 2 files changed, 7 insertions(+) diff --git a/autoload/UltiSnips.vim b/autoload/UltiSnips.vim index 5f18569..30b3849 100644 --- a/autoload/UltiSnips.vim +++ b/autoload/UltiSnips.vim @@ -64,6 +64,11 @@ function! UltiSnips#Edit(bang, ...) let mode = 'vs' elseif g:UltiSnipsEditSplit == 'horizontal' let mode = 'sp' + elseif g:UltiSnipsEditSplit == 'context' + let mode = 'vs' + if winwidth(0) <= 2 * (&tw ? &tw : 80) + let mode = 'sp' + endif endif endif exe ':'.mode.' '.file diff --git a/doc/UltiSnips.txt b/doc/UltiSnips.txt index 2b3d28c..6f3b4ca 100644 --- a/doc/UltiSnips.txt +++ b/doc/UltiSnips.txt @@ -180,6 +180,8 @@ g:UltiSnipsEditSplit Defines how the edit window is opened. Possible |normal| Default. Opens in the current window. |horizontal| Splits the window horizontally. |vertical| Splits the window vertically. + |context| Splits the window vertically or + horizontally depending on context. *g:UltiSnipsSnippetsDir* g:UltiSnipsSnippetsDir