Neovim – 使用修补的 Nerdfont,但图标不起作用

huangapple go评论92阅读模式
英文:

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?

Neovim – 使用修补的 Nerdfont,但图标不起作用

Update 6/13/2023.

I think I am missing an icon set. Do you know where I can get these icons?

Neovim – 使用修补的 Nerdfont,但图标不起作用

答案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.

huangapple
  • 本文由 发表于 2023年6月12日 08:19:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/76453010.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定