- Universal Support: Works with any colorscheme by dynamically modifying highlight groups.
- Granular Control: Toggle transparency and italics independently.
- Persistent State: Remembers your toggle state even if you reload the theme.
- Highly Configurable: Easily add or exclude specific syntax groups.
Using lazy.nvim (Recommended)
{
"adityastomar67/italicize",
event = "ColorScheme", -- Load when colorscheme changes
config = function()
require("italicize").setup({
transparency = true,
italics = false,
})
end
}Using packer.nvim
use {
"adityastomar67/italicize",
config = function ()
require("italicize").setup()
end
}You can pass a table to the setup() function to override defaults.
require("italicize").setup({
-- Default Toggles
transparency = false, -- Enable transparent background by default
italics = false, -- Enable italics by default
-- Exclusions (Groups to ignore)
exclude_transparency_group = { "CursorLine", "Search" },
exclude_italics_group = { "Type" },
-- Overrides (Add your own groups here)
italics_groups = { "CustomGroup", "AnotherGroup" },
transparent_groups = { "NvimTreeNormal" }
})The plugin comes pre-configured with a comprehensive list of groups for standard syntax, TreeSitter, and popular plugins (Telescope, NvimTree, GitSigns, etc.).
Click to view default Italic Groups
italics_groups = {
"Comment",
"Conditional",
"Identifier",
"SpecialChar",
"SpecialComment",
"String",
"Todo",
"CmpItemKind",
-- TreeSitter / Modern Highlights
"@comment",
"@conditional",
"@keyword",
"@variable",
-- ... and many more
}Click to view default Transparent Groups
transparent_groups = {
"Normal",
"NormalNC",
"NormalFloat",
"FloatBorder",
"LineNr",
"SignColumn",
"EndOfBuffer",
"MsgArea",
"NvimTreeNormal",
"TelescopeNormal",
"WhichKeyFloat",
-- ... and many more
}The plugin provides user commands to toggle effects on the fly.
| Command | Description |
|---|---|
:TransparentToggle |
Toggle transparency on/off. |
:TransparentEnable |
Force transparency on. |
:TransparentDisable |
Force transparency off. |
:ItalicsToggle |
Toggle italics on/off. |
:ItalicsEnable |
Force italics on. |
:ItalicsDisable |
Force italics off. |
You can map these commands in your init.lua for quick access:
vim.keymap.set('n', '<leader>tt', '<cmd>TransparentToggle<cr>', { desc = "Toggle Transparency" })
vim.keymap.set('n', '<leader>ti', '<cmd>ItalicsToggle<cr>', { desc = "Toggle Italics" }) Built with ❤️ for Neovim