個人愛用 Vim 寫程式,但是都被 Eclipse 愛用者歧視
沒有自動補齊功能
沒有自動補齊功能
沒有自動補齊功能
...............................幹你娘有啦!
只要裝 Vim plugin javacomplete 就可以了
javacomplete: http://www.vim.org/scripts/script.php?script_id=1785
Features:
- List members of a class, including (static) fields, (static) methods and ctors.
- List classes or subpackages of a package.
- Provide parameters information of a method, list all overload methods.
- Complete an incomplete word.
- Provide a complete JAVA parser written in Vim script language.
- Use the JVM to obtain most information.
- Use the embedded parser to obtain the class information from source files.
- Tags generated by ctags can also be used.
- JSP is supported, Builtin objects such as request, session can be recognized.
The classes and jar files in the WEB-INF will be appended automatically to classpath.
光看介紹就覺得很好用哩!
安裝方式如下:
unzip javacomplete.zip -d ~/.vim
先自行編譯 Reflection.java
cd ~/.vim/autoload/
javac Reflection.java
會在該目錄下產生一個 Reflection.class,把加進 .bashrc 中
CLASSPATH=.:~/.vim/autoload
export CLASSPATH
最後在 .vimrc 中加入
setlocal omnifunc=javacomplete#Complete
autocmd FileType java inoremap <buffer> . .<C-X><C-O><C-P>
至此您的魚腸劍已經升級,砍怪時就可使用大絕
留言列表