Building VIM as a Java development environment (-)

Source: Internet
Author: User
Tags autoload

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 (-)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.