Add the following to .vim
" Add the current file's directory to the path if not already present.
BufRead *
\ let s:tempPath=escape(escape(expand("%:p:h"), ' '), '\ ') |
\ exec "set path+=".s:tempPath
Ref: Set working directory to the current file
With previous make and javac binding, you can compile and execute Java code from vim with
:mak
:!java FILENAME
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Sunday, August 19, 2012
Saturday, August 18, 2012
Vim: Binding :make and javac
Add the following to your .vimrc
filetype on
autocmd FileType java set makeprg=javac\ %
You can make .java files with :make command.
To view errors, try ":cope", ":ccl", ":cc", ":cn", ":cp", etc.
filetype on
autocmd FileType java set makeprg=javac\ %
You can make .java files with :make command.
To view errors, try ":cope", ":ccl", ":cc", ":cn", ":cp", etc.
Subscribe to:
Posts (Atom)