haft.nvim
Neovim plugin for Haft CLI - bringing Spring Boot productivity tools directly into your editor with async commands, interactive Telescope pickers, and beautiful floating windows.
Features
- ✅ Full CLI Integration - All Haft commands available as
:Haft*commands - ✅ Async Execution - Non-blocking operations using plenary.nvim
- ✅ Telescope Pickers - Interactive dependency selection and browsing
- ✅ Floating Windows - Beautiful output for info, routes, and stats
- ✅ Auto-Open Files - Generated files automatically opened in buffers
- ✅ Quickfix Integration - Navigate generated files with quickfix list
- ✅ Project Detection - Automatic detection of Haft/Spring Boot projects
- ✅ Fully Configurable - Customize every aspect, no default keybindings
- ✅ Graceful Fallbacks - Works with or without Telescope
Quick Start
Install with lazy.nvim
{
"KashifKhn/haft.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim", -- optional but recommended
},
cmd = {
"HaftInfo", "HaftRoutes", "HaftStats",
"HaftAdd", "HaftRemove",
"HaftGenerateResource", "HaftGenerateController",
"HaftGenerateService", "HaftGenerateRepository",
"HaftGenerateEntity", "HaftGenerateDto",
},
opts = {},
}
Basic Usage
" Generate a complete CRUD resource
:HaftGenerateResource User
" Add dependencies with interactive picker
:HaftAdd
" View project information in floating window
:HaftInfo
" Show API routes
:HaftRoutes
What Makes It Different?
haft.nvim is a thin wrapper around the Haft CLI, adding:
| Feature | CLI | haft.nvim |
|---|---|---|
| Execution | Blocking terminal | ✅ Async (non-blocking) |
| Dependency Selection | TUI picker | ✅ Telescope picker |
| Output Display | Terminal output | ✅ Floating windows |
| File Opening | Manual | ✅ Auto-open in buffers |
| Navigation | - | ✅ Quickfix integration |
Note: All functionality (generation logic, detection, templates) comes from the CLI. The plugin provides convenience and enhanced UX. See CLI Commands to understand what each command does.
Requirements
Required
- Neovim >= 0.9.0
- Haft CLI >= 0.1.11
- plenary.nvim - Async utilities
Optional (Recommended)
- telescope.nvim - Interactive pickers (falls back to vim.ui.select)
- noice.nvim - Enhanced notifications
Getting Started
- Install the plugin → - Setup with lazy.nvim, packer, or vim-plug
- Configure options → - Customize behavior and UI
- Learn commands → - Command reference and workflows
- Troubleshoot → - Health checks and common issues
Example Workflow
Generate a new feature in seconds:
" 1. Generate CRUD resource
:HaftGenerateResource Product
" Output:
" ✓ Generated 8 files (ProductController, ProductService, etc.)
" ✓ Opened ProductController.java
" ✓ Added files to quickfix list
" 2. Navigate generated files
:cnext " ProductService.java
:cnext " ProductRepository.java
" 3. Add dependencies if needed
:HaftAdd
" Select 'validation' and 'mapstruct' from Telescope picker
Resources
- GitHub Repository: KashifKhn/haft.nvim
- Vim Help:
:help haft(after installation) - Health Check:
:checkhealth haft - Report Issues: GitHub Issues