Compiling Java code in Vim more efficiently

后端 未结 5 1364
鱼传尺愫
鱼传尺愫 2021-01-30 03:34

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          


        
5条回答
  •  耶瑟儿~
    2021-01-30 04:14

    With Makefiles, you could use some very generic things:

    JAVAFILES=$(wildcard *.java)
    
    mytarget: $(JAVAFILES)
        javac $^
    

    On the other hand, you would probably fine doing

    :compiler javac
    :se makeprg=javac\ **/*.java
    :make
    :copen
    

    Map some keys to :cnext and :cprevious to navigate errors quickly.

    Use :colder / :cnewerto go back to earlier/later quickfix lists. Quickfix will remember where in the quickfix stack you were for a specific quickfix list.

提交回复
热议问题