{"id":13412140,"url":"https://github.com/nvim-tree/nvim-web-devicons","last_synced_at":"2025-04-05T02:09:52.814Z","repository":{"id":37536121,"uuid":"267866539","full_name":"nvim-tree/nvim-web-devicons","owner":"nvim-tree","description":"lua `fork` of vim-web-devicons for neovim","archived":false,"fork":false,"pushed_at":"2024-10-11T00:58:40.000Z","size":639,"stargazers_count":2081,"open_issues_count":27,"forks_count":184,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-29T15:34:16.621Z","etag":null,"topics":["nerd-fonts"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvim-tree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-05-29T13:37:01.000Z","updated_at":"2024-10-29T14:47:35.000Z","dependencies_parsed_at":"2023-10-15T06:47:19.015Z","dependency_job_id":"69175784-b609-457f-a2cd-3d3981c0951d","html_url":"https://github.com/nvim-tree/nvim-web-devicons","commit_stats":null,"previous_names":["kyazdani42/nvim-web-devicons"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-tree%2Fnvim-web-devicons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-tree%2Fnvim-web-devicons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-tree%2Fnvim-web-devicons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-tree%2Fnvim-web-devicons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-tree","download_url":"https://codeload.github.com/nvim-tree/nvim-web-devicons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"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":["nerd-fonts"],"created_at":"2024-07-30T20:01:21.424Z","updated_at":"2025-04-05T02:09:52.790Z","avatar_url":"https://github.com/nvim-tree.png","language":"Lua","readme":"# Nvim-web-devicons\n\nProvides [Nerd Font](https://www.nerdfonts.com/) [^1] icons (glyphs) for use by *Neovim* plugins:\n\n- Icons by:\n  - Extension\n  - Full name\n- Colours\n- Light and dark variants\n- API to modify/add icons\n\nA `lua` fork of [vim-devicons](https://github.com/ryanoasis/vim-devicons).\n\n\u003e [!IMPORTANT]\n\u003e Nerd fonts moved some symbols with version 3.0. Version 2.3 is meant for transition,\n\u003e supporting both version 2 and version 3 icons.\n\u003e Nvim-web-devicons requires version 2.3 or above to work properly. If you are unable to update\n\u003e please use your plugin manager to pin version of nvim-web-dev icons to `nerd-v2-compat` tag.\n\n[^1]: Not limited to Nerd Font icons: unicode and other fonts may be used.\n\n## Requirements\n\n- [neovim \u003e=0.7.0](https://github.com/neovim/neovim/wiki/Installing-Neovim)\n- [A Patched Nerd Font](https://www.nerdfonts.com/)\n\n## Installation\n\n```vim\nPlug 'nvim-tree/nvim-web-devicons'\n```\n\nor with [packer.nvim](https://github.com/wbthomason/packer.nvim)\n\n```lua\nuse 'nvim-tree/nvim-web-devicons'\n```\n\nor with [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n{ \"nvim-tree/nvim-web-devicons\", opts = {} },\n```\n\n[![LuaRocks](https://img.shields.io/luarocks/v/nvim-tree/nvim-web-devicons?logo=lua\u0026color=purple)](https://luarocks.org/modules/nvim-tree/nvim-web-devicons)\n\n## Additional Icons\n\nAdditional icons may be added for icons that are present in Nerd Fonts: use the [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet) search for available icons.\n\nPRs are always welcome! Please see [CONTRIBUTING](CONTRIBUTING.md)\n\n\u003e [!IMPORTANT]\n\u003e If the icon you need is not available on Nerd Fonts you first need to make a\n\u003e PR to a project that feeds glyphs to Nerd Fonts. Probably the most adequate\n\u003e project to contribute is \u003chttps://github.com/devicons/devicon\u003e.\n\u003e Take into account that **months** can pass before the icon is available on the\n\u003e Nerd Fonts project, once there feel free to open a PR on this project, see \n\u003e [CONTRIBUTING](CONTRIBUTING.md)\n\n## Usage\n\n### Viewing\n\nRun `:NvimWebDeviconsHiTest` to see all icons and their highlighting.\n\n### Variants\n\nLight or dark color variants of the icons depend on `\u0026background`.  \nThe variant can also be set manually in `setup` with the `variant` option.\n\nThe variant is updated:\n\n- on `OptionSet` event for `background`, or\n- after explicitly calling `require(\"nvim-web-devicons\").refresh()`.\n\nHowever, be advised that the plugin using nvim-web-devicons may have cached the icons.\n\n### Case Sensitivity\n\nFilename icons e.g. `\"Dockerfile\"` are case insensitively matched.\n\nExtension icons e.g. `\"lua\"` are case sensitive.\n\n### Setup\n\nThis adds all the highlight groups for the devicons\ni.e. it calls `vim.api.nvim_set_hl` for all icons\nthis might need to be re-called in a `Colorscheme` to re-apply cleared highlights\nif the color scheme changes\n\n```lua\nrequire'nvim-web-devicons'.setup {\n -- your personal icons can go here (to override)\n -- you can specify color or cterm_color instead of specifying both of them\n -- DevIcon will be appended to `name`\n override = {\n  zsh = {\n    icon = \"\",\n    color = \"#428850\",\n    cterm_color = \"65\",\n    name = \"Zsh\"\n  }\n };\n -- globally enable different highlight colors per icon (default to true)\n -- if set to false all icons will have the default icon's color\n color_icons = true;\n -- globally enable default icons (default to false)\n -- will get overriden by `get_icons` option\n default = true;\n -- globally enable \"strict\" selection of icons - icon will be looked up in\n -- different tables, first by filename, and if not found by extension; this\n -- prevents cases when file doesn't have any extension but still gets some icon\n -- because its name happened to match some extension (default to false)\n strict = true;\n -- set the light or dark variant manually, instead of relying on `background`\n -- (default to nil)\n variant = \"light|dark\";\n -- same as `override` but specifically for overrides by filename\n -- takes effect when `strict` is true\n override_by_filename = {\n  [\".gitignore\"] = {\n    icon = \"\",\n    color = \"#f1502f\",\n    name = \"Gitignore\"\n  }\n };\n -- same as `override` but specifically for overrides by extension\n -- takes effect when `strict` is true\n override_by_extension = {\n  [\"log\"] = {\n    icon = \"\",\n    color = \"#81e043\",\n    name = \"Log\"\n  }\n };\n -- same as `override` but specifically for operating system\n -- takes effect when `strict` is true\n override_by_operating_system = {\n  [\"apple\"] = {\n    icon = \"\",\n    color = \"#A2AAAD\",\n    cterm_color = \"248\",\n    name = \"Apple\",\n  },\n };\n}\n```\n\n### Get Icon\n\nGet the icon for a given file by passing in the `name`, the `extension` and an *optional* options `table`.\nThe name is passed in to check for an exact match e.g. `.bashrc` if there is no exact name match the extension\nis used. Calls `.setup()` if it hasn't already ran.\n\n```lua\nrequire'nvim-web-devicons'.get_icon(filename, extension, options)\n```\n\nThe optional `options` argument can used to change how the plugin works the keys include\n`default = \u003cboolean\u003e` and `strict = \u003cboolean\u003e`. If the default key is set to true this\nfunction will return a default if there is no matching icon. If the strict key is set\nto true this function will lookup icon specifically by filename, and if not found then\nspecifically by extension, and fallback to default icon if default key is set to true.\ne.g.\n\n```lua\nrequire'nvim-web-devicons'.get_icon(filename, extension, { default = true })\n```\n\nYou can check if the setup function was already called with:\n\n```lua\nrequire'nvim-web-devicons'.has_loaded()\n```\n\n### Get icon and color code\n\n`get_icon_color` differs from `get_icon` only in the second return value.\n`get_icon_cterm_color` returns cterm color instead of gui color\n`get_icon` returns icon and highlight name.\nIf you want to get color code, you can use this function.\n\n```lua\nlocal icon, color = require'nvim-web-devicons'.get_icon_color(\"init.lua\", \"lua\")\nassert(icon == \"\")\nassert(color == \"#51a0cf\")\n```\n\n### Get all icons\n\nIt is possible to get all of the registered icons with the `get_icons()` function:\n\n```lua\nrequire'nvim-web-devicons'.get_icons()\n```\n\nThis can be useful for debugging purposes or for creating custom highlights for each icon.\n\nMapped categories can be fetched via:\n\n```lua\nrequire'nvim-web-devicons'.get_icons_by_filename()\nrequire'nvim-web-devicons'.get_icons_by_extension()\nrequire'nvim-web-devicons'.get_icons_by_operating_system()\nrequire'nvim-web-devicons'.get_icons_by_desktop_environment()\nrequire'nvim-web-devicons'.get_icons_by_window_manager()\n```\n\n### Set an icon\n\nYou can override individual icons with the `set_icon({...})` function:\n\n```lua\nrequire(\"nvim-web-devicons\").set_icon {\n  zsh = {\n    icon = \"\",\n    color = \"#428850\",\n    cterm_color = \"65\",\n    name = \"Zsh\"\n  }\n}\n```\n\nYou can override the default icon with the `set_default_icon(icon, color, cterm_color)` function:\n\n```lua\nrequire(\"nvim-web-devicons\").set_default_icon('', '#6d8086', 65)\n```\n\n### Getting and setting icons by filetype\n\nYou can get the icon and colors associated with a filetype using the `by_filetype` functions:\n\n```lua\nrequire(\"nvim-web-devicons\").get_icon_by_filetype(filetype, opts)\nrequire(\"nvim-web-devicons\").get_icon_colors_by_filetype(filetype, opts)\nrequire(\"nvim-web-devicons\").get_icon_color_by_filetype(filetype, opts)\nrequire(\"nvim-web-devicons\").get_icon_cterm_color_by_filetype(filetype, opts)\n```\n\nor set the icon to use for a filetype with:\n\n```lua\nrequire(\"nvim-web-devicons\").set_icon_by_filetype { cpp = \"c\", pandoc = \"md\", }\n```\n\nThese functions are the same as their counterparts without the `_by_filetype` suffix,\nbut they take a filetype instead of a name/extension.\n\nYou can also use `get_icon_name_by_filetype(filetype)` to get the icon name associated with the filetype.\n\n## Known Issues\n\n### My `setup` Overrides Are Not Applied\n\n*Cause:* A plugin may be calling nvim-web-devicons `setup` before you do. Your `setup` call will be ignored.\n\n*Workaround:* Call nvim-web-devicons `setup` before the plugin's own `setup`.\n\n### Windows and WSL not rendering icons properly on some terminals\n\nOn Windows and WSL, it is possible that the icons are not rendered properly when\nusing a terminal that relies on Windows' default system libraries. An example\nof this is Alacritty ([#271](https://github.com/nvim-tree/nvim-web-devicons/issues/271#issuecomment-2081280928)).\nOther terminals (e.g. Windows Terminal, and WezTerm) do no have this issue, as\nthey ship newer versions of these libraries. More precisely, they use newer\nversions of `conpty.dll` and `OpenConsole.exe`. So, as a workaround to the\nrendering issue, you need to make your terminal use these newer files. Whether\nthis is possible depends on the terminal you are using. Please refer to the\nterminal's documentation for this.\n\nIn the specific case of Alacritty, you need to place up-to-date `conpty.dll` and\n`OpenConsole.exe` files in your `PATH`. Microsoft does not provide these files\ndirectly, but you can get them from other terminal emulators that ship them.\n\n## Contributing\n\nPRs are always welcome! Please see [CONTRIBUTING](CONTRIBUTING.md)\n","funding_links":[],"categories":["Icon","Lua"],"sub_categories":["Cursorline"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-tree%2Fnvim-web-devicons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-tree%2Fnvim-web-devicons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-tree%2Fnvim-web-devicons/lists"}