Skip to main content

Language-Specific Setup

Each language entry shows what to configure and what extras to enable. For most languages, enabling the extra is all you need.

Quick Start​

For any language, enable the corresponding extra and optionally configure formatters/linters:

lua/plugins/extras.lua
return {
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.go" },
{ import = "lazyvim.plugins.extras.lang.markdown" },
}

Then configure formatters per filetype:

lua/plugins/formatting.lua
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
python = { "black" },
javascript = { "prettier" },
typescript = { "prettier" },
-- etc.
},
},
}

Python​

Enable​

lua/plugins/extras.lua
return {
{ import = "lazyvim.plugins.extras.lang.python" },
}

Components​

ComponentToolPurpose
LSPpyright or ruffAutocompletion, type checking, diagnostics
Formatterblack, isortCode formatting
Linterruff, flake8Code linting (nvim-lint)
DAPdebugpyDebugging
Treesitterpython parserSyntax highlighting

Verify​

:LspInfo " Should show pyright or ruff
:Mason " Check pyright/ruff is installed
:ConformInfo " Check black formatter

Formatter Configuration​

lua/plugins/formatting.lua
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
python = { "isort", "black" },
},
},
}

Project Files​

LazyVim auto-detects Python projects by looking for:

  • pyproject.toml
  • setup.py
  • setup.cfg
  • .python-version

TypeScript / JavaScript​

Enable​

lua/plugins/extras.lua
return {
{ import = "lazyvim.plugins.extras.lang.typescript" },
}

Components​

ComponentToolPurpose
LSPvtsls (or tsserver)IntelliSense, refactoring, diagnostics
FormatterprettierCode formatting
LintereslintCode linting
Treesittertypescript, tsx, javascriptSyntax highlighting

Verify​

:LspInfo " Should show vtsls or tsserver
:Mason " Check vtsls/tsserver installed

Organize Imports​

<leader>co " Organize imports (only available with vtsls)

Formatting with Prettier​

lua/plugins/formatting.lua
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
json = { "prettier" },
},
},
}

Or enable the formatting extra:

{ import = "lazyvim.plugins.extras.formatting.prettier" },

ESLint Integration​

{ import = "lazyvim.plugins.extras.linting.eslint" },

Project Files​

Auto-detected by:

  • package.json (with typescript or @typescript-eslint in dependencies)
  • tsconfig.json
  • .eslintrc.*

Lua​

Lua support is built into LazyVim by default. No extra needed.

Components​

ComponentToolPurpose
LSPlua_ls (LuaLS)Autocompletion, diagnostics, type checking
FormatterstyluaCode formatting
Linterselene (optional)Code linting
Treesitterlua, luadoc, luapSyntax highlighting

Verify​

:LspInfo " Should show lua_ls
:Mason " Check stylua installed

Config Autocompletion​

When editing your Neovim config (~/.config/nvim/), lazydev.nvim provides autocompletion for LazyVim, Snacks, vim.* APIs, and all your installed plugins.

Format Lua with StyLua​

Default formatter for .lua files — no extra config needed.

Project Files​

Auto-detected by:

  • lua/ directory in project root
  • *.lua files

Bash / Shell​

Enable​

lua/plugins/extras.lua
return {
{ import = "lazyvim.plugins.extras.lang.sh" },
}

Components​

ComponentToolPurpose
LSPbashlsAutocompletion, syntax errors
FormattershfmtShell script formatting
Lintershellcheck or bashateShell script linting
Treesitterbash, regex, printfSyntax highlighting

Verify​

:LspInfo " Should show bashls
:Mason " Check bashls, shellcheck, shfmt installed

Format with shfmt​

lua/plugins/formatting.lua
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
sh = { "shfmt" },
bash = { "shfmt" },
zsh = { "shfmt" },
},
formatters = {
shfmt = { prepend_args = { "-i", "2", "-ci" } },
},
},
}

Lint with shellcheck​

lua/plugins/lint.lua
return {
"mfussenegger/nvim-lint",
opts = {
linters_by_ft = {
sh = { "shellcheck" },
bash = { "shellcheck" },
},
},
}

