diff --git a/autoload/UltiSnips.vim b/autoload/UltiSnips.vim index a76ef06..d8ce7be 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.' '.escape(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