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:
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:
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
python = { "black" },
javascript = { "prettier" },
typescript = { "prettier" },
-- etc.
},
},
}
Python
Enable
return {
{ import = "lazyvim.plugins.extras.lang.python" },
}
Components
| Component | Tool | Purpose |
|---|---|---|
| LSP | pyright or ruff | Autocompletion, type checking, diagnostics |
| Formatter | black, isort | Code formatting |
| Linter | ruff, flake8 | Code linting (nvim-lint) |
| DAP | debugpy | Debugging |
| Treesitter | python parser | Syntax highlighting |
Verify
:LspInfo " Should show pyright or ruff
:Mason " Check pyright/ruff is installed
:ConformInfo " Check black formatter
Formatter Configuration
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
python = { "isort", "black" },
},
},
}
Project Files
LazyVim auto-detects Python projects by looking for:
pyproject.tomlsetup.pysetup.cfg.python-version
TypeScript / JavaScript
Enable
return {
{ import = "lazyvim.plugins.extras.lang.typescript" },
}
Components
| Component | Tool | Purpose |
|---|---|---|
| LSP | vtsls (or tsserver) | IntelliSense, refactoring, diagnostics |
| Formatter | prettier | Code formatting |
| Linter | eslint | Code linting |
| Treesitter | typescript, tsx, javascript | Syntax 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
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(withtypescriptor@typescript-eslintin dependencies)tsconfig.json.eslintrc.*
Lua
Lua support is built into LazyVim by default. No extra needed.
Components
| Component | Tool | Purpose |
|---|---|---|
| LSP | lua_ls (LuaLS) | Autocompletion, diagnostics, type checking |
| Formatter | stylua | Code formatting |
| Linter | selene (optional) | Code linting |
| Treesitter | lua, luadoc, luap | Syntax 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*.luafiles
Bash / Shell
Enable
return {
{ import = "lazyvim.plugins.extras.lang.sh" },
}
Components
| Component | Tool | Purpose |
|---|---|---|
| LSP | bashls | Autocompletion, syntax errors |
| Formatter | shfmt | Shell script formatting |
| Linter | shellcheck or bashate | Shell script linting |
| Treesitter | bash, regex, printf | Syntax highlighting |
Verify
:LspInfo " Should show bashls
:Mason " Check bashls, shellcheck, shfmt installed
Format with shfmt
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
sh = { "shfmt" },
bash = { "shfmt" },
zsh = { "shfmt" },
},
formatters = {
shfmt = { prepend_args = { "-i", "2", "-ci" } },
},
},
}
Lint with shellcheck
return {
"mfussenegger/nvim-lint",
opts = {
linters_by_ft = {
sh = { "shellcheck" },
bash = { "shellcheck" },
},
},
}
Docker
Enable
return {
{ import = "lazyvim.plugins.extras.lang.docker" },
}
Components
| Component | Tool | Purpose |
|---|---|---|
| LSP | dockerls | Dockerfile autocompletion |
| LSP | docker_compose_language_service | Compose file support |
| Treesitter | dockerfile | Syntax 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
return {
{ import = "lazyvim.plugins.extras.lang.yaml" },
}
Components
| Component | Tool | Purpose |
|---|---|---|
| LSP | taplo | YAML validation, schema support |
| Treesitter | yaml | Syntax 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/*.ymlmkdocs.ymlpre-commit-config.yaml
Formatting
YAML is formatted via LSP's built-in formatter. Use <leader>cf to format.
PHP
Enable
return {
{ import = "lazyvim.plugins.extras.lang.php" },
}
Components
| Component | Tool | Purpose |
|---|---|---|
| LSP | intelephense or phpactor | Autocompletion, diagnostics, refactoring |
| Formatter | php-cs-fixer | Code formatting |
| Linter (optional) | phpstan | Static analysis |
| Treesitter | php | Syntax highlighting |
Verify
:LspInfo " Should show intelephense or phpactor
:Mason " Check intelephense installed
Format with php-cs-fixer
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
return {
{ import = "lazyvim.plugins.extras.lang.markdown" },
}
Components
| Component | Tool | Purpose |
|---|---|---|
| LSP | marksman or markdown-oxide | Link completion, references |
| Formatter | prettier or markdownlint | Table formatting, linting |
| Linter | markdownlint | Style checking |
| Treesitter | markdown, markdown_inline | Syntax highlighting |
| Preview | Built-in markdown preview | See 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
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
| Language | Extra Path | LSP | Formatter | Linter |
|---|---|---|---|---|
| Python | lang.python | ruff/pyright | black | ruff/flake8 |
| TypeScript | lang.typescript | vtsls | prettier | eslint |
| Rust | lang.rust | rust-analyzer | rustfmt | clippy |
| Go | lang.go | gopls | gofumpt | golangci-lint |
| Lua | built-in | lua_ls | stylua | — |
| Bash | lang.sh | bashls | shfmt | shellcheck |
| Docker | lang.docker | dockerls | — | — |
| YAML | lang.yaml | taplo | LSP format | — |
| PHP | lang.php | intelephense | php-cs-fixer | phpstan |
| Markdown | lang.markdown | marksman | prettier | markdownlint |
| JSON | lang.json | jsonls | prettier | — |
| TOML | lang.toml | taplo | taplo | — |
| SQL | lang.sql | sqlls | — | sqlfluff |
| Vue | lang.vue | volar | prettier | eslint |
| Svelte | lang.svelte | svelte | prettier | eslint |
| Java | lang.java | jdtls | — | — |