tagbar/plugin/tagbar.vim

127 lines
3.8 KiB
VimL
Raw Normal View History

2011-01-11 17:36:49 +08:00
" ============================================================================
" File: tagbar.vim
" Description: List the current file's tags in a sidebar, ordered by class etc
2011-02-16 20:19:24 +08:00
" Author: Jan Larres <jan@majutsushi.net>
2011-01-11 17:36:49 +08:00
" Licence: Vim licence
2011-02-20 06:04:09 +08:00
" Website: http://majutsushi.github.com/tagbar/
2013-03-25 17:27:12 +08:00
" Version: 2.5
2011-01-11 17:36:49 +08:00
" Note: This plugin was heavily inspired by the 'Taglist' plugin by
2011-02-13 14:20:15 +08:00
" Yegappan Lakshmanan and uses a small amount of code from it.
2011-02-14 17:02:44 +08:00
"
" Original taglist copyright notice:
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
" taglist.vim is provided *as is* and comes with no warranty of
" any kind, either expressed or implied. In no event will the
" copyright holder be liable for any damamges resulting from the
" use of this software.
2011-01-11 17:36:49 +08:00
" ============================================================================
2011-07-15 13:34:47 +08:00
scriptencoding utf-8
2011-01-11 17:36:49 +08:00
if &cp || exists('g:loaded_tagbar')
finish
endif
" Basic init {{{1
2011-11-26 12:45:08 +08:00
if v:version < 700
echohl WarningMsg
echomsg 'Tagbar: Vim version is too old, Tagbar requires at least 7.0'
echohl None
finish
endif
if v:version == 700 && !has('patch167')
echohl WarningMsg
echomsg 'Tagbar: Vim versions lower than 7.0.167 have a bug'
\ 'that prevents this version of Tagbar from working.'
\ 'Please use the alternate version posted on the website.'
echohl None
finish
endif
if !exists('g:tagbar_left')
let g:tagbar_left = 0
endif
if !exists('g:tagbar_width')
let g:tagbar_width = 40
endif
if !exists('g:tagbar_autoclose')
let g:tagbar_autoclose = 0
endif
if !exists('g:tagbar_autofocus')
let g:tagbar_autofocus = 0
endif
if !exists('g:tagbar_sort')
let g:tagbar_sort = 1
endif
if !exists('g:tagbar_compact')
let g:tagbar_compact = 0
endif
if !exists('g:tagbar_indent')
let g:tagbar_indent = 2
endif
2012-11-22 13:42:14 +08:00
if !exists('g:tagbar_show_visibility')
let g:tagbar_show_visibility = 1
endif
if !exists('g:tagbar_expand')
let g:tagbar_expand = 0
endif
if !exists('g:tagbar_singleclick')
let g:tagbar_singleclick = 0
endif
if !exists('g:tagbar_foldlevel')
let g:tagbar_foldlevel = 99
endif
2011-12-22 13:06:48 +08:00
if !exists('g:tagbar_iconchars')
if has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
\ (empty(&termencoding) || &termencoding == 'utf-8')
let g:tagbar_iconchars = ['▶', '▼']
else
let g:tagbar_iconchars = ['+', '-']
endif
endif
if !exists('g:tagbar_autoshowtag')
let g:tagbar_autoshowtag = 0
endif
if !exists('g:tagbar_systemenc')
let g:tagbar_systemenc = &encoding
endif
2011-07-15 13:34:47 +08:00
augroup TagbarSession
autocmd!
autocmd SessionLoadPost * nested call tagbar#RestoreSession()
augroup END
2011-01-24 17:37:52 +08:00
" Commands {{{1
command! -nargs=0 Tagbar call tagbar#ToggleWindow()
2011-06-29 04:59:49 +08:00
command! -nargs=0 TagbarToggle call tagbar#ToggleWindow()
2011-11-23 14:56:31 +08:00
command! -nargs=? TagbarOpen call tagbar#OpenWindow(<f-args>)
command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fcj')
2011-06-29 04:59:49 +08:00
command! -nargs=0 TagbarClose call tagbar#CloseWindow()
command! -nargs=1 -bang TagbarSetFoldlevel call tagbar#SetFoldLevel(<args>, <bang>0)
command! -nargs=0 TagbarShowTag call tagbar#highlighttag(1, 1)
command! -nargs=? TagbarCurrentTag echo tagbar#currenttag('%s', 'No current tag', <f-args>)
command! -nargs=1 TagbarGetTypeConfig call tagbar#gettypeconfig(<f-args>)
2011-12-12 14:47:43 +08:00
command! -nargs=? TagbarDebug call tagbar#StartDebug(<f-args>)
command! -nargs=0 TagbarDebugEnd call tagbar#StopDebug()
command! -nargs=0 TagbarTogglePause call tagbar#PauseAutocommands()
2011-01-11 17:36:49 +08:00
2011-01-24 17:37:52 +08:00
" Modeline {{{1
2011-07-15 13:34:47 +08:00
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1