我添加了
nvim-devicons
并安装了其中一种修补字体:
https://www.nerdfonts.com/font-downloads。
图标仍未显示,
使用加壳器进行配置:
https://github.com/kyazdani42/nvim-web-devicons
use({
"kyazdani42/nvim-tree.lua",
requires = {
"kyazdani42/nvim-web-devicons", -- optional, for file icons
},
})
这是我的此配置的 GitHub 存储库:
https://github.com/azizgharbi/Neovim-config
我应该安装所有图标吗?因为我只安装了其中一个图标,即
big blue terminal
。
我使用 macOS 并使用 iterm2。
确保将终端字体设置为使用修补字体。 要更改 iTerm2 中的字体:
升级我的发行版时遇到同样的问题。一直在使用 Nvim-Web-Devicons 和 lazy.nvim。
以下方法可能也适合您:
配置可能与下面类似,
# Font.
font_family FiraCode Nerd Font
bold_font FiraCode Nerd Bold
italic_font FiraCode Nerd Medium Italic
bold_italic_font FiraCode Nerd Bold Italic
font_size 12
如果没有像我的那样工作,那么尝试使用终端打开您安装了 nvim 插件的目录,最有可能的是
~/.local/share/nvim/lazy/nvim-web-devicons
并在该目录中运行 nvim,它可能会触发某种使其工作的事情。抱歉,我无法提供之前和之后的图像以供参考,并且服务器不允许我在撰写本文时上传。
我在 Ubuntu 22.04 上的 nvim 设置也遇到了同样的问题。 @Fady 的步骤通过一些额外的步骤效果很好:
# copy the downloaded `.otf` or `.ttf` files to system fonts directory.
sudo cp *.otf /usr/share/fonts/
# after copying fonts, refresh systems font cache by below command
sudo fc-cache -fv
之后,一旦您重新打开 nvim,您就应该可以看到按照这些步骤操作的图标。