Skip to main content

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:

FeatureCLIhaft.nvim
ExecutionBlocking terminal✅ Async (non-blocking)
Dependency SelectionTUI picker✅ Telescope picker
Output DisplayTerminal output✅ Floating windows
File OpeningManual✅ 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

Getting Started

  1. Install the plugin → - Setup with lazy.nvim, packer, or vim-plug
  2. Configure options → - Customize behavior and UI
  3. Learn commands → - Command reference and workflows
  4. 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

Next Steps