From f3250b2dd1603e6c6c2c8bf78dca9ad204df72d3 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Wed, 13 Nov 2013 16:29:42 +1300 Subject: [PATCH] Make preview window position configurable --- autoload/tagbar.vim | 2 +- doc/tagbar.txt | 18 ++++++++++++++++++ plugin/tagbar.vim | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index fe255f9..684cda0 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -3010,7 +3010,7 @@ function! s:ShowInPreviewWin() abort return endif - execute 'topleft pedit +' . taginfo.fields.line . ' ' . + execute g:tagbar_previewwin_pos . ' pedit +' . taginfo.fields.line . ' ' . \ s:known_files.getCurrent(0).fpath endfunction diff --git a/doc/tagbar.txt b/doc/tagbar.txt index 27cb2c5..029a23c 100644 --- a/doc/tagbar.txt +++ b/doc/tagbar.txt @@ -564,6 +564,24 @@ Example: let g:tagbar_autoshowtag = 1 < + *g:tagbar_previewwin_pos* +g:tagbar_previewwin_pos~ +Default: topleft + +The position of the preview window. Valid values are the window splitting +commands that are described starting from |:vertical|. Set it to an empty +string to use the options 'splitbelow' and 'splitright'. + +Example: +> + let g:tagbar_previewwin_pos = "aboveleft" +< +If you want to disable line numbers in the preview window put something like +this into your vimrc: +> + autocmd BufWinEnter * if &previewwindow | setlocal nonumber | endif +< + *g:tagbar_autopreview* g:tagbar_autopreview~ Default: 0 diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index 22293d8..b7f2f53 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -58,6 +58,7 @@ let s:options = [ \ ['foldlevel', 99], \ ['indent', 2], \ ['left', 0], + \ ['previewwin_pos', 'topleft'], \ ['show_visibility', 1], \ ['show_linenumbers', 0], \ ['singleclick', 0],