vim 标签栏插件

标签 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' 

最佳答案

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

关于vim 标签栏插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21681721/

相关文章:

VIM:加密 key

config - 如何阻止vim在80后创建新行

c++ - Vim : Override equalprg with a command with argument

vim - 如何使用 Vim 在浏览器中预览 html 文件?任何键盘快捷键?

vim - 如何在 gvim 中保存复杂的 grep 输出

ruby - 有没有办法在 Vim 中折叠所有多行 Ruby 注释?

vimwiki 本地文件链接处理

vim-plugin - 如何使用 vim-plug 安装 cscope_maps?

git - 如何让 Vim Ctrl-P 插件在 git 子模块中索引文件

python - 如何在 Vim 插件输出中为单词着色