From 7a54a7d4ae61ad887273c97bce84ac0a13d4a00a Mon Sep 17 00:00:00 2001 From: raven42 Date: Wed, 28 Oct 2020 14:24:17 -0500 Subject: [PATCH] Document how to use relative sizes in g:tagbar_width (#689) --- doc/tagbar.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/tagbar.txt b/doc/tagbar.txt index 65f66c4..581f43f 100644 --- a/doc/tagbar.txt +++ b/doc/tagbar.txt @@ -539,11 +539,15 @@ g:tagbar_width~ Default: 40 If |g:tagbar_position| does include a 'vertical' options, then this value is -used to determine the width of the Tagbar window in characters. +used to determine the width of the Tagbar window in characters. This value can +also be set using the |winwidth(0)| function call to calculate a dynamic value +to make the tagbar width relative to a percentage of the vim window size as +seen in the example below that will open the tagbar window to 20 percent of +the window width with a limit of no less than 25 characters. Example: > - let g:tagbar_width = 30 + let g:tagbar_width = max([25, winwidth(0) / 5]) < *g:tagbar_zoomwidth*