首页 > 解决方案 > NeoVim vim-devicons 未在 Windows 终端 (PowerShell) 中加载

问题描述

我正在从 Windows Terminal Powershell 运行 Neovim (nvim),并且最近通过 vim-plug 安装了 vim-devicons。我注意到图标没有显示。在我的 Windows 终端配置中,我使用 Cascadia Code PL 显示 Oh-my-posh 和 posh-my-git 所需的字体,但是即使具有明显有能力的字体 neovim 也不会显示它。但是,如果我打开 nvim-qt 它确实可以工作(也许它不包括自己的终端仿真器)。有什么方法可以调整 neovim 中的配置以在 Windows 终端中正确显示 vim-devicons?

这是我的profile.json:

{
      // Make changes here to the powershell.exe profile
      "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
      "name": "Windows PowerShell",
      "commandline": "powershell.exe",
      "fontFace": "Cascadia Code PL",
      "fontSize": 9,
      "useAcrylic": true,
      "acrylicOpacity": 0.7,
      "backgroundImage": "ms-appdata:///roaming/midnight_smuggler_1280x720.jpg",
      "backgroundImageOpacity": 0.4,
      "colorScheme": "cyberpunk",
      "hidden": false
    },

还有我的本地 nvim 配置:

"Plugin Section
call plug#begin('~/.vim/plugged')
   Plug 'scrooloose/nerdtree'
   Plug 'ryanoasis/vim-devicons'
call plug#end()


"Config
set encoding=UTF-8
"set guifont=
let g:NERDTreeShowHidden = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeIgnore = []
let g:NERDTreeStatusline = ''
" Automaticaly close nvim if NERDTree is only thing left open
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" Toggle
 nnoremap <silent> <C-b> :NERDTreeToggle<CR>

标签: powershellneovimnerdtree

解决方案


刚刚发现我使用的是 Cascadia Code PL,它只有足够的字形用于 Oh-my-posh,只是配置了 Delugia Nerd Font 和 Windows 终端显示图标。


推荐阅读