LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1235|回复: 4

VIM Taglist无法显示函数名等

[复制链接]
发表于 2009-4-21 19:00:53 | 显示全部楼层 |阅读模式
RT
taglist+ctags+snipMate
在gentoo里面捣鼓VIM,结果配置完后,输入:Taglist,右侧会显示窗口,左侧显示代码,但是右侧看不到python的类名,函数名,空白一片,只有一个文件名,看官方文档也没看出所以然来,
http://vim-taglist.sourceforge.net/faq.html
请各位大虾咋整.
这是配置文件:

"if filereadable("/etc/vim/gvimrc.local")
"source /etc/vim/gvimrc.local
"endif
"####################################
"#            vim基本设置           #
"####################################

"字体行号
set nocp
set nu



"去掉工具栏和菜单兰
"set guioptions-=m
"set guioptions-=T
if ! has("gui_running")
    set t_Co=256
endif

" 允许退格键删除
set backspace=2

" 启用鼠标
set mouse=a

"开启插件
filetype on
filetype plugin on
filetype indent on

" 设置编码自动识别, 中文引号显示
"set fileencodings=utf-8,cp936,big5,euc-jp,euc-kr,latin1,ucs-bom
set fileencodings=utf-8,gbk
set ambiwidth=double

" 移动长行
nnoremap <Down> gj
nnoremap <Up> gk

" 高亮
syntax on

" 设置高亮搜索
set hlsearch

" 输入字符串就显示匹配点
set incsearch

" 输入的命令显示出来,看的清楚些。
set showcmd

" 打开当前目录文件列表
map <F3> :e .<CR>

"显示模式
if ! has("gui_running")
    set t_Co=256
endif

set shiftwidth=4
set cindent

"颜色显示
colors desert256

"折叠代码
set nofen
set fdl=0

"关掉备份
set nobackup

"运行python
"map <<F8>>:!python %


"#######################################
"#             插件管理                #
"#######################################
"cscope,来源于互联网
if has("cscope")
        set csprg=/usr/bin/cscope
        set csto=0
        set cst
        set nocsverb
" add any database in current directory
        if filereadable("cscope.out")
                cs add cscope.out
"else add database pointed to by environment
                elseif $CSCOPE_DB != ""
                cs add $CSCOPE_DB
        endif
set csverb
set cscopetag
set cscopequickfix=s-,g-,c-,d-,t-,e-,f-,i-
endif

" Taglist
let Tlist_File_Fold_Auto_Close=1
let Tlist_Ctags_Cmd="/usr/bin/ctags"
let g:Tb_ForceSyntaxEnable=1
set updatetime=1000
map <F4> :Tlist<CR>


"设置snupptsEMU
"set runtimepath+=~/.vim/after
"set runtimepath+=~/.vim/after/ftplugi
"let g:snip_set_textmate_cp=1


"打开python文件
autocmd FileType python setlocal et sta sw=4 sts=4

"WM窗口管理
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>

" vim 自动补全 Python 代码
" 来自http://vim.sourceforge.net/scripts/script.php?script_id=850
autocmd FileType python set complete+=k~/.vim/tools/pydiction
" 自动使用新文件模板
"autocmd BufNewFile *.py 0r ~/.vim/skeleton/simple.py

"from 8pm ^_^ 智能补全
set completeopt=longest,menuone
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
            \ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
            \ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'

"代码补全用菜单模式
set wildmenu
if has("autocmd")
    autocmd FileType python set dictionary+=~./.vim/tools/pydiction
    autocmd FileType python set complete+=k
endif

"模板
"autocmd BufNewFile test*.py Or ~/.vim/skeleton/test.py
"autocmd BufNewFile alltests.py Or ~/.vim/skeleton/alltests.py
"autocmd BufNewFile *.py Or ~/.vim/skeleton/skeleton.py



"################################################
"#  以下部分来源于互联网,设置VIM状态栏等       #
"################################################
"Format the statusline
"Nice statusbar
set laststatus=2
set statusline=
set statusline+=%2*%-3.3n%0*\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%1*%m%r%w%0* " flag
set statusline+=[
if v:version >= 600
set statusline+=%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{&encoding}, " encoding
endif
set statusline+=%{&fileformat}] " file format
if filereadable(expand("$VIM/vimfiles/plugin/vimbuddy.vim"))
set statusline+=\ %{VimBuddy()} " vim buddy
endif
set statusline+=%= " right align
"set statusline+=%2*0x%-8B\ " current char
set statusline+=0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
"############################################################
 楼主| 发表于 2009-4-23 12:55:59 | 显示全部楼层

好几天了?没人。。。。。。伤心ING

Post by sosogentoo;1977551
RT
taglist+ctags+snipMate
在gentoo里面捣鼓VIM,结果配置完后,输入:Taglist,右侧会显示窗口,左侧显示代码,但是右侧看不到python的类名,函数名,空白一片,只有一个文件名,看官方文档也没看出所以然来,
http://vim-taglist.sourceforge.net/faq.html
请各位大虾咋整.
这是配置文件:

