1 " ============================================================================
3 " Description: List the current file's tags in a sidebar, ordered by class etc
4 " Author: Jan Larres <jan@majutsushi.net>
6 " Website: http://majutsushi.github.com/tagbar/
8 " Note: This plugin was heavily inspired by the 'Taglist' plugin by
9 " Yegappan Lakshmanan and uses a small amount of code from it.
11 " Original taglist copyright notice:
12 " Permission is hereby granted to use and distribute this code,
13 " with or without modifications, provided that this copyright
14 " notice is copied with it. Like anything else that's free,
15 " taglist.vim is provided *as is* and comes with no warranty of
16 " any kind, either expressed or implied. In no event will the
17 " copyright holder be liable for any damamges resulting from the
18 " use of this software.
19 " ============================================================================
23 if &cp || exists('g:loaded_tagbar')
31 echomsg 'Tagbar: Vim version is too old, Tagbar requires at least 7.0'
36 if v:version == 700 && !has('patch167')
38 echomsg 'Tagbar: Vim versions lower than 7.0.167 have a bug'
39 \ 'that prevents this version of Tagbar from working.'
40 \ 'Please use the alternate version posted on the website.'
45 if !exists('g:tagbar_left')
49 if !exists('g:tagbar_width')
50 let g:tagbar_width = 40
53 if !exists('g:tagbar_autoclose')
54 let g:tagbar_autoclose = 0
57 if !exists('g:tagbar_autofocus')
58 let g:tagbar_autofocus = 0
61 if !exists('g:tagbar_sort')
65 if !exists('g:tagbar_compact')
66 let g:tagbar_compact = 0
69 if !exists('g:tagbar_expand')
70 let g:tagbar_expand = 0
73 if !exists('g:tagbar_singleclick')
74 let g:tagbar_singleclick = 0
77 if !exists('g:tagbar_foldlevel')
78 let g:tagbar_foldlevel = 99
81 if !exists('g:tagbar_iconchars')
82 if has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
83 \ (empty(&termencoding) || &termencoding == 'utf-8')
84 let g:tagbar_iconchars = ['▶', '▼']
86 let g:tagbar_iconchars = ['+', '-']
90 if !exists('g:tagbar_autoshowtag')
91 let g:tagbar_autoshowtag = 0
94 if !exists('g:tagbar_updateonsave_maxlines')
95 let g:tagbar_updateonsave_maxlines = 5000
98 if !exists('g:tagbar_systemenc')
99 let g:tagbar_systemenc = &encoding
102 augroup TagbarSession
104 autocmd SessionLoadPost * nested call tagbar#RestoreSession()
108 command! -nargs=0 TagbarToggle call tagbar#ToggleWindow()
109 command! -nargs=? TagbarOpen call tagbar#OpenWindow(<f-args>)
110 command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fc')
111 command! -nargs=0 TagbarClose call tagbar#CloseWindow()
112 command! -nargs=1 TagbarSetFoldlevel call tagbar#SetFoldLevel(<args>)
113 command! -nargs=0 TagbarShowTag call tagbar#OpenParents()
114 command! -nargs=? TagbarDebug call tagbar#StartDebug(<f-args>)
115 command! -nargs=0 TagbarDebugEnd call tagbar#StopDebug()
118 " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1