英文:
Neovim - using patched nerdfont but icon not working
问题
I am using neovim 0.9. I liked JetBrains Mono font so I downloaded the nerd font patched JetBrains font and installed it on my Linux Mint 21.1. All is well except when there is an error, neovim displays this weird icon if the linter/checker gets an error.
How can I fix this?
Update 6/13/2023.
I think I am missing an icon set. Do you know where I can get these icons?
英文:
I am using neovim 0.9. I liked JetBrains Mono font so I downloaded the nerd font patched JetBrains font and installed on my Linux Mint 21.1. All is well except when there is an error, neovim displays this weird icon if the linter/checker gets an error.
How can I fix this?
Update 6/13/2023.
I think I am missing an icon set. Do you know where I can get these icons?
答案1
得分: 1
为了显示图标的检查器/ LSP 消息,您可以配置 Neovim 诊断。
我为错误、警告、提示和信息使用图标的 Neovim Lua 配置:
-- 诊断配置
local signs = {
{ name = 'DiagnosticSignError', text = '' },
{ name = 'DiagnosticSignWarn', text = '' },
{ name = 'DiagnosticSignHint', text = '' },
{ name = 'DiagnosticSignInfo', text = '' },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = '' })
end
local config = {
signs = {
active = signs, -- 显示标志
},
update_in_insert = false,
underline = true,
severity_sort = true,
float = {
focusable = true,
style = 'minimal',
border = 'single',
source = 'always',
header = 'Diagnostic',
prefix = '',
},
}
vim.diagnostic.config(config)
英文:
To display icons linter/checker/LSP messages, you could configure Neovim diagnostics.
My Neovim Lua configuration for diagnostic with icons for Error, Warn, Hint, Info:
-- Configuration for diagnostics
local signs = {
{ name = 'DiagnosticSignError', text = '' },
{ name = 'DiagnosticSignWarn', text = '' },
{ name = 'DiagnosticSignHint', text = '' },
{ name = 'DiagnosticSignInfo', text = '' },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = '' })
end
local config = {
signs = {
active = signs, -- show signs
},
update_in_insert = false,
underline = true,
severity_sort = true,
float = {
focusable = true,
style = 'minimal',
border = 'single',
source = 'always',
header = 'Diagnostic',
prefix = '',
},
}
vim.diagnostic.config(config)
答案2
得分: 1
回答自己的问题。我已安装了字体管理应用程序。它显示了所有附加到Nerd字体的图标。我选择了一些并复制/粘贴到文件中。现在它正在运行。
英文:
Answering my own question. I've installed the font manager app. it shows all icons attached to the nerd font. I've picked few and copy / paste into the file. It's working now.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论