1

我想使用omnicomplete,而不是自己编写每个变量。很快,我必须处理一个混乱的项目,所以我需要一些帮助来寻找变量......我尝试使用omnicomplete,但它不起作用:

您将在下面找到一些软件信息:

VIM:7.3.429-2ubuntu2.1 exuberant-ctag:5.9

我的.vimrc:

set background=dark
set expandtab
set tabstop=4
set ai

au BufWinEnter * let w:m1=matchadd('ErrorMsg', '\%>80v.\+', -1)
highlight Space ctermbg=darkblue guibg=darkblue
highlight Tab ctermbg=darkgray guibg=darkgray
au BufWinEnter * let w:m2=matchadd('Tab', '\t', -1)
au BufWinEnter * let w:m3=matchadd('Space', '\s\+$\| \+\ze\t', -1)

map <F4> :TlistToggle<cr>
filetype plugin on
set omnifunc=syntaxcomplete#Complete

当我打开一个文件时,我输入:

:set tags=/mypath/myfile

但是当我想要自动完成时它不起作用:

自己。

它只显示函数名而没有变量?当我使用 TagLists 时,我也只看到函数。如果我阅读我的标签文件,我可以找到我的变量..

那么,如果我想使用omnicomplete 来完成python 脚本中的变量,我该怎么办?

谢谢你。:)

4

2 回答 2

0

删除omnifunc线应该足够了。它明确地将默认的 python omnifunc (它做你想要的)替换为一个功能较弱的。

于 2014-04-03T09:02:56.843 回答
0

Hmmm, I think I have a deeper issue with Vi and exuberant-ctags.

You will find below my new vimrc:

set background=dark
set ai


let Tlist_WinWidth = 50
highlight Space ctermbg=darkblue guibg=darkblue
highlight Tab ctermbg=darkgray guibg=darkgray
au BufWinEnter * let w:m2=matchadd('Tab', '\t', -1)
au BufWinEnter * let w:m3=matchadd('Space', '\s\+$\| \+\ze\t', -1)

map <F4> :TlistToggle<cr>
map! <F3> <C-V><Tab>

filetype plugin indent on


set completeopt=longest,menuone

When I do that:

:set tags=/mypath/myfile

Then if I try to enter:

:ts

I get :

E73 : tag stack empty

or :TlistShowTag => nothing happens

I don't understand where is the mistake? Vim configuration? TagList? Exuberant-tags? :/

Why I have variable namy in my tags file but not in tag list? :(

于 2014-04-04T09:33:32.643 回答