使用vim支持Java自动补全

    一直以来,就想让我的vim支持java的自动补全,结果老是补不全,就是没有安装齐全。我总是喜欢到网上东找找,西找找,可是感觉都不对路。本来不想搞了的,今天就想,为何不到官网上去试试。结果,果然是成功了的。。。。



下面是官网的安装指南:

install details
1. Unzip javacomplete.zip to a directory of 'runtimepath', e.g.
$HOME/.vim (unix/linux), $VIM/vimfiles (windows).
> unzip javacomplete.zip -d ~/.vim

    To update Vim help tags, run vim and run command:
:helptags $HOME/.vim/doc
    or
:helptags $VIM/vimfiles/doc

NOTE: javacomplete.vim, java_parser.vim and Reflection.java should be in one
autoload directory of 'runtimepath'.
javacomplete.txt should be in one doc directory of 'runtimepath'.

2. Set 'omnifunc' option. e.g.
        :setlocal omnifunc=javacomplete#Complete
  Or, use autocmd:
        :" Only do this part when compiled with support for autocommands.
        :if has("autocmd")
        :  autocmd Filetype java setlocal omnifunc=javacomplete#Complete
        :endif
  You can add this command to your .vimrc or _vimrc.

3. Set 'completefunc' option to show parameters information IF YOU LIKE. e.g.
:setlocal completefunc=javacomplete#CompleteParamsInfo
You can map as follows for better display:
:inoremap <buffer> <C-X><C-U> <C-X><C-U><C-P>
:inoremap <buffer> <C-S-Space> <C-X><C-U><C-P>

4. Reflection.java will be automatcally compiled and placed to $HOME when you
use first time. Assure that Reflection.java is in the same directory with
javacomplete.vim to be searched in autoload subdirectory of &rtp.
If no Reflection.class is generated, check that you have the write permission
in $HOME directory.
If a previous Reflection.java is not compatible with the new version
javacomplete.vim, please compile Reflection.java manually.

你可能感兴趣的:(java,linux,windows,unix,vim)