Description: The contents of this article as a record of their own environment, the content is basically found from the Internet, so the original author looked not too mind. In addition, I am a Mac computer, please refer to the attention of the person.
Javacomplete: A plugin that provides prompt effects in VIM development.
1. Download
Official Link: http://www.vim.org/scripts/script.php?script_id=1785
2. Download the latest package, unzip after two folders AutoLoad and Doc, in the host directory of the. Vim folder, create AutoLoad and Doc two folders, put the extracted
The files in the corresponding folder are copied, (generally in the host directory there is no. vim folder), then compile the Reflection.java, generate the Reflection.class file.
3. Configure Environment variables
Edit Vim/etc/profile
Add ~/.vim/autoload after Java classpath (your environment installs the JDK and configures environment variables)
The form is as follows:
ava_home=/usr/lib/jvm/java-1.6.0
Path= $PATH: $JAVA _home/bin
Classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar:~/.vim/autoload
Export PATH java_home CLASSPATH
Then let the configuration file take effect, Source/etc/profile
4. Modify the Vim configuration file VIMRC
The location of this file, according to the non-pass system, in the non-access location of my Mac computer is:/usr/share/vim/
At the end of this file, add the following code:
Setlocal Omnifunc=javacomplete#complete
Autocmd FileType Java Set omnifunc=javacomplete#complete
Autocmd FileType Java Set Completefunc=javacomplete#completeparamsinf
Autocmd FileType java inoremap <expr><CR> pumvisible ()? " \<c-y> ":" <CR> "
Appledemacbook-pro:vim apple$
5. Next, you are ready to use the
For example, System. When you hit the following code, the Ctrl+x and ctrl+o are automatically searched.
Building VIM as a Java development environment (-)