Skip to content

Customize Icons

AstroNvim aims to provide a unified and cohesive user experience which includes utilizing a common core set of icons which power the user interface. Here are some approaches to customize the user interface to fit your needs.

Disable Icons

Some users may want to disable icons across the entire user interface because they don’t like icons or simply because they are using a machine that is unable to install a nerd font for whatever reason. To assist with this use case we have added a new option to the AstroNvim setup, icons_enabled (default: true), that lets you disable the icons entirely and just have a text based user interface. To opt into this text based UI, it does require a user configuration setting the appropriate option. You want to add this to your AstroNvim opts table:

lua/lazy_setup.lua
require("lazy").setup({
{
"AstroNvim/AstroNvim",
version = "^4", -- Remove version tracking to elect for nighly AstroNvim
import = "astronvim.plugins",
opts = { -- AstroNvim options must be set here with the `import` key
icons_enabled = false, -- Set to false to disable icons (if no Nerd Font is available)
},
},
})

Customize User Interface Icons

AstroNvim uses a large set of icons across the entire user interface to maintain continuity between plugins and places where we display the same types of information. Because of this centralized icon management, we are able to allow the user to completely customize the user interface easily and let them change the icons in the icons table in the configuration of the AstroUI plugin. Here is an example plugin specification that sets all of the available user interface icons to what is currently the default in AstroNvim:

lua/plugins/astroui.lua
return {
"AstroNvim/astroui",
---@type AstroUIOpts
opts = {
icons = {
ActiveLSP = "",
ActiveTS = "",
ArrowLeft = "",
ArrowRight = "",
BufferClose = "󰅖",
DapBreakpoint = "",
DapBreakpointCondition = "",
DapBreakpointRejected = "",
DapLogPoint = ".>",
DapStopped = "󰁕",
DefaultFile = "󰈙",
Diagnostic = "󰒡",
DiagnosticError = "",
DiagnosticHint = "󰌵",
DiagnosticInfo = "󰋼",
DiagnosticWarn = "",
Ellipsis = "",
FileModified = "",
FileReadOnly = "",
FoldClosed = "",
FoldOpened = "",
FoldSeparator = " ",
FolderClosed = "",
FolderEmpty = "",
FolderOpen = "",
Git = "󰊢",
GitAdd = "",
GitBranch = "",
GitChange = "",
GitConflict = "",
GitDelete = "",
GitIgnored = "",
GitRenamed = "",
GitStaged = "",
GitUnstaged = "",
GitUntracked = "",
LSPLoaded = "",
LSPLoading1 = "",
LSPLoading2 = "󰀚",
LSPLoading3 = "",
MacroRecording = "",
Paste = "󰅌",
Search = "",
Selected = "",
Spellcheck = "󰓆",
TabClose = "󰅙",
},
},
}

Text Icons

If you have vim.g.icons_enabled = false, you can still customize the text based icons, but make modifications to the text_icons table similar to the icons described above:

lua/plugins/astroui.lua
return {
"AstroNvim/astroui",
---@type AstroUIOpts
opts = {
text_icons = {
ActiveLSP = "LSP:",
ArrowLeft = "<",
ArrowRight = ">",
BufferClose = "x",
DapBreakpoint = "B",
DapBreakpointCondition = "C",
DapBreakpointRejected = "R",
DapLogPoint = "L",
DapStopped = ">",
DefaultFile = "[F]",
DiagnosticError = "X",
DiagnosticHint = "?",
DiagnosticInfo = "i",
DiagnosticWarn = "!",
Ellipsis = "...",
FileModified = "*",
FileReadOnly = "[lock]",
FoldClosed = "+",
FoldOpened = "-",
FoldSeparator = " ",
FolderClosed = "[D]",
FolderEmpty = "[E]",
FolderOpen = "[O]",
GitAdd = "[+]",
GitChange = "[/]",
GitConflict = "[!]",
GitDelete = "[-]",
GitIgnored = "[I]",
GitRenamed = "[R]",
GitStaged = "[S]",
GitUnstaged = "[U]",
GitUntracked = "[?]",
MacroRecording = "Recording:",
Paste = "[PASTE]",
Search = "?",
Selected = "*",
Spellcheck = "[SPELL]",
TabClose = "X",
},
},
}

VS Code Style Icons

Recent versions of NERD fonts have added the VS Code icons which can be easily configured through AstroUI to achieve a similar interface to VS Code. Here is an example plugin specification that can be added to your user configuration:

lua/plugins/vscode_icons.lua
return {
{
"AstroNvim/astroui",
---@type AstroUIOpts
opts = {
icons = {
ActiveLSP = "",
ActiveTS = "",
BufferClose = "",
DapBreakpoint = "",
DapBreakpointCondition = "",
DapBreakpointRejected = "",
DapLogPoint = "",
DapStopped = "",
DefaultFile = "",
Diagnostic = "",
DiagnosticError = "",
DiagnosticHint = "",
DiagnosticInfo = "",
DiagnosticWarn = "",
Ellipsis = "",
FileModified = "",
FileReadOnly = "",
FoldClosed = "",
FoldOpened = "",
FolderClosed = "",
FolderEmpty = "",
FolderOpen = "",
Git = "",
GitAdd = "",
GitBranch = "",
GitChange = "",
GitConflict = "",
GitDelete = "",
GitIgnored = "",
GitRenamed = "",
GitStaged = "",
GitUnstaged = "",
GitUntracked = "",
LSPLoaded = "",
LSPLoading1 = "",
LSPLoading2 = "",
LSPLoading3 = "",
MacroRecording = "",
Paste = "",
Search = "",
Selected = "",
TabClose = "",
},
},
},
{
"onsails/lspkind.nvim",
opts = function(_, opts)
-- use codicons preset
opts.preset = "codicons"
-- set some missing symbol types
opts.symbol_map = {
Array = "",
Boolean = "",
Key = "",
Namespace = "",
Null = "",
Number = "",
Object = "",
Package = "",
String = "",
}
end,
},
}