Vim builds a convenient Java development environment,

Source: Internet
Author: User
Tags autoload uppercase letter

From: http://blog.csdn.net/jixiuffff/article/details/5695806

Install Vim first (of course, JDK installation is required for Java development)

Emerge-AV Vim (install the vim command on the Gentoo system, you can use rpm, Apt-Get)

Install the javacomplete plug-in for VIM

Http://www.vim.org/scripts/script.php? Script_id = 1785 this plug-in is used to implement some code prompts. For example, if you enter system, all the member variables and methods under system are listed.

Installation Method: Download javacomplete.zip. The above URL contains install details installation details.

The description is as follows:

Decompress the file

Set javacomplete. Vim,

Java_parser.vim

Reflection. Java

Copy to the/usr/share/Vim/vimfiles/autoload Vim installation directory vimfiles/autoload

Note that the permissions of these files are chmod 755/usr/share/Vim/vimfiles/autoload/* To ensure that normal users have the appropriate permissions.

CD/usr/share/Vim/vimfiles/autoload

Javac reflection. Java

Set Java classpath to add the/usr/share/Vim/vimfiles/autoload path to the classpath directory.

For example, my classpath is

.:/Usr/share/Vim/vimfiles/autoload:/usr/share/ant-core/Li
B/ant-launcher.jar:/usr/share/ant-core/lib/ant. jar:/usr/s
Hare/ant-core/lib/ant-bootstrap.jar

 

Add setlocal omnifunc = javacomplete # complete to the file ~ /. Vimrc

I joined these sentences.

Autocmd filetype Java set omnifunc = javacomplete # complete)
Autocmd filetype Java set completefunc = javacomplete # completeparamsinf "is a parameter prompt, which seems to be inefficient,

 

Inoremap <buffer> <C-X> <C-U> <C-P>
Inoremap <buffer> <c-S-space> <C-X> <C-U> <C-P>

Autocmd filetype Java, JavaScript, JSP inoremap <buffer>... <C-X> <C-O> <C-P> this statement is implemented when Vim edits a Java file.

<C-X> <C-O> <C-P>

The two statements mean that pressing CTRL + X and then pressing CTRL + u will trigger the prompt function. If you call system, a list box will appear to list members in the system class.

 

Of course, you can also make further prompts.

Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> A <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> B <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> C <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> d <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> E <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> F <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> G <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> H <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> I <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> j <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> K <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> L <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> m <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> n <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> o <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> P <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> q <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> r <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> S <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> T <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> UU <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> v <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> W <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> x <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> Y <C-N> <C-P>
Autocmd filetype Java, JavaScript, CSS, HTML, XML inoremap <buffer> Z <C-N> <C-P>

In this way, a complete prompt is displayed when you type an uppercase letter. Of course, this prompt can only be used to complete the phrase with the same name that appears in the editing file, for example, if the file contains a system record, all the words starting with "S" are listed.


Split the vim window and edit multiple files at the same time.

Http://www.cublog.cn/u1/53672/showart_447346.html

 

Third, run the shell terminal in vim.

Http://www.vimer.cn/2010/06/%E5%9C%A8vimgvim%E4%B8%AD%E8%BF%90%E8%A1%8C%E7%BB%88%E7% AB %AF%E5%AF%B9%E4%BD%A0%E6%B2%A1%E6%9C%89%E7%9C%8B%E9%94%99%E6%88%91%E4%B9%9F%E6%B2%A1%E6%9C%89%E5%86%99%E5%8F%8D.html

 

The second and third phases can all be used to edit the Java file in a window. A Window runs Bash to compile the Java file. You do not need to close vim and then run the javac command.

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.