-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nvim-tree:master' into master
- Loading branch information
Showing
16 changed files
with
2,473 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
insert_final_newline = true | ||
end_of_line = lf | ||
|
||
[*.lua] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Lint | ||
on: pull_request | ||
permissions: | ||
contents: read | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: leafo/gh-actions-lua@v9 | ||
with: | ||
luaVersion: "5.1" | ||
- uses: leafo/gh-actions-luarocks@v4 | ||
- name: Install luacheck | ||
run: luarocks install luacheck | ||
- uses: rhysd/action-setup-vim@v1 | ||
with: | ||
neovim: true | ||
- uses: actions/[email protected] | ||
- run: pip install pre-commit | ||
- run: pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Pre-commit autoupdate | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
auto-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: leafo/gh-actions-lua@v9 | ||
with: | ||
luaVersion: "5.1" | ||
- uses: leafo/gh-actions-luarocks@v4 | ||
- name: Install luacheck | ||
run: luarocks install luacheck | ||
- uses: rhysd/action-setup-vim@v1 | ||
with: | ||
neovim: true | ||
- uses: actions/[email protected] | ||
- run: pip install pre-commit | ||
- run: pre-commit autoupdate | ||
- run: pre-commit run --all-files | ||
- uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: update/pre-commit-hooks | ||
title: "chore: update pre-commit hooks" | ||
commit-message: "chore: update pre-commit hooks" | ||
body: Update versions of pre-commit hooks to latest version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Semantic Pull Request Subject | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
jobs: | ||
semantic-pr-subject: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.lua | ||
.luarocks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
max_line_length = 120 | ||
|
||
globals = { | ||
"vim", | ||
"jit", | ||
"bit", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", | ||
"runtime.version" : "Lua 5.1", | ||
"diagnostics": { | ||
"globals": [ | ||
"vim", | ||
"jit", | ||
"bit" | ||
] | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
repos: | ||
- repo: https://github.com/johnnymorganz/stylua | ||
rev: v0.17.1 | ||
hooks: | ||
- id: stylua-github | ||
- repo: local | ||
hooks: | ||
- id: luacheck | ||
name: Luacheck | ||
description: Lints Lua files using Luacheck. | ||
entry: luacheck -- | ||
language: system | ||
types: [lua] | ||
- repo: local | ||
hooks: | ||
- id: lighttheme | ||
name: Light Color Scheme Generator | ||
description: Ensures Light Color Scheme version has been generated. | ||
entry: nvim --headless -c 'source scripts/generate_colors.lua' -c 'qall' | ||
language: system | ||
types: [lua] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
column_width = 120 | ||
line_endings = "Unix" | ||
indent_type = "Spaces" | ||
indent_width = 2 | ||
quote_style = "AutoPreferDouble" | ||
call_parentheses = "None" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# 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](https://github.com/lifepillar/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: | ||
```sh | ||
cargo install stylua | ||
luarocks install luacheck | ||
``` | ||
|
||
or via your OS package manager e.g. Arch linux: | ||
```sh | ||
pacman -S stylua | ||
pacman -S luacheck | ||
``` | ||
|
||
## Building | ||
|
||
Following your changes, please run: | ||
|
||
```sh | ||
make | ||
``` | ||
|
||
This will: | ||
1. Generate cterm colors | ||
2. Generate light color variants | ||
3. Check style | ||
4. Lint | ||
|
||
You can automatically fix any style issues via: | ||
```sh | ||
make style-fix | ||
``` | ||
|
||
## Generate Colors | ||
|
||
Add or update icons in `scripts/nvim-web-devicons.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): | ||
```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 | ||
|
||
Ensure your current working directory is the repo root. | ||
Run `make`. This will: | ||
- Update `cterm_color` based on `color` | ||
- 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](README.md#Usage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
all: colors style-check lint | ||
|
||
colors: | ||
nvim --headless -c 'source scripts/generate_colors.lua' -c 'qall' | ||
|
||
style-check: | ||
stylua . --check | ||
|
||
style-fix: | ||
stylua . | ||
|
||
lint: | ||
luacheck . | ||
|
||
.PHONY: all colors style-check style-fix lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.