Skip to content

Commit

Permalink
Add option to show line numbers, closes #146
Browse files Browse the repository at this point in the history
  • Loading branch information
majutsushi committed Aug 24, 2013
1 parent fec9b2a commit 24efd12
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
17 changes: 14 additions & 3 deletions autoload/tagbar.vim
Expand Up @@ -1756,14 +1756,25 @@ function! s:InitWindow(autoclose) abort
setlocal nobuflisted
setlocal nomodifiable
setlocal nolist
setlocal nonumber
setlocal nowrap
setlocal winfixwidth
setlocal textwidth=0
setlocal nospell

if exists('+relativenumber')
setlocal norelativenumber
if g:tagbar_show_linenumbers == 0
setlocal nonumber
if exists('+relativenumber')
setlocal norelativenumber
endif
elseif g:tagbar_show_linenumbers == 1
setlocal number
elseif g:tagbar_show_linenumbers == 2
setlocal relativenumber
else
set number<
if exists('+relativenumber')
set relativenumber<
endif
endif

setlocal nofoldenable
Expand Down
17 changes: 17 additions & 0 deletions doc/tagbar.txt
Expand Up @@ -470,6 +470,23 @@ Example:
let g:tagbar_show_visibility = 0
<

*g:tagbar_show_linenumbers*
g:tagbar_show_linenumbers~
Default: 0

Whether line numbers should be shown in the Tagbar window.

Possible values are:
0: Don't show any line numbers.
1: Show absolute line numbers.
2: Show relative line numbers.
-1: Use the global line number settings.

Example:
>
let g:tagbar_show_linenumbers = 2
<

*g:tagbar_expand*
g:tagbar_expand~
Default: 0
Expand Down
1 change: 1 addition & 0 deletions plugin/tagbar.vim
Expand Up @@ -58,6 +58,7 @@ let s:options = [
\ ['indent', 2],
\ ['left', 0],
\ ['show_visibility', 1],
\ ['show_linenumbers', 0],
\ ['singleclick', 0],
\ ['sort', 1],
\ ['systemenc', &encoding],
Expand Down

0 comments on commit 24efd12

Please sign in to comment.