From 34e72ff7f5b07cbe02e82843137047dc0907b066 Mon Sep 17 00:00:00 2001 From: gryf Date: Fri, 9 Dec 2011 10:00:06 +0100 Subject: [PATCH] Added calendar plugin, update of tagbar --- .../tagbar.vim | 267 ++-- doc/tagbar.txt | 147 +- doc/tags | 4 +- plugin/calendar.vim | 1328 +++++++++++++++++ plugin/tagbar.vim | 111 ++ syntax/tagbar.vim | 32 +- 6 files changed, 1760 insertions(+), 129 deletions(-) rename plugin/tagbar.vim_disabled => autoload/tagbar.vim (93%) create mode 100644 plugin/calendar.vim create mode 100644 plugin/tagbar.vim diff --git a/plugin/tagbar.vim_disabled b/autoload/tagbar.vim similarity index 93% rename from plugin/tagbar.vim_disabled rename to autoload/tagbar.vim index 978788a..3f37085 100644 --- a/plugin/tagbar.vim_disabled +++ b/autoload/tagbar.vim @@ -4,7 +4,7 @@ " Author: Jan Larres " Licence: Vim licence " Website: http://majutsushi.github.com/tagbar/ -" Version: 2.1 +" Version: 2.2 " Note: This plugin was heavily inspired by the 'Taglist' plugin by " Yegappan Lakshmanan and uses a small amount of code from it. " @@ -18,19 +18,12 @@ " use of this software. " ============================================================================ -if &cp || exists('g:loaded_tagbar') - finish -endif +scriptencoding utf-8 " Initialization {{{1 " Basic init {{{2 -if v:version < 700 - echomsg 'Tagbar: Vim version is too old, Tagbar requires at least 7.0' - finish -endif - if !exists('g:tagbar_ctags_bin') if executable('ctags-exuberant') let g:tagbar_ctags_bin = 'ctags-exuberant' @@ -38,6 +31,12 @@ if !exists('g:tagbar_ctags_bin') let g:tagbar_ctags_bin = 'exuberant-ctags' elseif executable('exctags') let g:tagbar_ctags_bin = 'exctags' + elseif has('macunix') && executable('/usr/local/bin/ctags') + " Homebrew default location + let g:tagbar_ctags_bin = '/usr/local/bin/ctags' + elseif has('macunix') && executable('/opt/local/bin/ctags') + " Macports default location + let g:tagbar_ctags_bin = '/opt/local/bin/ctags' elseif executable('ctags') let g:tagbar_ctags_bin = 'ctags' elseif executable('ctags.exe') @@ -49,7 +48,14 @@ if !exists('g:tagbar_ctags_bin') finish endif else + " reset 'wildignore' temporarily in case *.exe is included in it + let wildignore_save = &wildignore + set wildignore& + let g:tagbar_ctags_bin = expand(g:tagbar_ctags_bin) + + let &wildignore = wildignore_save + if !executable(g:tagbar_ctags_bin) echomsg 'Tagbar: Exuberant ctags not found in specified place,' \ 'skipping plugin' @@ -67,52 +73,6 @@ if s:ftype_out !~# 'detection:ON' endif unlet s:ftype_out -let g:loaded_tagbar = 1 - -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_expand') - let g:tagbar_expand = 0 -endif - -if !exists('g:tagbar_foldlevel') - let g:tagbar_foldlevel = 99 -endif - -if !exists('g:tagbar_usearrows') - let g:tagbar_usearrows = 0 -endif - -if !exists('g:tagbar_autoshowtag') - let g:tagbar_autoshowtag = 0 -endif - -if !exists('g:tagbar_systemenc') - let g:tagbar_systemenc = &encoding -endif - if has('multi_byte') && has('unix') && &encoding == 'utf-8' && \ (empty(&termencoding) || &termencoding == 'utf-8') let s:icon_closed = '▶' @@ -136,7 +96,9 @@ let s:access_symbols = { \ 'private' : '-' \ } -autocmd SessionLoadPost * nested call s:RestoreSession() +let g:loaded_tagbar = 1 + +let s:last_highlight_tline = 0 " s:InitTypes() {{{2 function! s:InitTypes() @@ -861,22 +823,28 @@ function! s:RestoreSession() call s:InitWindow(g:tagbar_autoclose) " Leave the Tagbar window and come back so the update event gets triggered - execute 'wincmd p' + wincmd p execute tagbarwinnr . 'wincmd w' if !in_tagbar - execute 'wincmd p' + wincmd p endif endfunction " s:MapKeys() {{{2 function! s:MapKeys() - nnoremap