2.1 KiB
Contributing to nvim-web-devicons
Thank you for your contribution!
Name
Please name your commits and the PR simply e.g.
add .tex
update makefile icon
update .kt colors
Prerequisites
Add vim-colortemplate to &runtimepath. The easiest way to do this is via your package manager.
Code is formatted using stylua and linted using luacheck.
You can install these with:
cargo install stylua
luarocks install luacheck
or via your OS package manager e.g. Arch linux:
pacman -S stylua
pacman -S luacheck
Building
Following your changes, please run:
make
This will:
- Generate cterm colors
- Generate light color variants
- Check style
- Lint
You can automatically fix any style issues via:
make style-fix
Generate Colors
Add or update icons in scripts/nvim-web-devicons.lua.
There are two tables where icons can be added:
- icons_by_filename
- icons_by_file_extension
Add the icon in table 1. if the icon is for a file that is always named that
way, for example .gitconfig. Add to table 2. if the icon is for all files
with an extension.
Each icon must have the following (this is an example):
[".gitconfig"] = {
icon = "",
color = "#41535b",
cterm_color = "0",
name = "GitConfig",
},
Key/value pairs must appear in the same exact order!
colormust contain a color in the html notationcterm_colormust be belowcolor, and it must contain a number (any number)- the correct value for
cterm_colorwill be generated by the script
Ensure your current working directory is the repo root.
Run make. This will:
- Update
cterm_colorbased oncolor - Generate
nvim-web-devicons-light.lua
Please commit both nvim-web-devicons.lua and nvim-web-devicons-light.lua
Pull Request
Please reference any issues in the description e.g. "resolves #1234".
Please check "allow edits by maintainers" to allow nvim-web-devicons maintainers to make small changes such as documentation tweaks.
Documentation
When modifying or adding API, please update Usage