diff --git a/.vimrc b/.vimrc index 6ed1277..2494e90 100644 --- a/.vimrc +++ b/.vimrc @@ -181,6 +181,8 @@ nmap \dj let g:buffergator_split_size=10 let g:buffergator_viewport_split_policy='B' let g:buffergator_suppress_keymaps=1 +let g:buffergator_sort_regime="filepath" +let g:buffergator_display_regime="filepath" map b :BuffergatorToggle " }}} "Gundo {{{2 @@ -386,7 +388,7 @@ endfunction " GUI: detect graphics mode, set colorscheme {{{ if has('gui_running') "set guifont=Consolas\ 12 "I like this font, but it looks like crap on linux - "set guifont=Consolas\ 13 "Let's try again + "set guifont=DejaVu\ Sans\ Mono\ 12 "at least, some ttf font that looks good set guifont=Fixed\ 14 "I like this font better. set mouse=a "Enable mouse support "No toolbar, menu, scrollbars, draw simple text tabs. This would keep diff --git a/GetLatest/GetLatestVimScripts.dat b/GetLatest/GetLatestVimScripts.dat index 639f35a..535dc2b 100644 --- a/GetLatest/GetLatestVimScripts.dat +++ b/GetLatest/GetLatestVimScripts.dat @@ -17,7 +17,7 @@ ScriptID SourceID Filename 152 3342 showmarks.vim 2540 11006 snipMate.vim 1697 12566 :AutoInstall: surround.vim -3465 16977 Tagbar +3465 17112 Tagbar 90 17031 vcscommand.vim 2226 15854 vimwiki.vim 1334 6377 vst.vim diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 3f37085..48ad320 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -4,7 +4,7 @@ " Author: Jan Larres " Licence: Vim licence " Website: http://majutsushi.github.com/tagbar/ -" Version: 2.2 +" Version: 2.3 " Note: This plugin was heavily inspired by the 'Taglist' plugin by " Yegappan Lakshmanan and uses a small amount of code from it. " @@ -73,17 +73,8 @@ if s:ftype_out !~# 'detection:ON' endif unlet s:ftype_out -if has('multi_byte') && has('unix') && &encoding == 'utf-8' && - \ (empty(&termencoding) || &termencoding == 'utf-8') - let s:icon_closed = '▶' - let s:icon_open = '▼' -elseif has('multi_byte') && (has('win32') || has('win64')) && g:tagbar_usearrows - let s:icon_closed = '▷' - let s:icon_open = '◢' -else - let s:icon_closed = '+' - let s:icon_open = '-' -endif +let s:icon_closed = g:tagbar_iconchars[0] +let s:icon_open = g:tagbar_iconchars[1] let s:type_init_done = 0 let s:autocommands_done = 0 @@ -99,9 +90,26 @@ let s:access_symbols = { let g:loaded_tagbar = 1 let s:last_highlight_tline = 0 +let s:debug = 0 +let s:debug_file = '' + +" s:Init() {{{2 +function! s:Init() + if !s:type_init_done + call s:InitTypes() + endif + + if !s:checked_ctags + if !s:CheckForExCtags() + return + endif + endif +endfunction " s:InitTypes() {{{2 function! s:InitTypes() + call s:LogDebugMessage('Initializing types') + let s:known_types = {} " Ant {{{3 @@ -401,7 +409,8 @@ function! s:InitTypes() " Alternatively jsctags/doctorjs will be used if available. let type_javascript = {} let type_javascript.ctagstype = 'javascript' - if executable('jsctags') + let jsctags = s:CheckFTCtags('jsctags', 'javascript') + if jsctags != '' let type_javascript.kinds = [ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0}, \ {'short' : 'f', 'long' : 'functions', 'fold' : 0} @@ -414,7 +423,7 @@ function! s:InitTypes() let type_javascript.scope2kind = { \ 'namespace' : 'v' \ } - let type_javascript.ctagsbin = 'jsctags' + let type_javascript.ctagsbin = jsctags let type_javascript.ctagsargs = '-f -' else let type_javascript.kinds = [ @@ -748,6 +757,8 @@ endfunction " s:GetUserTypeDefs() {{{2 function! s:GetUserTypeDefs() + call s:LogDebugMessage('Initializing user types') + redir => defs silent execute 'let g:' redir END @@ -766,18 +777,20 @@ function! s:GetUserTypeDefs() " generate the other one " Also, transform the 'kind' definitions into dictionary format for def in values(defdict) - let kinds = def.kinds - let def.kinds = [] - for kind in kinds - let kindlist = split(kind, ':') - let kinddict = {'short' : kindlist[0], 'long' : kindlist[1]} - if len(kindlist) == 3 - let kinddict.fold = kindlist[2] - else - let kinddict.fold = 0 - endif - call add(def.kinds, kinddict) - endfor + if has_key(def, 'kinds') + let kinds = def.kinds + let def.kinds = [] + for kind in kinds + let kindlist = split(kind, ':') + let kinddict = {'short' : kindlist[0], 'long' : kindlist[1]} + if len(kindlist) == 3 + let kinddict.fold = kindlist[2] + else + let kinddict.fold = 0 + endif + call add(def.kinds, kinddict) + endfor + endif if has_key(def, 'kind2scope') && !has_key(def, 'scope2kind') let def.scope2kind = {} @@ -798,6 +811,8 @@ endfunction " s:RestoreSession() {{{2 " Properly restore Tagbar after a session got loaded function! s:RestoreSession() + call s:LogDebugMessage('Restoring session') + let tagbarwinnr = bufwinnr('__Tagbar__') if tagbarwinnr == -1 " Tagbar wasn't open in the saved session, nothing to do @@ -810,15 +825,7 @@ function! s:RestoreSession() endif endif - if !s:type_init_done - call s:InitTypes() - endif - - if !s:checked_ctags - if !s:CheckForExCtags() - return - endif - endif + call s:Init() call s:InitWindow(g:tagbar_autoclose) @@ -833,6 +840,8 @@ endfunction " s:MapKeys() {{{2 function! s:MapKeys() + call s:LogDebugMessage('Mapping keys') + nnoremap