A vim plugin to be used on Java & Maven projects...
This is a vim plugin I am trying to create.
It has an old story and I do not maintain it actively.
The reason is that I cannot have the same experience I have at the moment with others IDE.
Anyway I leave it here as a learning process for someone who wants to understand how I made
something (DISCLAIMER: probably I made it wrong :D).
Java
,Maven
,sed
andxmllint
: it executes some commands usingmaven
. For example, in order to understand the source and test directories and then configure thealternate.vim
pluginctags
: to generate tags (can be disabled definingg:javamaven_skip_tags
)- alternate.vim: setup alternate commands
- open.vim: setup commands to open alternate, etc...
- Allow code navigation using
Ctrl-]
(only ifctags
is left enabled) - Allow code navigation using
gf
(WARNING: I need to fix a bug happening when a directory has the same name of the java object) - Caches project data so that the 2nd time you open a file it is very fast. It re-generates project data if the
pom.xml
is updated - Provide the following commands:
:A
: open in a new buffer the related test (the alternate):AV
: open it in a vertical window:AS
: open it in a horizontal window
:MvnTest
: run the related test:Mvn
: execute the command specified after it
- Give error if the
JAVA_HOME
env variable is not set - FIX BUG: if the dependency has to be downloaded the filtered rows read "Downloading etc..." and the b:classpath is broken. You need then to remove the cached dir and rerun again the tool
- Check if
vim-javacomplete2
is installed and setup the properties accordingly (works only with JDK 1.8) gf
opening also Java files: it works, but I need to create a custom function to avoid vim prioritize directories over files- Try to read the java version configured in pom.xml in order to check if the JDK is correct or (for example) to fail if the software requires a JDK with v > 1.8
- add also
Javac
,Java
command using the configuredclasspath
: this could be handy to speed up test execution and lint verification :autocmd BufNewFile *.java 0r ~/vim/skeleton.java
should create a file buffer having the package name correctly setup for the current directory in relation to the base pom root- configure abbreviations such as
sout
forSystem.out.println
- ophinity :: papers :: java and vim: an article containing some tips & tricks with Java and vim