在Vim中更有效地编译Java代码 [英] Compiling Java code in Vim more efficiently
问题描述
我来自Eclipse背景,但我喜欢Vim作为文本编辑器。我目前正在尝试将Vim作为Java IDE。目前我这样做是为了编译:
I come from an Eclipse background, but I love Vim as a text editor. I'm currently experimenting with Vim as a Java IDE. Currently I do this to compile:
! javac MyClass.java
后跟
! java -cp . MyClass
如果我有编译错误,我必须使用<$ c $返回编译器输出c>!并手动跳转到产生错误的每一行。一旦我开始添加其他类,我就必须分别编译它们。
If I have compile errors, I have to go back to the compiler output using !
and manually jump to every line that produced an error. And as soon as I start adding other classes, I have to compile each of them separately.
必须有一种比这更有效的方法。在我目前效率低下的Vim工作流程中,我可以在图形IDE中更快地完成工作,这比我使用Vim的目的要好。
There's got to be a more efficient way than this. Under my current inefficient Vim workflow, I can get stuff done faster in a graphical IDE, which beats the purpose of using Vim for me.
我希望能够在包含我的main方法的类中输入类似:compile
的内容来编译我的所有源代码,并显示错误消息的分屏列表。你会推荐什么?
I'd like to be able to enter something like :compile
in the class containing my main method to compile all my sources and be presented with a split-screen list of error messages. What would you recommend?
相关,但与我个人无关:
- Tips for using vim as a Java IDE?
- Programming Java with Vim
更新:我从这个问题中得到的结论是单独回答。
Update: My takeaway from this question is posted as a separate answer.
推荐答案
这里 vim wiki的文章用javac编译。
Here the vim wiki article for compiling with javac.
这篇关于在Vim中更有效地编译Java代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!