ms-jpq / chadtree

File manager for Neovim. Better than NERDTree.
1.62k stars 59 forks source link

No icons on GUI? #259

Open vinoff opened 2 years ago

vinoff commented 2 years ago

I have chadtree properly installed and I do see icons (filetype icons) on terminal neovim. However, on neovim-qt, I don't. This is what I have:

chadtree_icons

The weird thing is that on one of my PCs, with exactly the same setup (ish?), I have it working properly. How do I go about figuring out what's happening?

Here is the output of pacman -Qs font:

❯ pacman -Qs font 
local/adobe-source-code-pro-fonts 2.038ro+1.058it+1.018var-1
    Monospaced font family for user interface and coding environments
local/awesome-terminal-fonts 1.1.0-4
    fonts/icons for powerlines
local/cantarell-fonts 1:0.303-1
    Humanist sans serif font
local/fluidsynth 2.2.3-1 (pro-audio)
    A real-time software synthesizer based on the SoundFont 2 specifications
local/fontconfig 2:2.13.94-1
    Library for configuring and customizing font access
local/freetype2 2.11.0-4
    Font rasterization library
local/gnu-free-fonts 20120503-8
    A free family of scalable outline fonts
local/gsfonts 20200910-2
    (URW)++ base 35 font set
local/libfontenc 1.1.4-3
    X11 font encoding library
local/libxfont2 2.0.5-1
    X11 font rasterisation library
local/libxft 2.3.4-1
    FreeType-based font drawing library for X
local/noto-fonts 20201226-2
    Google Noto TTF fonts
local/noto-fonts-cjk 20201206-3
    Google Noto CJK fonts
local/otf-font-awesome 5.15.4-1
    Iconic font designed for Bootstrap
local/powerline-fonts 2.8.2-2
    patched fonts for powerline
local/t1lib 5.1.2-8
    Library for generating character- and string-glyphs from Adobe Type 1 fonts
local/ttf-bitstream-vera 1.10-14
    Bitstream Vera fonts.
local/ttf-caladea 20200113-3
    A serif font family metric-compatible with Cambria font family
local/ttf-carlito 20130920-6
    Google's Carlito font
local/ttf-croscore 20201226-2
    Chrome OS core fonts
local/ttf-dejavu 2.37+18+g9b5d1b2f-3
    Font family based on the Bitstream Vera Fonts with a wider range of characters
local/ttf-font-awesome 5.15.4-1
    Iconic font designed for Bootstrap
local/ttf-iosevka-nerd 2.1.0-1
    Typeface family designed for coding, terminal use and technical documents (Nerd Fonts)
local/ttf-liberation 2.1.5-1
    Font family which aims at metric compatibility with Arial, Times New Roman, and Courier New
local/ttf-nerd-fonts-symbols 2.1.0+36+gd0bf73a1-4
    High number of extra glyphs from popular 'iconic fonts' (2048-em)
local/ttf-ubuntu-font-family 0.83-7
    Ubuntu font family
local/woff2 1.0.2-3
    Web Open Font Format 2 reference implementation
local/xorg-bdftopcf 1.1-2 (xorg xorg-apps)
    Convert X font from Bitmap Distribution Format to Portable Compiled Format
local/xorg-font-util 1.3.2-2 (xorg-fonts xorg)
    X.Org font utilities
local/xorg-font-utils 7.6-6
    Transitional package depending on xorg font utilities
local/xorg-fonts-encodings 1.0.5-2 (xorg-fonts xorg)
    X.org font encoding files
local/xorg-mkfontscale 1.2.1-2 (xorg-apps xorg)
    Create an index of scalable font files for X
DreamingRaven commented 2 years ago

I have the exact OPPOSITE of your problem. Maybe we can figure out what we have that the other is missing? I am using Fira mono for my terminal not sure if that makes any difference. Here are my configs and a screenie to show the opposite scenario so you can take a look. Im also not sure if you also have this, but I have used vimPlug to install some additional symbols. I really should install them system wide instead for the sake of consistency.

image Figure: Top nvim-qt, bottom nvim. I haven't configured nvim-qt almost at all.

System Installed fonts

 sudo pacman -Qs font
local/adobe-source-code-pro-fonts 2.038ro+1.058it+1.018var-1
    Monospaced font family for user interface and coding environments
local/cantarell-fonts 1:0.303.1-1
    Humanist sans serif font
local/fontconfig 2:2.13.94-1
    Library for configuring and customizing font access
local/freetype2 2.11.1-1
    Font rasterization library
local/gnu-free-fonts 20120503-8
    A free family of scalable outline fonts
local/gsfonts 20200910-2
    (URW)++ base 35 font set
local/lib32-fontconfig 2:2.13.94-1
    Library for configuring and customizing font access