"if filereadable("/etc/vim/gvimrc.local")
"source /etc/vim/gvimrc.local
"endif
"####################################
"#            vim基本设置           #
"####################################

"字体行号
set nocp
set nu



"去掉工具栏和菜单兰
"set guioptions-=m
"set guioptions-=T
if ! has("gui_running")
    set t_Co=256
endif

" 允许退格键删除
set backspace=2

" 启用鼠标
set mouse=a

"开启插件
filetype on
filetype plugin on
filetype indent on

" 设置编码自动识别, 中文引号显示
"set fileencodings=utf-8,cp936,big5,euc-jp,euc-kr,latin1,ucs-bom
set fileencodings=utf-8,gbk
set ambiwidth=double

" 移动长行
nnoremap <Down> gj
nnoremap <Up> gk

" 高亮
syntax on

" 设置高亮搜索
set hlsearch

" 输入字符串就显示匹配点
set incsearch

" 输入的命令显示出来,看的清楚些。
set showcmd

" 打开当前目录文件列表
map <F3> :e .<CR>

"显示模式
if ! has("gui_running")
    set t_Co=256
endif

set shiftwidth=4
set cindent

"颜色显示
colors desert256

"折叠代码
set nofen
set fdl=0

"关掉备份
set nobackup

"运行python
"map <<F8>>:!python %


"#######################################
"#             插件管理                #
"#######################################
"cscope,来源于互联网
if has("cscope")
        set csprg=/usr/bin/cscope
        set csto=0
        set cst
        set nocsverb
" add any database in current directory
        if filereadable("cscope.out")
                cs add cscope.out
"else add database pointed to by environment
                elseif $CSCOPE_DB != ""
                cs add $CSCOPE_DB
        endif
set csverb
set cscopetag
set cscopequickfix=s-,g-,c-,d-,t-,e-,f-,i-
endif

" Taglist
let Tlist_File_Fold_Auto_Close=1
let Tlist_Ctags_Cmd="/usr/bin/ctags"
let g:Tb_ForceSyntaxEnable=1
set updatetime=1000
map <F4> :Tlist<CR>


"设置snupptsEMU
"set runtimepath+=~/.vim/after
"set runtimepath+=~/.vim/after/ftplugi
"let g:snip_set_textmate_cp=1


"打开python文件
autocmd FileType python setlocal et sta sw=4 sts=4

"WM窗口管理
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>

" vim 自动补全 Python 代码
" 来自http://vim.sourceforge.net/scripts/script.php?script_id=850
autocmd FileType python set complete+=k~/.vim/tools/pydiction
" 自动使用新文件模板
"autocmd BufNewFile *.py 0r ~/.vim/skeleton/simple.py

"from 8pm ^_^ 智能补全
set completeopt=longest,menuone
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
            \ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
            \ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'

"代码补全用菜单模式
set wildmenu
if has("autocmd")
    autocmd FileType python set dictionary+=~./.vim/tools/pydiction
    autocmd FileType python set complete+=k
endif

"模板
"autocmd BufNewFile test*.py Or ~/.vim/skeleton/test.py
"autocmd BufNewFile alltests.py Or ~/.vim/skeleton/alltests.py
"autocmd BufNewFile *.py Or ~/.vim/skeleton/skeleton.py



"################################################
"#  以下部分来源于互联网,设置VIM状态栏等       #
"################################################
"Format the statusline
"Nice statusbar
set laststatus=2
set statusline=
set statusline+=%2*%-3.3n%0*\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%1*%m%r%w%0* " flag
set statusline+=[
if v:version >= 600
set statusline+=%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{&encoding}, " encoding
endif
set statusline+=%{&fileformat}] " file format
if filereadable(expand("$VIM/vimfiles/plugin/vimbuddy.vim"))
set statusline+=\ %{VimBuddy()} " vim buddy
endif
set statusline+=%= " right align
"set statusline+=%2*0x%-8B\ " current char
set statusline+=0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
"############################################################


好几天了?没人。。。。。。伤心ING
回复 支持 反对

使用道具 举报

发表于 2009-4-23 15:05:49 | 显示全部楼层
我没有用taglist......
回复 支持 反对

使用道具 举报

发表于 2009-4-23 21:00:08 | 显示全部楼层
Post by sosogentoo;1977551
RT
taglist+ctags+snipMate
在gentoo里面捣鼓VIM,结果配置完后,输入:Taglist,右侧会显示窗口,左侧显示代码,但是右侧看不到python的类名,函数名,空白一片,只有一个文件名,看官方文档也没看出所以然来,

最新版的ctags(5.7-r1)似乎有问题,我把ctags降到5.6-r3就可以了。
回复 支持 反对

使用道具 举报

发表于 2009-4-23 21:40:28 | 显示全部楼层
如果是python,
就应该是补丁的问题.你到files下面看看,
会发现.ctags的 python补丁,少了一个空格.
仔细看看就看出来的~_~...才几行字罢了.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表