Neovim

📘 The Trunk Code Quality Neovim Plugin is available for beta!

Try it out by following the instructions below.

Prerequisites

The Neovim Plugin needs the following prerequisites:

Tool
Minimum Required Version

CLI

1.17.0

Neovim

v0.9.2

Get Started

Using the lazy.nvim plugin manager:

require("lazy").setup({
	{
		"trunk-io/neovim-trunk",
		lazy = false,
		-- optionally pin a version
		tag = "v0.1.3",
		-- these are optional config arguments (defaults shown)
		config = {
			-- trunkPath = "trunk",
			-- lspArgs = {},
			-- formatOnSave = true,
                        -- formatOnSaveTimeout = 10, -- seconds
			-- logLevel = "info"
		},
		main = "trunk",
		dependencies = {"nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim"}
	}
})

For other plugin managers and installation methods, see our Neovim Plugin repo.

Features

The Neovim Plugin is designed to mirror the VSCode extension. Supported features include:

  • Provide inline diagnostics and auto-fixes

  • Format files on save

  • Run Trunk Actions notifications

  • Display the linters that Trunk runs on a file

Limitations

The Trunk Code Quality Neovim Plugin is in beta with limited support. If you encounter any issues, feel free to reach out on Slack.

For other notes and configuration, see the Neovim Plugins repo.

Last updated