Neovim:缺少nvim-tree-web-devicons的图标

发布于 2025-02-13 20:16:45 字数 965 浏览 1 评论 0原文

我添加了nvim-devicons并安装了一个修补的字体:

https:// .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 Repo此配置:

https://github.com/azizizgharbi/neovim-config

我应该安装所有图标吗?因为我只安装了其中一个图标,即Big Blue终端

我在MacOS上使用ITERM2。

I added nvim-devicons and installed one of the patched fonts:

https://www.nerdfonts.com/font-downloads.

the icons still not showing,

enter image description here

Config with packer:

https://github.com/kyazdani42/nvim-web-devicons

use({
    "kyazdani42/nvim-tree.lua",
    requires = {
        "kyazdani42/nvim-web-devicons", -- optional, for file icons
    },
})

This is my GitHub repo for this config:

https://github.com/azizgharbi/Neovim-config

Should i install all the icons ? because i only installed one of those icons which is big blue terminal.

I am on macOs and using iterm2.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

拥醉 2025-02-20 20:16:45

确保将终端字体设置为使用修补字体。
更改iterm2中的字体:

  1. start iterm2。
  2. 单击ITERM2→首选项→配置文件→文本。
  3. 选择右侧的修补字体。

Make sure to set the terminal font to use the patched font.
To change the font in iTerm2:

  1. Start iTerm2.
  2. Click iTerm2 → Preferences → Profiles → Text.
  3. Choose the patched font on the right.
唔猫 2025-02-20 20:16:45

我在Ubuntu 22.04上的NVIM设置也遇到了同样的问题。 @fady的步骤效果很好:

  • 下载最新的 nerd fonts
  • 安装字体:
     ##复制下载的`.otf`或`.ttf`文件添加到系统字体目录。
    sudo cp *.otf/usr/share/fonts/
    
    #复制字体后,刷新系统字体缓存通过以下命令
    sudo fc -cache -fv
     
  • 现在,您通过选择一种修补的字体来设置Teminal字体。

之后,一旦重新打开NVIM,就应该看到这些步骤图标。

I also faced the same issue with my nvim setup on Ubuntu 22.04. @Fady's steps worked great with some extra steps:

  • Download one of the latest Nerd Fonts.
  • Install fonts:
    # 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
    
  • Now, you shoud set teminal font by choosing one of the patched fonts.

After, folllowing these steps icons should be visible to you once you reopen your nvim.

余生一个溪 2025-02-20 20:16:45

升级我的发行版时也遇到了同样的问题。一直在使用 nvim-web-devicons 带有懒惰
以下方法也可能对您有用:

  1. 安装支持图标显示的书呆子字体的修补版本。 也许可以尝试一些适合您的地方。
  2. 检查终端是否设置为使用字体您已经在配置中下载了。

该配置可能看起来与下面的配置相似,

# 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
  1. 实际上检查您使用的终端是否支持Unicode字符,如果提供了字体。

如果没有什么比我的工作,请尝试使用终端打开您已安装了NVIM插件的目录,很可能很可能〜/.local/.local/share/nvim/lazy/nvim-web-devicons and code> and code>在该目录内运行NVIM,它可能会触发使其正常工作的某种东西。抱歉,我无法在图像之前和之后提供参考,并且服务器都不会让我上传作为编写时间上传。

Got the same issue when upgraded my distro. Have been using Nvim-Web-Devicons with lazy.nvim.
The following methods might work for you too:

  1. Install a patched version of Nerd Font that supports icon display. Maybe try some from here that suits you best.
  2. Check if your terminal is set to use the font that you have downloaded in the config.

The config might look similar to this below,

# 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
  1. Actually check if the terminal that you are using supports display of unicode characters if font provided.

If nothing works like mine, then try using the terminal to open the directory that you have installed the plugin for nvim, most probably ~/.local/share/nvim/lazy/nvim-web-devicons and run nvim inside that directory and it might trigger some sort of thing that makes it work. Sorry I couldn't provide before and after images for reference and the server won't let me upload either as time of writing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文