sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
15.92k stars 370 forks source link

More spacing after icons #297

Closed YodaEmbedding closed 1 year ago

YodaEmbedding commented 1 year ago

Icons could use another space afterwards.

2023-10-21  19-08-04  723

OS: Arch Font: Iosevka, size 15 Other installed fonts: ttf-font-awesome Terminal: Alacritty

YodaEmbedding commented 1 year ago

Workaround is to modify $HOME/.config/yazi/theme.toml to add a space after every icon "manually".

[icons]

"Desktop/"     = " "
"Documents/"   = " "
"Downloads/"   = " "
"Pictures/"    = " "
"Music/"       = " "
"Movies/"      = " "
"Videos/"      = " "
"Public/"      = " "
"Library/"     = " "
"Development/" = " "
".config/"     = " "

# Git
".git/"          = " "
".gitignore"     = " "
".gitmodules"    = " "
".gitattributes" = " "

# Dotfiles
".DS_Store"    = " "
".bashrc"      = " "
".bashprofile" = " "
".zshrc"       = " "
".zshenv"      = " "
".zprofile"    = " "
".vimrc"       = " "

# Text
"*.txt" = " "
"*.md"  = " "

# Archives
"*.zip" = " "
"*.tar" = " "
"*.gz"  = " "
"*.7z"  = " "

# Audio
"*.mp3"  = ""
"*.flac" = ""
"*.wav"  = ""

# Movies
"*.mp4" = " "
"*.mkv" = " "
"*.avi" = " "
"*.mov" = " "

# Images
"*.jpg"  = " "
"*.jpeg" = " "
"*.png"  = " "
"*.gif"  = " "
"*.webp" = " "
"*.avif" = " "
"*.bmp"  = " "
"*.ico"  = " "
"*.svg"  = " "

# Programming
"*.c"     = " "
"*.cpp"   = " "
"*.h"     = " "
"*.hpp"   = " "
"*.rs"    = " "
"*.go"    = " "
"*.py"    = " "
"*.js"    = " "
"*.ts"    = " "
"*.tsx"   = " "
"*.jsx"   = " "
"*.rb"    = " "
"*.php"   = " "
"*.java"  = " "
"*.sh"    = " "
"*.fish"  = " "
"*.swift" = " "
"*.vim"   = " "
"*.lua"   = " "
"*.html"  = " "
"*.css"   = " "
"*.scss"  = " "
"*.json"  = " "
"*.toml"  = " "
"*.yml"   = " "
"*.yaml"  = " "
"*.ini"   = " "
"*.conf"  = " "

# Default
"*"  = " "
"*/" = " "
sxyazi commented 1 year ago

Is this because of the font? They shouldn't be so crowded imho

YodaEmbedding commented 1 year ago

Yes, looks like the issue is only with Iosevka which is more horizontally squished compared to, e.g., Roboto Mono.

Looks like Telescope.nvim (which also uses devicons) always outputs <icon><space><space><text> to avoid this issue.

sxyazi commented 1 year ago

Where can I download this font? I'd like to try replicating it.

YodaEmbedding commented 1 year ago

ttc-iosevka should be sufficient. I also have ttf-iosevka-nerd, but it doesn't look necessary to reproduce.

sxyazi commented 1 year ago

Hey, I've added a new Folder:icon() API. You can now create a simple UI plugin and apply your styles within it:

-- ~/.config/yazi/ui.lua
function Folder:icon(file) return ui.Span(" " .. file:icon() .. "  ") end

and then import it:

# ~/.config/yazi/yazi.toml
[plugins]
preload = [
    "~/.config/yazi/ui.lua"
]
YodaEmbedding commented 1 year ago

I tested the PR. Works for me.

github-actions[bot] commented 10 months ago

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.