Skip to content

Commit 9e835a5

Browse files
authored
perf(refactor): improve code structure (#33)
perf(load): improve loading data speed
1 parent 1fd1869 commit 9e835a5

File tree

13 files changed

+975
-779
lines changed

13 files changed

+975
-779
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- main
99
concurrency:
10-
group: ${{ github.ref }}-${{ github.action }}
10+
group: ${{ github.ref }}/ci
1111
cancel-in-progress: true
1212
jobs:
1313
pr_conventional_commit:

.github/workflows/collect.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
name: Color Collector
22
on:
3-
pull_request:
4-
branches:
5-
- main
63
schedule:
74
- cron: "53 0 * * 1"
85
concurrency:
9-
group: ${{ github.ref }}-${{ github.action }}
6+
group: ${{ github.ref }}/collect
107
cancel-in-progress: true
118
jobs:
129
pipeline:

COLORSCHEMES.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ ColorSchemes List
2121
- [lifepillar/vim-solarized8](https://github.com/lifepillar/vim-solarized8)
2222
- [mhartington/oceanic-next](https://github.com/mhartington/oceanic-next)
2323
- [projekt0n/github-nvim-theme](https://github.com/projekt0n/github-nvim-theme)
24-
- [ellisonleao/gruvbox.nvim](https://github.com/ellisonleao/gruvbox.nvim)
24+
- [ellisonleao/gruvbox.nvim](https://github.com/ellisonleao/gruvbox.nvim)
25+
- [tomasiser/vim-code-dark](https://github.com/tomasiser/vim-code-dark)
26+
- [jnurmine/zenburn](https://github.com/jnurmine/zenburn)
27+
- [romainl/apprentice](https://github.com/romainl/apprentice)
28+
- [marko-cerovac/material.nvim](https://github.com/marko-cerovac/material.nvim)
29+
- [nyoom-engineering/oxocarbon.nvim](https://github.com/nyoom-engineering/oxocarbon.nvim)

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It use offline github actions to weekly collect and update the most popular Vim/
1313
>
1414
> with below conditions:
1515
>
16-
> 1. Github stars ≥ 900.
16+
> 1. Github stars ≥ 800.
1717
> 2. Last git commit in 3 years.
1818
> 3. For multiple plugins that contain the same color name, choose the one in following rules:
1919
> 1. **Awesome-neovim** wins **vimcolorsheme**, since they usually has modern Neovim features (lua, lsp, treesitter) and support more third-party plugins.
@@ -46,8 +46,8 @@ Please check [COLORSCHEMES.md](https://github.com/linrongbin16/colorbox.nvim/blo
4646

4747
## ✅ Requirement
4848

49-
- neovim ≥ 0.8.
50-
- [git](https://git-scm.com/).
49+
- Neovim ≥ 0.8.
50+
- [Git](https://git-scm.com/).
5151

5252
## 📦 Install
5353

@@ -57,15 +57,20 @@ Please check [COLORSCHEMES.md](https://github.com/linrongbin16/colorbox.nvim/blo
5757
require('lazy').setup({
5858
{
5959
'linrongbin16/colorbox.nvim',
60-
lazy = false,
61-
priority = 1000,
60+
lazy = false, -- don't lazy this plugin if it provides the main colorscheme
61+
priority = 1000, -- load this plugin before all other start plugins
6262
build = function() require('colorbox').update() end,
6363
config = function() require('colorbox').setup() end,
6464
}
6565
})
6666
```
6767

68-
> Note: don't lazy this plugin since you usually need set `colorscheme` right after start nvim (it costs ~3 ms to start).
68+
> Note:
69+
>
70+
> If this plugin provides the main colorscheme (e.g. the `colorscheme` command right after nvim start), then make sure:
71+
>
72+
> 1. Don't lazy this plugin.
73+
> 2. Load this plugin before all other start plugins.
6974
7075
## 🔧 Configuration
7176

@@ -77,26 +82,39 @@ require('colorbox').setup({
7782
--- @type "startup"|"interval"|"filetype"
7883
timing = "startup",
7984

85+
-- (Optional) filter color by color name. For now there're two types of filters:
86+
-- 1. the "primary" filter: only the primary colors will be selected, other variants will be skip.
87+
-- 2. the function filter: colors will be filtered if function return true.
88+
--
8089
--- @type "primary"|fun(color:string):boolean|nil
8190
filter = nil,
8291

92+
-- (Optional) setup plugin before running `colorscheme {color}`.
8393
--- @type table<string, function>
8494
setup = {
8595
["projekt0n/github-nvim-theme"] = function()
8696
require("github-theme").setup()
8797
end,
8898
},
8999

100+
-- Run `set background=dark/light` before running `colorscheme {color}`.
101+
--
90102
--- @type "dark"|"light"|nil
91103
background = nil,
92104

93105
-- enable debug
106+
--
107+
--- @type boolean
94108
debug = false,
95109

96110
-- print log to console (command line)
111+
--
112+
--- @type boolean
97113
console_log = true,
98114

99115
-- print log to file.
116+
--
117+
--- @type boolean
100118
file_log = false,
101119
})
102120
```

0 commit comments

Comments
 (0)