vim.format

Format and lint Neovim Lua projects with conform.nvim and Luacheck.

4|Updated Sep 25, 2024
One-click install
npx skills add https://github.com/khulnasoft/init.lua --skill vim-format
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vim.format
Source: https://github.com/khulnasoft/init.lua/tree/main/skills/vim.format
Command: npx skills add https://github.com/khulnasoft/init.lua --skill vim-format

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Neovim users developing Lua projects face manual, error-prone formatting and inconsistent linting. This Skill integrates conform.nvim for formatting and Luacheck for static analysis, reducing setup complexity and speeding up iteration.

Core Features & Use Cases

  • Formatter integration with conform.nvim using stylua for Lua files.
  • Static analysis with Luacheck for Lua projects.
  • Config-driven workflow that can be customized per project and per filetype.

Quick Start

Install and configure conform.nvim and Luacheck, then format the current buffer with the provided API.

Frequently Asked Questions about vim.format

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format and lint Lua files in Neovim?

You can format and lint Lua in Neovim by integrating conform.nvim with stylua for formatting and Luacheck for static analysis. This provides consistent formatting and reliable lint checks across your codebase.

What is the best way to set up stylua in Neovim for Lua projects?

The best way to set up stylua in Neovim is through conform.nvim, which provides a config-driven workflow for formatter integration. This approach allows customization per project and per filetype for reliable formatting.

Does conform.nvim work with Luacheck for static analysis?

Yes, conform.nvim works alongside Luacheck for static analysis in Neovim Lua projects. While conform.nvim handles formatter integration with stylua, Luacheck provides the static analysis checks to reduce errors and speed up iteration.

Can I customize Lua formatting rules per project in Neovim?

Yes, you can customize Lua formatting rules per project in Neovim using the config-driven workflow. The setup supports per-project and per-filetype customization, ensuring consistent formatting across different Lua files.

Why does my Lua code need both a formatter and a linter in Neovim?

Lua code needs both a formatter and a linter because stylua handles code formatting consistency while Luacheck performs static analysis to catch errors. Together they reduce manual formatting errors and ensure code quality across Neovim projects.

Do I need to install Luacheck separately to lint Lua in Neovim?

Yes, you need to install Luacheck separately to lint Lua in Neovim. The setup steps specify installing and configuring both conform.nvim and Luacheck to ensure reliable formatting and lint checks across your Lua files.