Docker​

Enable​

lua/plugins/extras.lua
return {
{ import = "lazyvim.plugins.extras.lang.docker" },
}

Components​

ComponentToolPurpose
LSPdockerlsDockerfile autocompletion
LSPdocker_compose_language_serviceCompose file support
TreesitterdockerfileSyntax highlighting

Verify​

:LspInfo " Should show dockerls
:Mason " Check dockerls installed

Key Features​

  • Autocompletion for Dockerfile instructions (FROM, RUN, CMD, COPY, etc.)
  • Syntax highlighting for Dockerfiles
  • Completion for image names, arguments, and labels

YAML​

Enable​

lua/plugins/extras.lua
return {
{ import = "lazyvim.plugins.extras.lang.yaml" },
}

Components​

ComponentToolPurpose
LSPtaploYAML validation, schema support
TreesitteryamlSyntax highlighting

Verify​

:LspInfo " Should show taplo
:Mason " Check taplo installed

Schema Support​

taplo supports YAML schema validation. It automatically detects schemas for common files:

  • docker-compose.yml
  • .github/workflows/*.yml
  • mkdocs.yml
  • pre-commit-config.yaml

Formatting​

YAML is formatted via LSP's built-in formatter. Use <leader>cf to format.


PHP​

Enable​

lua/plugins/extras.lua
return {
{ import = "lazyvim.plugins.extras.lang.php" },
}

Components​

ComponentToolPurpose
LSPintelephense or phpactorAutocompletion, diagnostics, refactoring
Formatterphp-cs-fixerCode formatting
Linter (optional)phpstanStatic analysis
TreesitterphpSyntax highlighting

Verify​

:LspInfo " Should show intelephense or phpactor
:Mason " Check intelephense installed

Format with php-cs-fixer​

lua/plugins/formatting.lua
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
php = { "php_cs_fixer" },
},
},
}

Project Files​

Auto-detected by:

  • composer.json
  • .php-cs-fixer.php / .php-cs-fixer.dist.php

Markdown​

Enable​

lua/plugins/extras.lua
return {
{ import = "lazyvim.plugins.extras.lang.markdown" },
}

Components​

ComponentToolPurpose
LSPmarksman or markdown-oxideLink completion, references
Formatterprettier or markdownlintTable formatting, linting
LintermarkdownlintStyle checking
Treesittermarkdown, markdown_inlineSyntax highlighting
PreviewBuilt-in markdown previewSee rendered output

Verify​

:LspInfo " Should show marksman
:Mason " Check marksman installed

Markdown-Specific Behavior​

LazyVim enables line wrap and spell check automatically for markdown:

-- These are set by default via autocmds
vim.opt_local.wrap = true
vim.opt_local.spell = true

Toggle them if needed:

<leader>uw ← Toggle wrap
<leader>us ← Toggle spell check

Format with Prettier​

lua/plugins/formatting.lua
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
markdown = { "prettier" },
},
},
}

Code Blocks in Markdown​

When editing fenced code blocks in markdown, LSP for the block's language is used inside the block. For example, inside a ```python block, you get Python LSP features.


Language Extra Reference​

LanguageExtra PathLSPFormatterLinter
Pythonlang.pythonruff/pyrightblackruff/flake8
TypeScriptlang.typescriptvtslsprettiereslint
Rustlang.rustrust-analyzerrustfmtclippy
Golang.gogoplsgofumptgolangci-lint
Luabuilt-inlua_lsstylua—
Bashlang.shbashlsshfmtshellcheck
Dockerlang.dockerdockerls——
YAMLlang.yamltaploLSP format—
PHPlang.phpintelephensephp-cs-fixerphpstan
Markdownlang.markdownmarksmanprettiermarkdownlint
JSONlang.jsonjsonlsprettier—
TOMLlang.tomltaplotaplo—
SQLlang.sqlsqlls—sqlfluff
Vuelang.vuevolarprettiereslint
Sveltelang.sveltesvelteprettiereslint
Javalang.javajdtls——