Neovim plugin for initializing spring boot projects.
Note: After creating a project in the video, starting the jdtls and performing automatic completion operations is not what this plugin does. This plugin only creates a project. If you want to perform related completion operations, you can check the relevant documentation of jdtls
Although the environment for writing Java code in Intellij idea is already quite comprehensive, I prefer to do most of the work within the terminal or Neovim. After configuring jdtls, it was discovered that initializing the SpringBoot project may also occur in neovim, so this plugin was written. Because I am not a professional Java programmer, I have currently implemented a small portion of the functionality. More features may be listed in my TODO schedule.
- Generate a Maven/Gradle Spring Boot Project
- Customize configurations for a new project(use getpar function: language, java version, group id, artifact id, boot version and dependencies)
- Search for dependencies
- Quick generate project with last settings
- neovim >= 0.8
- nui.nvim is required
- telescope.nvim is required
- command
curlis required
Install it with your preferred package manager:
Note: Because the basic information for creating a springboot project may be obtained from the internet when starting the menu for the first time, it may get stuck, but after that, the information will be read from the cache file. Unless the cache is deleted.
{
'niT-Tin/springboot-start.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
'MunifTanjim/nui.nvim',
},
config = function()
require('springboot-start').setup({
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
})
end
}use {
'niT-Tin/springboot-start.nvim',
requires = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
'MunifTanjim/nui.nvim',
},
config = function()
require('springboot-start').setup({
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
})
end
}Note: Currently, there are not many optional configurations available. The following configuration is a partial UI configuration for the input box when inputting relevant parameters.
For more default configurations such as the Telescope option, confirm input, and other shortcut keys, please refer to Telescope.nvim default configuration.
For text input box, pressing <CR> to submit inputs and <C-c> close the window.
For more information, please refer to the nui.nvim documentation.
SpringBoot-start comes with the following defaults:
{
input = {
position = {
row = 20, -- One fifth of the current window row count
col = 20, -- Two fifths of the current window columns
},
size = {
width = 25,
height = 10,
},
border = {
style = "single",
text = {
top = "[Dep]", -- The text you want to place at the top of the input box
top_align = "center",
},
},
win_options = {
winhighlight = "Normal:Normal,FloatBorder:Normal",
},
prompt = "> "
},
}Please use :SpringBootStartMenu for the first startup, which will create some basic data cache files.
-
:SpringBootStartMenuSummary display of the plugin's functions.
-
:SpringBootGetDepSelect the dependencies that need to be added when creating a springboot project.
-
:SpringBootGetProjectTypeChoose the type of project to create when creating a springboot project.
-
:SpringBootGetParamModify or select the configuration information of the spring boot project when creating it.(Use default information if not modified)
-
:SpringBootChoseDirEnter the location where the project is stored.
-
:SpringBootShowDepDisplay the selected dependency items.
-
:SpringBootShowProjectTypeDisplay the selected project types.
-
:SpringBootShowParamDisplay Project Configuration.
-
:SpringBootShowSelectedDisplay all project options (type, configuration, creation location, dependencies).
-
:SpringBootCreateCreate project(also creating the cache file).
-
:SpringBootRemoveCacheRemove all cache files.
-
:SpringBootUpdateCacheUpdate all cache files with current selections.
-
:SpringBootShowLastDisplay all options and configurations for the previous project creation.
-
:SpringBootCreateLastCreate a project based on the previous configuration and options.
-
:SpringBootGetLastObtain the previous configuration and options for easy modification and re creation of the project.
-
:SpringBootDeleteDepDisplay the currently selected dependencies and provide deletion function.
-
:SpringBootCacheDirDisplay cache files location
The Lua API corresponds to the Vim command functionality one by one.
-- Summary display of the plugin's functions.
require('springboot-start').menu()-- Select the dependencies that need to be added when creating a springboot project.
require('springboot-start').getdep()-- Choose the type of project to create when creating a springboot project.
require('springboot-start').gettype()-- Modify or select the configuration information of the spring boot project when creating it.(Use default information if not modified)
require('springboot-start').getpara()-- Enter the location where the project is stored.
require('springboot-start').chose_dir()-- Display the selected dependency items.
require('springboot-start').show_dep()-- Display the selected project types.
require('springboot-start').show_rel()-- Display Project Configuration.
require('springboot-start').show_para()-- Display all project options (type, configuration, creation location, dependencies).
require('springboot-start').show_selected()-- Create project(also creating the cache file).
require('springboot-start').create_project()-- Remove all cache files.
require('springboot-start').remove_cache()-- Update all cache files.
require('springboot-start').update_cache()-- Display all options and configurations for the previous project creation.
require('springboot-start').show_last_selected()-- Create a project based on the previous configuration and options.
require('springboot-start').create_last()-- Obtain the previous configuration and options for easy modification and re creation of the project.
require('springboot-start').get_last()-- Display the currently selected dependencies and provide deletion function.
require('springboot-start').delete_dep()-- Display cache files location
require('springboot-start').cache_dir()