A Neovim plugin that dims parentheses, brackets, and braces for better code clarity. Especially useful for Lisp-like languages where structural delimiters can overwhelm the actual code.
- Neovim 0.9+
termguicolorsenabled (:set termguicolors)- Treesitter parsers for your target languages (
:TSInstall lua python scheme racket)
Using lazy.nvim:
{
"usefulmove/dimparens.nvim",
ft = { "lua", "python", "scheme", "racket", "lisp" }, -- Load on these filetypes
opts = {
dim_weight = 0.5, -- 0 = background color, 1 = normal text color
languages = { "lua", "python", "scheme", "racket", "lisp" },
},
}For local development:
{
"dimparens.nvim",
dir = "/path/to/dimparens.nvim",
ft = { "lua", "python", "scheme" },
opts = {
languages = { "lua", "python", "scheme" },
},
}Default options:
require("dimparens").setup({
dim_weight = 0.5, -- Blend factor (0 = background, 1 = foreground)
highlight_group = "DimParens", -- Highlight group name
languages = { -- Languages to enable dimming for
"lua",
"scheme",
"racket",
"lisp",
"python",
"javascript",
"typescript",
},
})Controls how much the delimiters are dimmed:
0.0= Same color as background (invisible)0.5= Halfway between foreground and background (default)1.0= Same color as normal text (no dimming)
For aggressive dimming, try 0.2 or lower.
| Command | Description |
|---|---|
:DimParensToggle |
Toggle dimming on/off |
:DimParensStatus |
Show current state and debug info |
Make sure the Treesitter parser is installed:
:TSInstall python
:TSInstall scheme
:TSInstall racketEnsure termguicolors is enabled:
:set termguicolorsIf using event = "VeryLazy" in lazy.nvim, switch to ft = { ... }:
{
"usefulmove/dimparens.nvim",
ft = { "lua", "python" }, -- Instead of event = "VeryLazy"
opts = { ... },
}Run :DimParensStatus to see:
- Whether the plugin is enabled
- The current highlight color
- Number of extmarks in the current buffer
- Uses Treesitter to parse the buffer and identify delimiter tokens
- Creates extmarks with a dimmed highlight for each
(,),[,],{,} - The dimmed color is calculated by blending the Normal foreground toward the background
MIT