AI prompts
base on Provides Nerd Font icons (glyphs) for use by neovim plugins # Notice
Nerd fonts moved some symbols with version 3.0. Version 2.3 is meant for transition, supporting both version 2 and version 3 icons.
Nvim-web-devicons requires version 2.3 or above to work properly. If you are unable to update please use your plugin manager to pin version of nvim-web-dev icons to `nerd-v2-compat` tag.
# Nvim-web-devicons
Provides [Nerd Font](https://www.nerdfonts.com/) <sup>[1]</sup> icons (glyphs) for use by neovim plugins:
- Icons by:
- Extension
- Full name
- Colours
- Light and dark variants
- API to modify/add icons
A `lua` fork of [vim-devicons](https://github.com/ryanoasis/vim-devicons).
<sup>[1]</sup> Not limited to Nerd Font icons: unicode and other fonts may be used.
## Requirements
- [neovim >=0.7.0](https://github.com/neovim/neovim/wiki/Installing-Neovim)
- [A Patched Nerd Font](https://www.nerdfonts.com/)
## Installation
```vim
Plug 'nvim-tree/nvim-web-devicons'
```
or with [packer.nvim](https://github.com/wbthomason/packer.nvim)
```
use 'nvim-tree/nvim-web-devicons'
```
[![LuaRocks](https://img.shields.io/luarocks/v/nvim-tree/nvim-web-devicons?logo=lua&color=purple)](https://luarocks.org/modules/nvim-tree/nvim-web-devicons)
## Usage
### Viewing
Run `:NvimWebDeviconsHiTest` to see all icons and their highlighting.
### Variants
Light or dark color variants of the icons depend on `&background`.
The variant can also be set manually in `setup` with the `variant` option.
The variant is updated:
- on `OptionSet` event for `background`, or
- after explicitly calling `require("nvim-web-devicons").refresh()`.
However, be advised that the plugin using nvim-web-devicons may have cached the icons.
### Case Sensitivity
Filename icons e.g. `"Dockerfile"` are case insensitively matched.
Extension icons e.g. `"lua"` are case sensitive.
### Setup
This adds all the highlight groups for the devicons
i.e. it calls `vim.api.nvim_set_hl` for all icons
this might need to be re-called in a `Colorscheme` to re-apply cleared highlights
if the color scheme changes
```lua
require'nvim-web-devicons'.setup {
-- your personnal icons can go here (to override)
-- you can specify color or cterm_color instead of specifying both of them
-- DevIcon will be appended to `name`
override = {
zsh = {
icon = "",
color = "#428850",
cterm_color = "65",
name = "Zsh"
}
};
-- globally enable different highlight colors per icon (default to true)
-- if set to false all icons will have the default icon's color
color_icons = true;
-- globally enable default icons (default to false)
-- will get overriden by `get_icons` option
default = true;
-- globally enable "strict" selection of icons - icon will be looked up in
-- different tables, first by filename, and if not found by extension; this
-- prevents cases when file doesn't have any extension but still gets some icon
-- because its name happened to match some extension (default to false)
strict = true;
-- set the light or dark variant manually, instead of relying on `background`
-- (default to nil)
variant = "light|dark";
-- same as `override` but specifically for overrides by filename
-- takes effect when `strict` is true
override_by_filename = {
[".gitignore"] = {
icon = "",
color = "#f1502f",
name = "Gitignore"
}
};
-- same as `override` but specifically for overrides by extension
-- takes effect when `strict` is true
override_by_extension = {
["log"] = {
icon = "",
color = "#81e043",
name = "Log"
}
};
-- same as `override` but specifically for operating system
-- takes effect when `strict` is true
override_by_operating_system = {
["apple"] = {
icon = "",
color = "#A2AAAD",
cterm_color = "248",
name = "Apple",
},
};
}
```
### Get Icon
Get the icon for a given file by passing in the `name`, the `extension` and an _optional_ options `table`.
The name is passed in to check for an exact match e.g. `.bashrc` if there is no exact name match the extension
is used. Calls `.setup()` if it hasn't already ran.
```lua
require'nvim-web-devicons'.get_icon(filename, extension, options)
```
The optional `options` argument can used to change how the plugin works the keys include
`default = <boolean>` and `strict = <boolean>`. If the default key is set to true this
function will return a default if there is no matching icon. If the strict key is set
to true this function will lookup icon specifically by filename, and if not found then
specifically by extension, and fallback to default icon if default key is set to true.
e.g.
```lua
require'nvim-web-devicons'.get_icon(filename, extension, { default = true })
```
You can check if the setup function was already called with:
```lua
require'nvim-web-devicons'.has_loaded()
```
### Get icon and color code
`get_icon_color` differs from `get_icon` only in the second return value.
`get_icon_cterm_color` returns cterm color instead of gui color
`get_icon` returns icon and highlight name.
If you want to get color code, you can use this function.
```lua
local icon, color = require'nvim-web-devicons'.get_icon_color("init.lua", "lua")
assert(icon == "")
assert(color == "#51a0cf")
```
### Get all icons
It is possible to get all of the registered icons with the `get_icons()` function:
```lua
require'nvim-web-devicons'.get_icons()
```
This can be useful for debugging purposes or for creating custom highlights for each icon.
Mapped categories can be fetched via:
```lua
require'nvim-web-devicons'.get_icons_by_filename()
require'nvim-web-devicons'.get_icons_by_extension()
require'nvim-web-devicons'.get_icons_by_operating_system()
require'nvim-web-devicons'.get_icons_by_desktop_environment()
require'nvim-web-devicons'.get_icons_by_window_manager()
```
### Set an icon
You can override individual icons with the `set_icon({...})` function:
```lua
require("nvim-web-devicons").set_icon {
zsh = {
icon = "",
color = "#428850",
cterm_color = "65",
name = "Zsh"
}
}
```
You can override the default icon with the `set_default_icon(icon, color, cterm_color)` function:
```lua
require("nvim-web-devicons").set_default_icon('', '#6d8086', 65)
```
### Getting and setting icons by filetype
You can get the icon and colors associated with a filetype using the `by_filetype` functions:
```lua
require("nvim-web-devicons").get_icon_by_filetype(filetype, opts)
require("nvim-web-devicons").get_icon_colors_by_filetype(filetype, opts)
require("nvim-web-devicons").get_icon_color_by_filetype(filetype, opts)
require("nvim-web-devicons").get_icon_cterm_color_by_filetype(filetype, opts)
```
or set the icon to use for a filetype with:
```lua
require("nvim-web-devicons").set_icon_by_filetype { cpp = "c", pandoc = "md", }
```
These functions are the same as their counterparts without the `_by_filetype` suffix, but they take a filetype instead of a name/extension.
You can also use `get_icon_name_by_filetype(filetype)` to get the icon name associated with the filetype.
## Known Issues
### My `setup` Overrides Are Not Applied
*Cause:* A plugin may be calling nvim-web-devicons `setup` before you do. Your `setup` call will be ignored.
*Workaround:* Call nvim-web-devicons `setup` before the plugin's own `setup`.
### Windows and WSL not rendering icons properly on some terminals
On Windows and WSL, it is possible that the icons are not rendered properly when
using a terminal that relies on Windows' default system libraries. An example
of this is Alacritty ([#271](https://github.com/nvim-tree/nvim-web-devicons/issues/271#issuecomment-2081280928)).
Other terminals (e.g. Windows Terminal, and WezTerm) do no have this issue, as
they ship newer versions of these libraries. More precisely, they use newer
versions of `conpty.dll` and `OpenConsole.exe`. So, as a workaround to the
rendering issue, you need to make your terminal use these newer files. Whether
this is possible depends on the terminal you are using. Please refer to the
terminal's documentation for this.
In the specific case of Alacritty, you need to place up-to-date `conpty.dll` and
`OpenConsole.exe` files in your `PATH`. Microsoft does not provide these files
directly, but you can get them from other terminal emulators that ship them.
## Contributing
PRs are always welcome! Please see [CONTRIBUTING](CONTRIBUTING.md)
", Assign "at most 3 tags" to the expected json: {"id":"6521","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"