]> git.r.bdr.sh - rbdr/dotfiles/blame_incremental - vim/plugin/tagbar.vim
Add weechat, ack, git and nethack
[rbdr/dotfiles] / vim / plugin / tagbar.vim
... / ...
CommitLineData
1" ============================================================================
2" File: tagbar.vim
3" Description: List the current file's tags in a sidebar, ordered by class etc
4" Author: Jan Larres <jan@majutsushi.net>
5" Licence: Vim licence
6" Website: http://majutsushi.github.com/tagbar/
7" Version: 2.3
8" Note: This plugin was heavily inspired by the 'Taglist' plugin by
9" Yegappan Lakshmanan and uses a small amount of code from it.
10"
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" ============================================================================
20
21scriptencoding utf-8
22
23if &cp || exists('g:loaded_tagbar')
24 finish
25endif
26
27" Basic init {{{1
28
29if v:version < 700
30 echohl WarningMsg
31 echomsg 'Tagbar: Vim version is too old, Tagbar requires at least 7.0'
32 echohl None
33 finish
34endif
35
36if v:version == 700 && !has('patch167')
37 echohl WarningMsg
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.'
41 echohl None
42 finish
43endif
44
45if !exists('g:tagbar_left')
46 let g:tagbar_left = 0
47endif
48
49if !exists('g:tagbar_width')
50 let g:tagbar_width = 40
51endif
52
53if !exists('g:tagbar_autoclose')
54 let g:tagbar_autoclose = 0
55endif
56
57if !exists('g:tagbar_autofocus')
58 let g:tagbar_autofocus = 0
59endif
60
61if !exists('g:tagbar_sort')
62 let g:tagbar_sort = 1
63endif
64
65if !exists('g:tagbar_compact')
66 let g:tagbar_compact = 0
67endif
68
69if !exists('g:tagbar_expand')
70 let g:tagbar_expand = 0
71endif
72
73if !exists('g:tagbar_singleclick')
74 let g:tagbar_singleclick = 0
75endif
76
77if !exists('g:tagbar_foldlevel')
78 let g:tagbar_foldlevel = 99
79endif
80
81if !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 = ['▶', '▼']
85 else
86 let g:tagbar_iconchars = ['+', '-']
87 endif
88endif
89
90if !exists('g:tagbar_autoshowtag')
91 let g:tagbar_autoshowtag = 0
92endif
93
94if !exists('g:tagbar_updateonsave_maxlines')
95 let g:tagbar_updateonsave_maxlines = 5000
96endif
97
98if !exists('g:tagbar_systemenc')
99 let g:tagbar_systemenc = &encoding
100endif
101
102augroup TagbarSession
103 autocmd!
104 autocmd SessionLoadPost * nested call tagbar#RestoreSession()
105augroup END
106
107" Commands {{{1
108command! -nargs=0 TagbarToggle call tagbar#ToggleWindow()
109command! -nargs=? TagbarOpen call tagbar#OpenWindow(<f-args>)
110command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fc')
111command! -nargs=0 TagbarClose call tagbar#CloseWindow()
112command! -nargs=1 TagbarSetFoldlevel call tagbar#SetFoldLevel(<args>)
113command! -nargs=0 TagbarShowTag call tagbar#OpenParents()
114command! -nargs=? TagbarDebug call tagbar#StartDebug(<f-args>)
115command! -nargs=0 TagbarDebugEnd call tagbar#StopDebug()
116
117" Modeline {{{1
118" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1