Creating new classes in Vim is a bit clunky. You first have to create an empty file/buffer, then fill in the boilerplace public class <name> { ..., and then the package statement. Yuck.
We can make this a bit easier. In an empty buffer, :JavaNew [<class,enum>] [<class name>]. If a class name isn't given, prompt for it in a popup. We can also try to offer some package statement suggestions based on the path of the file/buffer. For example, if the file is /home/user/project/src/main/java/com/me/HelloWorld.java, we may offer:
Creating new classes in Vim is a bit clunky. You first have to create an empty file/buffer, then fill in the boilerplace
public class <name> { ...
, and then the package statement. Yuck.We can make this a bit easier. In an empty buffer,
:JavaNew [<class,enum>] [<class name>]
. If a class name isn't given, prompt for it in a popup. We can also try to offer some package statement suggestions based on the path of the file/buffer. For example, if the file is/home/user/project/src/main/java/com/me/HelloWorld.java
, we may offer:package me;
package com.me;
package java.com.me;