local/lib32-freetype2 2.11.1-1
    Font rasterization library (32-bit)
local/lib32-libxft 2.3.4-1
    FreeType-based font drawing library for X (32-bit)
local/lib32-sdl2_ttf 2.0.15-1
    Library that allows you to use TrueType fonts in your SDL applications (Version 2) (32-bit)
local/lib32-sdl_ttf 2.0.11-5
    A library that allows you to use TrueType fonts in your SDL applications (32-bit)
local/libfontenc 1.1.4-3
    X11 font encoding library
local/libxfont2 2.0.5-1
    X11 font rasterisation library
local/libxft 2.3.4-1
    FreeType-based font drawing library for X
local/nerd-fonts-complete-mono-glyphs 2.1.0-1
    Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts. (Mono glyphs only)
local/python-fonttools 4.28.3-2
    A library to manipulate font files from Python
local/sdl2_ttf 2.0.15-2
    A library that allows you to use TrueType fonts in your SDL applications (Version 2)
local/sdl_ttf 2.0.11-6
    A library that allows you to use TrueType fonts in your SDL applications
local/t1lib 5.1.2-8
    Library for generating character- and string-glyphs from Adobe Type 1 fonts
local/texlive-fontsextra 2021.58704-1 (texlive-most)
    TeX Live - all sorts of extra fonts
local/ttf-fira-code 6.1-1
    Monospaced font with programming ligatures
local/ttf-font-awesome 5.15.4-1
    Iconic font designed for Bootstrap
local/ttf-inconsolata 1:3.000-3
    Monospace font for pretty code listings and for the terminal
local/ttf-liberation 2.1.5-1
    Font family which aims at metric compatibility with Arial, Times New Roman, and Courier New
local/ttf-nerd-fonts-symbols-mono 2.1.0+36+gd0bf73a1-4
    High number of extra glyphs from popular 'iconic fonts' (1000-em)
local/ttf-roboto 2.138-4
    Google's signature family of fonts
local/woff2 1.0.2-3
    Web Open Font Format 2 reference implementation
local/xorg-bdftopcf 1.1-2 (xorg xorg-apps)
    Convert X font from Bitmap Distribution Format to Portable Compiled Format
local/xorg-font-util 1.3.2-2 (xorg-fonts xorg)
    X.Org font utilities
local/xorg-fonts-100dpi 1.0.3-7 (xorg)
    X.org 100dpi fonts
local/xorg-fonts-75dpi 1.0.3-7 (xorg)
    X.org 75dpi fonts
local/xorg-fonts-alias-100dpi 1.0.4-1
    X.org font alias files - 100dpi font familiy
local/xorg-fonts-alias-75dpi 1.0.4-1
    X.org font alias files - 75dpi font familiy
local/xorg-fonts-encodings 1.0.5-2 (xorg-fonts xorg)
    X.org font encoding files
local/xorg-mkfontscale 1.2.1-2 (xorg-apps xorg)
    Create an index of scalable font files for X

Xdefaults contents for terminal (urxvt + fish)

cat ~/.Xdefaults
! urxvt specific settings
! URxvt.font: xft:Inconsolata:size=12
URxvt.font: xft:FiraMono:size=12
URxvt.scrollBar:false
urxvt*transparent:false
urxvt*shading: 80

*.fadeColor: #002b36
*.pointerColorBackground: #586e75
*.pointerColorForeground: #93a1a1

!! special
*.foreground: #657b83
*.background: #002b36
*.cursorColor: #93a1a1

! black (0=dark_pastel_green, 8=grey)
*.color0:       #3b60ac
*.color8:       #373b41

! red (1=true_orange, 9=pastel_orange)
*.color1:       #a54242
*.color9:       #cc6666

! green (2=neon_green, 10=dark_green)
*.color2:       #8c9440
*.color10:      #2f692f

! yellow (3=pastel_light_orange, 11=pastel_yellow)
*.color3:       #de935f
*.color11:      #f0c674

! blue (4=pastel_green sim2:6, 12=hot_pink)
*.color4:       #5f819d
*.color12:      #aa00e0

! magenta (5=wood_brown, 13=cream_brown)
*.color5:       #85678f
*.color13:      #b294bb

! cyan (6=pastel_green sim2:4, 14=pastel_purple)
*.color6:       #5e8d87
*.color14:      #6432b7

! white (7=turqois_green, 15=cream)
*.color7:       #00a5ff
*.color15:      #c5c8c6

locales configuration

cat /etc/locale.gen
en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8

and

cat /etc/locale.conf
LANG=en_GB.UTF-8

Neovim config

cat ~/.config/nvim/init.vim
"BASIC UNIVERSAL SETTINGS
set encoding=UTF-8

"tab and shiftwidth defaults
set expandtab
set tabstop=4
set shiftwidth=4

