{"id":13605357,"url":"https://github.com/powerman/wcwidth-icons","last_synced_at":"2025-04-15T06:53:46.075Z","repository":{"id":145406122,"uuid":"88243408","full_name":"powerman/wcwidth-icons","owner":"powerman","description":"Support fonts with double-width icons in xterm/rxvt-unicode/zsh/vim/…","archived":false,"fork":false,"pushed_at":"2024-07-10T15:00:57.000Z","size":32,"stargazers_count":43,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T06:53:40.488Z","etag":null,"topics":["font-icons","ld-preload","patch","urxvt","vim","xterm","zsh"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/powerman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-14T07:17:01.000Z","updated_at":"2025-03-16T05:21:40.000Z","dependencies_parsed_at":"2024-11-07T10:34:29.497Z","dependency_job_id":null,"html_url":"https://github.com/powerman/wcwidth-icons","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerman%2Fwcwidth-icons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerman%2Fwcwidth-icons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerman%2Fwcwidth-icons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerman%2Fwcwidth-icons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/powerman","download_url":"https://codeload.github.com/powerman/wcwidth-icons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023711,"owners_count":21199958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["font-icons","ld-preload","patch","urxvt","vim","xterm","zsh"],"created_at":"2024-08-01T19:00:57.771Z","updated_at":"2025-04-15T06:53:46.058Z","avatar_url":"https://github.com/powerman.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# wcwidth-icons\n\nSupport fonts with double-width icons in xterm/rxvt-unicode/zsh/vim/…\n\nIf fonts with icons like [Nerd Fonts](https://github.com/ryanoasis/nerd-fonts/)\nare used with some terminals like rxvt-unicode then icons must have\nsingle-width (Nerd Fonts calls this \"Mono\" font, generated by Nerd Fonts\nFont Patcher with option `--use-single-width-glyphs`) to work correctly.\n**This makes icons too small (about ¼ of normal size for most icons).**\n\nTo fix this for most applications (like xterm/rxvt-unicode/zsh/…) which\nuse libc function (like `wcwidth(3)` or `wcswidth(3)`) to get symbol width\nyou can use provided library in `LD_PRELOAD` environment variable.\n\nSome other applications may need extra configuration or a patch (see below).\n\nWith these fixes you should use Nerd Fonts with \"Propo\" font name suffix\ninstead of \"Mono\".\n\n## Install\n\n```sh\n# Build libwcwidth-icons.so and copy it to /usr/lib/ by default.\nsudo make install\n```\n\n### Gentoo Linux\n\n```\nsudo layman -a powerman\nsudo emerge wcwidth-icons\n\n# Patch Vim\nsudo mkdir -p /etc/portage/patches/app-editors/vim{,-core}/\nsudo wget https://github.com/powerman/wcwidth-icons/raw/master/patches/vim/wcwidth-icons.patch \\\n    -O /etc/portage/patches/app-editors/vim/wcwidth-icons.patch\nsudo cp /etc/portage/patches/app-editors/vim{,-core}/wcwidth-icons.patch\nsudo emerge -1 vim vim-core\n```\n\n## Usage\n\n```sh\nexport LD_PRELOAD=/usr/lib/libwcwidth-icons.so\n```\n\nThen run urxvt/xterm/zsh/… using font with double-width icons.\n\n## Other applications\n\n### Less\n\n```sh\nexport LESSUTFCHARDEF=\"23fb-23fe:w,2665:w,2b58:w,e000-e00a:w,e0a0-e0a3:p,e0b0-e0bf:p,e0c0-e0c8:w,e0ca:w,e0cc-e0d7:w,e200-e2a9:w,e300-e3e3:w,e5fa-e6b5:w,e700-e7c5:w,ea60-ec1e:w,ed00-efce:w,f000-f2ff:w,f300-f375:w,f400-f533:w,f0001-f1af0:w\"\n```\n\n### Vim\n\nAdd this to your Vim configuration:\n\n```vim\n\" Fix icon width for Nerd Fonts v3.2.1.\ncall setcellwidths([\n\\   [ 0x23fb, 0x23fe, 2 ],\n\\   [ 0x2665, 0x2665, 2 ],\n\\   [ 0x2b58, 0x2b58, 2 ],\n\\   [ 0xe000, 0xe00a, 2 ],\n\\   [ 0xe0c0, 0xe0c8, 2 ],\n\\   [ 0xe0ca, 0xe0ca, 2 ],\n\\   [ 0xe0cc, 0xe0d7, 2 ],\n\\   [ 0xe200, 0xe2a9, 2 ],\n\\   [ 0xe300, 0xe3e3, 2 ],\n\\   [ 0xe5fa, 0xe6b5, 2 ],\n\\   [ 0xe700, 0xe7c5, 2 ],\n\\   [ 0xea60, 0xec1e, 2 ],\n\\   [ 0xed00, 0xefce, 2 ],\n\\   [ 0xf000, 0xf2ff, 2 ],\n\\   [ 0xf300, 0xf375, 2 ],\n\\   [ 0xf400, 0xf533, 2 ],\n\\   [ 0xf0001, 0xf1af0, 2 ],\n\\ ])\n```\n\n### Neovim\n\nAdd this to your Neovim configuration:\n\n```lua\n-- Fix icon width for Nerd Fonts v3.2.1.\nvim.fn.setcellwidths({\n    { 0x23fb, 0x23fe, 2 }, -- IEC Power Symbols\n    { 0x2665, 0x2665, 2 }, -- Octicons\n    { 0x2b58, 0x2b58, 2 }, -- IEC Power Symbols\n    { 0xe000, 0xe00a, 2 }, -- Pomicons\n    { 0xe0c0, 0xe0c8, 2 }, -- Powerline Extra\n    { 0xe0ca, 0xe0ca, 2 }, -- Powerline Extra\n    { 0xe0cc, 0xe0d7, 2 }, -- Powerline Extra\n    { 0xe200, 0xe2a9, 2 }, -- Font Awesome Extension\n    { 0xe300, 0xe3e3, 2 }, -- Weather Icons\n    { 0xe5fa, 0xe6b5, 2 }, -- Seti-UI + Custom\n    { 0xe700, 0xe7c5, 2 }, -- Devicons\n    { 0xea60, 0xec1e, 2 }, -- Codicons\n    { 0xed00, 0xefce, 2 }, -- Font Awesome\n    { 0xf000, 0xf2ff, 2 }, -- Font Awesome\n    { 0xf300, 0xf375, 2 }, -- Font Logos\n    { 0xf400, 0xf533, 2 }, -- Octicons\n    { 0xf0001, 0xf1af0, 2 }, -- Material Design\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerman%2Fwcwidth-icons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerman%2Fwcwidth-icons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerman%2Fwcwidth-icons/lists"}