vim Tagbar插件

时间:2014-02-10 15:50:57

标签: vim vim-plugin

我确实将vim与Tagbars和The-NERD-tree插件一起使用。我也想启用autochdir。但有时候,当我用NERD-tree插件切换文件时 - Tagbar不刷新其内容,我坚持使用以前文件中的标签。如果我再次执行“TagbarToggle” - 第二个Tagbar窗口会出现当前文件标签。如果我禁用autochdir - 它似乎工作正常。我该如何解决这个问题?当前.vimrc已附加。谢谢。

syntax on           " syntax hl by default
set background=dark " dark background
set shortmess+=I    " no startup uganda msg
set showcmd         " Show (partial) command in status line.
set showmatch       " Show matching brackets.
set incsearch       " Incremental search
set autowrite       " Automatically save before commands like :next and :make
set hidden          " Hide buffers when they are abandoned
set mouse=a         " Enable mouse usage (all modes)
set number          " line numbers
set guioptions-=T   " no toolbar 
set vb t_vb=        " no beeps
set ruler           " status bar and ruller for each windows
set showmatch       " show matching brace
set autoindent      " the current line's indent level to set the indent level of new lines)
set smartindent     " attempt to intelligently guess the indent level
set smartcase       " Do smart case matching
set ignorecase      " Do case insensitive matching
set virtualedit=all " This setting allows the cursor to freely roam anywhere it likes in command mode.
"set autochdir       " Automaticly changes dir to active
"set autowriteall    " Autosave files

"-color scheme-------------------------------------------
"colorscheme ir_black

"-tabs configs-------------------------------------------
set expandtab
set tabstop=4
set showtabline=4
set shiftwidth=4

"-ctags configs------------------------------------------
"search for tag files until root
set tags=tags;/ 

"-autosave configs---------------------------------------
set autowrite

"-search configs-----------------------------------------
set hlsearch 
" seek for selected test
nnoremap * *N 
"turn off higliting
nnoremap 8 :nohlsearch<CR>
"nnoremap <S-F8> :nohlsearch<CR>
" search in selected text
vnoremap * y :execute ":let @/=@\""<CR> :execute "set hlsearch"<CR>

"-spellcheck configs-------------------------------------
set spelllang=en_us
nn <F7> :setlocal spell!<CR>
let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
"setlocal spell spelllang=en_us
"nn <F7> :setlocal spell! spelllang=en_us<CR>
"imap <F7> <C-o>:setlocal spell! spelllang=en_us<CR>
"it should get the dictionary files

"-move between windows-----------------------------------
nmap <silent> <C-k> :wincmd k<CR>
nmap <silent> <C-j> :wincmd j<CR>
nmap <silent> <C-h> :wincmd h<CR>
nmap <silent> <C-l> :wincmd l<CR>
"move between windows
nnoremap <Tab> <C-W>w
"move between windows backwards
nnoremap <S-Tab> <C-W>W

"-encoding-----------------------------------------------
"set encoding=utf-8

"-show invisible chars-----------------------------------
set listchars=tab:>-,eol:$
nnoremap <F8> :set list!<CR>
":highlight NonText ctermfg=red
"set listchars=tab:▸\ ,eol:¬
"set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<

"-Tag bar config-----------------------------------------
nnoremap <F4> :TagbarToggle<CR>

"-buffers------------------------------------------------
"nnoremap <F7> :TMiniBufExplorer<CR>
nnoremap <F5> :ls<CR>
nnoremap <C-n> :bnext<CR>
nnoremap <C-b> :bprev<CR>
nnoremap <C-c> :enew<CR>
nnoremap <C-x> :bp<bar>sp<bar>bn<bar>bd<CR>

"-grep---------------------------------------------------
nnoremap <silent> <F9> :Grep<CR> 

"-nerd tree----------------------------------------------
nnoremap <F3> :NERDTreeToggle<CR>

"-clipboard----------------------------------------------
set clipboard=unnamedplus

"-easymotion---------------------------------------------
map <F6> <Leader><Leader>W

"-cscope---------------------------------------------

"-VIM plugins--------------------------------------------
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
filetype plugin indent on

" L9 - vim programming library
Bundle 'L9'
Bundle 'The-NERD-tree'
Bundle 'EasyMotion'
Bundle 'grep.vim' 
Bundle 'Tagbar'
Bundle 'chazy/cscope_maps'

"Bundle 'buftabs'
"Bundle 'autoload_cscope.vim' 
"Bundle 'chazy/cscope_maps'
"Bundle 'FuzzyFinder'
"Bundle 'tpope/vim-fugitive' 

1 个答案:

答案 0 :(得分:2)

尝试更新到Vim 7.4。我有同样的问题,as described on this tagbar issue