"deal with the lefthand columns
set number
highlight clear SignColumn

"line length marker https://www.youtube.com/watch?v=aHm36-na4-4
highlight ColorColumn ctermbg=magenta
call matchadd('ColorColumn', '\%81v', 100)

"Deal with invisibles :help listchars
set list
"set nolist
set showbreak=↪\
set listchars=tab:→\ ,eol:¬,trail:·,nbsp:⍽,extends:>,precedes:<,space:·
"" HACK to show only preceeding spaces https://stackoverflow.com/a/40498439/11164973
" highlight WhiteSpaceBol ctermbg=blue
" highlight WhiteSpaceMol ctermbg=background
" match WhiteSpaceMol / /
" 2match WhiteSpaceBol /^ \+/
"REMOVE TRAILING WHITESPACE
autocmd BufWritePre * :%s/\s\+$//e

function! WinMove(key)
    let t:curwin = winnr()
    exec "wincmd ".a:key
    if (t:curwin == winnr())
        if (match(a:key,'[jk]'))
            wincmd v
        else
            wincmd s
        endif
        exec "wincmd ".a:key
    endif
endfunction

nnoremap <silent> <C-h> :call WinMove('h')<CR>
"nnoremap <silent> <C-Left> :call WinMove('h')<CR>
nnoremap <silent> <C-j> :call WinMove('j')<CR>
"nnoremap <silent> <C-Down> :call WinMove('j')<CR>
nnoremap <silent> <C-k> :call WinMove('k')<CR>
"nnoremap <silent> <C-Up> :call WinMove('k')<CR>
nnoremap <silent> <C-l> :call WinMove('l')<CR>
"nnoremap <silent> <C-Right> :call WinMove('l')<CR>

"------------------------------------------------------------------------------
"Vim Plug reminder:
"Install vim plug itself
"Open this config in neovim
":source ~/.config/nvim/init.vim
":PlugInstall
call plug#begin('~/.vim/plugged')

"tab and shiftwidth automation
Plug 'tpope/vim-sleuth'
Plug 'editorconfig/editorconfig-vim'

"side minimap
Plug 'wfxr/minimap.vim'

"git helpers
Plug 'airblade/vim-gitgutter'

"commenting
Plug 'preservim/nerdcommenter'

"golang
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }

"autocompletion
Plug 'neoclide/coc.nvim', {'branch': 'release'}

"file tree
Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': 'python3 -m chadtree deps'}

"Icons and symbols
Plug 'ryanoasis/vim-devicons'
Plug 'https://github.com/adelarsq/vim-devicons-emoji'

call plug#end()
"------------------------------------------------------------------------------

"KEY REMAPS AND ADDITIONAL PLUG SPECIFIC SETTINGS
"
"NERD Commenter
" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 1
" Align line-wise comment delimiters flush left instead of following code indentation
let g:NERDDefaultAlign = 'left'
" Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDCommentEmptyLines = 1
" FORWARD SLASH IS ^_ or _ for keymaps!!!!!!!!
map <C-_> <plug>NERDCommenterToggle

"MINIMAP
let g:minimap_width = 10
let g:minimap_auto_start = 1
let g:minimap_auto_start_win_enter = 1
let g:minimap_highlight_range = 1

"Move between panes
nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>

"CHAD Tree
"Toggle CHADtree
nnoremap <C-Bslash> :CHADopen<CR>
"CHAD tree open and close
nnoremap <leader>v <cmd>CHADopen<cr>

Neovim-QT config

cat ~/.config/nvim/ginit.vim
" Enable Mouse
set mouse=a

" Set Editor Font
if exists(':GuiFont')
    " Use GuiFont! to ignore font errors
    GuiFont Fira Mono:h12
endif

" Disable GUI Tabline
if exists(':GuiTabline')
    GuiTabline 0
endif

" Disable GUI Popupmenu
if exists(':GuiPopupmenu')
    GuiPopupmenu 0
endif

" " Enable GUI ScrollBar
" if exists(':GuiScrollBar')
"     GuiScrollBar 1
" endif

" Right Click Context Menu (Copy-Cut-Paste)
nnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>
inoremap <silent><RightMouse> <Esc>:call GuiShowContextMenu()<CR>
xnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>gv
snoremap <silent><RightMouse> <C-G>:call GuiShowContextMenu()<CR>gv
DreamingRaven commented 2 years ago

Ok I solved my own problem. Turns out I was not using a compatible font in my terminal, but in the GUI it defaulted to one that was compatible, or resolved to one that was compatilbe. In my terminal I now use FuraCode Nerd Font Mono.

fc-list to list avaliable fonts, and fc-match to confirm it was finding the right one. Turns out it was not finding the right one as the nerd font is called Fura! Hope this might give you hints with your GUI problems!