-
Notifications
You must be signed in to change notification settings - Fork 204
refactor: split tables into individual files #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 16 commits
d6c8bc4
5fdf3ac
517275a
a490d9a
0a6e45a
d91c7c7
2ebb850
2c768d3
8da0332
8cc2c15
dcc2a0e
9aa532e
218c0b1
33e70d2
1624a80
368f6c1
3028209
d384eea
1c56d93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lua/nvim-web-devicons/light/* linguist-generated=true | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
lua/nvim-web-devicons/icons-*.lua | ||
lua/nvim-web-devicons/*/icons_*.lua |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,6 @@ | |
|
||
Thank you for your contribution! | ||
|
||
## Order | ||
|
||
Please ensure `icons_by_filename`, `icons_by_file_extension`, `icons_by_operating_system`, `icons_by_desktop_environment`, | ||
`icons_by_window_manager` and `filetypes` are ordered alphabetically, to prevent merge conflicts. | ||
|
||
## Prerequisites | ||
|
||
Code is formatted using *stylua* and linted using *luacheck*. | ||
|
@@ -24,8 +19,43 @@ or via your OS package manager e.g. *Arch Linux*: | |
pacman -S stylua luacheck | ||
``` | ||
|
||
## Adding icons | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: I didn't just move the block here, so please review as new. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good, reverted contributing changes on #551 |
||
|
||
Add or update icons in `lua/nvim-web-devicons/default/` directory | ||
|
||
There are five files where icons can be added: | ||
|
||
1. `icons_by_filename.lua` | ||
2. `icons_by_file_extension.lua` | ||
3. `icons_by_operating_system.lua` | ||
4. `icons_by_desktop_environment.lua` | ||
5. `icons_by_window_manager.lua` | ||
|
||
Add the icon to table in file **1.** if the icon is for a file that is always named that way, for example `.gitconfig`. | ||
Add the icon to table in file **2.** if the icon is for all files with an extension, for example `vim`. | ||
Add the icon to table in files **3.**, **4.** and **5.** if the icon is from an OS, DE or WM. | ||
|
||
Each icon must have the following structure (this is an example): | ||
|
||
```lua | ||
[".gitconfig"] = { icon = "", color = "#41535b", cterm_color = "0", name = "GitConfig" }, | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> Make sure an icon occupies exactly one line. | ||
|
||
***All of the following keys are required:*** | ||
|
||
- `icon` glyph | ||
- `color` must contain a color in the html notation | ||
- `cterm_color` must contain a number (any number) | ||
- the correct value for `cterm_color` will be generated by the script in next step | ||
- `name` must only contain alphanumeric characters (don't use `/`, `-`, `_`) | ||
|
||
## Building | ||
|
||
Note: Ensure your current working directory is the repo root. | ||
|
||
Following your changes, please run: | ||
|
||
```sh | ||
|
@@ -34,7 +64,7 @@ make | |
|
||
This will: | ||
|
||
1. `git clone --depth 1 https://github.com/lifepillar/vim-colortemplate.git vim-colortemplate` if necessary | ||
1. Install required plugins: [vim-colortemplate](https://github.com/lifepillar/vim-colortemplate.git) and [mini.align](https://github.com/echasnovski/mini.align) if necessary | ||
2. Generate cterm colors | ||
3. Generate light color variants | ||
4. Check style | ||
|
@@ -47,46 +77,7 @@ 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 five tables where icons can be added: | ||
|
||
1. `icons_by_filename` | ||
2. `icons_by_file_extension` | ||
3. `icons_by_operating_system` | ||
4. `icons_by_desktop_environment` | ||
5. `icons_by_window_manager` | ||
|
||
Add the icon to table **1.** if the icon is for a file that is always named that way, for example `.gitconfig`. | ||
Add the icon to table **2.** if the icon is for all files with an extension, for example `vim`. | ||
Add the icon to table **3.**, **4.**, **5.** if the icon is from an OS, DE or WM. | ||
|
||
Each icon must have the following structure (this is an example): | ||
|
||
```lua | ||
[".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 | ||
- `name` must only contain alphanumeric characters (don't use `/`, `-`, `_`) | ||
|
||
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` | ||
Please commit all files from `lua/nvim-web-devicons/default/`, `lua/nvim-web-devicons/light/` end `lua/nvim-web-devicons/filetypes.lua` | ||
|
||
## Test | ||
|
||
|
alex-courtis marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are all present in CI and work. CI could be consolidated at some point but not today. |
Uh oh!
There was an error while loading. Please reload this page.