Skip to content

Latest commit

 

History

History
95 lines (67 loc) · 2.26 KB

CONTRIBUTING.md

File metadata and controls

95 lines (67 loc) · 2.26 KB

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

Order

Please ensure icons_by_filename, icons_by_file_extension and filetypes are ordered alphabetically, to prevent merge conflicts.

Prerequisites

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:

  1. git clone --depth 1 https://github.com/lifepillar/vim-colortemplate.git vim-colortemplate if necessary
  2. Generate cterm colors
  3. Generate light color variants
  4. Check style
  5. Lint

You can automatically fix any style issues via:

make style-fix

Generate Colors

Add or update icons in lua/nvim-web-devicons/icons-default.lua

There are two tables where icons can be added:

  1. icons_by_filename
  2. 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!

  • color must contain a color in the html notation
  • cterm_color must be below color, and it must contain a number (any number)
  • the correct value for cterm_color will be generated by the script

Ensure your current working directory is the repo root. Run make. This will:

  • Update cterm_color based on color
  • Generate lua/nvim-web-devicons/icons-light.lua

Please commit both lua/nvim-web-devicons/icons-default.lua and lua/nvim-web-devicons/icons-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