diff --git a/autoload/gitgutter/hunk.vim b/autoload/gitgutter/hunk.vim index 6537a8d..041e4c7 100644 --- a/autoload/gitgutter/hunk.vim +++ b/autoload/gitgutter/hunk.vim @@ -255,7 +255,7 @@ function! s:preview(hunk_diff) silent! wincmd P if !&previewwindow - noautocmd execute 'bo' previewheight 'new' + noautocmd execute g:gitgutter_preview_win_location previewheight 'new' set previewwindow else execute 'resize' previewheight diff --git a/doc/gitgutter.txt b/doc/gitgutter.txt index 7d5377f..0287b0c 100644 --- a/doc/gitgutter.txt +++ b/doc/gitgutter.txt @@ -270,6 +270,12 @@ General:~ |g:gitgutter_log| + *g:gitgutter_preview_win_location* +Default: 'bo' + +This option determines where the preview window pops up as a result of the +:GitGutterPreviewHunk command. Other plausible values are 'to', 'bel', 'abo'. + *g:gitgutter_git_executable* Default: 'git' diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index c9197d9..6efad0c 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -22,6 +22,7 @@ function! s:set(var, default) abort endif endfunction +call s:set('g:gitgutter_preview_win_location', 'bo') call s:set('g:gitgutter_enabled', 1) call s:set('g:gitgutter_max_signs', 500) call s:set('g:gitgutter_signs', 1)