Compiling Java code in Vim more efficiently

后端 未结 5 1418
鱼传尺愫
鱼传尺愫 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 03:56

    By request I've posted my takeaway from this question as a separate answer.


    Here's how I used everyone's advice.

    Walking through compile errors quickly

    Add this to ~/.vimrc:

    autocmd Filetype java set makeprg=javac\ %
    set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%#
    map  :make:copen
    map  :cprevious
    map  :cnext
    

    F9 to compile, F10/F11 to cycle through errors.

提交回复
热议问题