Skip to content

Commit c614017

Browse files
authored
fix(policy): correctly save track on loading colorscheme (#235)
refactor(command)!: remove `reinstall` and `clean` sub commands (#235)
1 parent 3928f97 commit c614017

File tree

18 files changed

+109
-913
lines changed

18 files changed

+109
-913
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- lint
6161
strategy:
6262
matrix:
63-
nvim_version: [stable, nightly, v0.7.0]
63+
nvim_version: [stable, nightly, v0.9.0]
6464
runs-on: ubuntu-latest
6565
steps:
6666
- uses: actions/checkout@v4

README.md

Lines changed: 21 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# 🌈 colorbox.nvim
44

55
<p>
6-
<a href="https://github.com/neovim/neovim/releases/v0.7.0"><img alt="require" src="https://img.shields.io/badge/require-0.7%2B-blue" /></a>
6+
<a href="https://github.com/neovim/neovim/releases/v0.9.0"><img alt="require" src="https://img.shields.io/badge/require-0.9%2B-blue" /></a>
77
<a href="https://github.com/linrongbin16/commons.nvim"><img alt="commons.nvim" src="https://img.shields.io/badge/power_by-commons.nvim-pink" /></a>
88
<a href="https://luarocks.org/modules/linrongbin16/colorbox.nvim"><img alt="luarocks" src="https://img.shields.io/luarocks/v/linrongbin16/colorbox.nvim" /></a>
99
<a href="https://github.com/linrongbin16/colorbox.nvim/actions/workflows/ci.yml"><img alt="ci.yml" src="https://img.shields.io/github/actions/workflow/status/linrongbin16/colorbox.nvim/ci.yml?label=ci" /></a>
@@ -92,53 +92,14 @@ And multiple trigger timings:
9292

9393
## ✅ Requirements
9494

95-
- neovim &ge; 0.7.
95+
- neovim &ge; 0.9.
9696
- [git](https://git-scm.com/).
97-
- [rm](https://man7.org/linux/man-pages/man1/rm.1.html) (optional for `reinstall` command on Windows).
98-
99-
<details>
100-
<summary><i>Click here to see how to install `rm` command on Windows</i></summary>
101-
<br/>
102-
103-
There're many ways to install portable linux shell and builtin commands on Windows, but personally I would recommend below two methods.
104-
105-
### [Git for Windows](https://git-scm.com/download/win)
106-
107-
Install with the below 3 options:
108-
109-
- In **Select Components**, select **Associate .sh files to be run with Bash**.
110-
111-
<img alt="install-windows-git-step1.jpg" src="https://github.com/linrongbin16/colorbox.nvim/assets/6496887/6f2e0b34-4425-4766-85be-799d97aef80a" width="70%" />
112-
113-
- In **Adjusting your PATH environment**, select **Use Git and optional Unix tools from the Command Prompt**.
114-
115-
<img alt="install-windows-git-step2.jpg" src="https://github.com/linrongbin16/colorbox.nvim/assets/6496887/2ff32b3b-2ade-4f3c-b25b-50e4b521f2e8" width="70%" />
116-
117-
- In **Configuring the terminal emulator to use with Git Bash**, select **Use Windows's default console window**.
118-
119-
<img alt="install-windows-git-step3.png" src="https://github.com/linrongbin16/colorbox.nvim/assets/6496887/944147d1-e180-4e63-aecc-991c9c1093b0" width="70%" />
120-
121-
After this step, **git.exe** and builtin linux commands(such as **rm.exe**) will be available in `%PATH%`.
122-
123-
### [scoop](https://scoop.sh/)
124-
125-
Run below powershell commands:
126-
127-
```powershell
128-
# scoop
129-
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
130-
irm get.scoop.sh | iex
131-
132-
scoop install uutils-coreutils # rm
133-
```
134-
135-
</details>
13697

13798
## 📦 Install
13899

139100
> [!IMPORTANT]
140101
>
141-
> If this plugin provides the main colorscheme (e.g. the color show right after nvim start), then make sure:
102+
> If this plugin provides the main colorscheme (i.e. the color show right after nvim start), then make sure:
142103
>
143104
> 1. Don't lazy load it.
144105
> 2. Load it before all other plugins.
@@ -158,17 +119,17 @@ scoop install uutils-coreutils # rm
158119

159120
```lua
160121
require('lazy').setup({
161-
{
162-
'linrongbin16/colorbox.nvim',
122+
{
123+
'linrongbin16/colorbox.nvim',
163124

164-
-- don't lazy load
165-
lazy = false,
166-
-- load with highest priority
167-
priority = 1000,
125+
-- don't lazy load
126+
lazy = false,
127+
-- load with highest priority
128+
priority = 1000,
168129

169-
build = function() require("colorbox").update() end,
170-
config = function() require("colorbox").setup() end,
171-
}
130+
build = function() require("colorbox").update() end,
131+
config = function() require("colorbox").setup() end,
132+
}
172133
})
173134
```
174135

@@ -179,20 +140,20 @@ require('lazy').setup({
179140

180141
```lua
181142
require('pckr').add({
182-
{
183-
'linrongbin16/colorbox.nvim',
143+
{
144+
'linrongbin16/colorbox.nvim',
184145

185-
run = function() require("colorbox").update() end,
186-
config = function() require("colorbox").setup() end,
187-
};
146+
run = function() require("colorbox").update() end,
147+
config = function() require("colorbox").setup() end,
148+
};
188149
})
189150
```
190151

191152
</details>
192153

193154
## 🚀 Usage
194155

195-
When loading plugin, it will run following steps:
156+
When loading this plugin, it will run following steps:
196157

197158
1. Run the filters, only enable the colors you choose from candidate list. See [Filter](#filter).
198159
2. Register triggers to invoke related policies at a proper timing. See [Timing & Policy](#timing--policy).
@@ -206,13 +167,12 @@ When a timing is triggered, it will run following steps:
206167
You can also use command `Colorbox` to control the player with below subcommands:
207168

208169
- `update`: Update all git submodules.
209-
- `reinstall`: Clean & re-install all git submodules.
210170
- `info`: Show detailed information and configured status.
211171
- **Note:** use `scale=0.7` to specify popup window's size in range `(0, 1]`, by default is `scale=0.7`.
212172

213173
> [!NOTE]
214174
>
215-
> You can still use `colorscheme` command to change colorscheme.
175+
> You can still use `colorscheme` command to change the colorscheme.
216176
217177
## 🔧 Configuration
218178

@@ -265,11 +225,9 @@ The `colorbox.ColorSpec` type is a lua table that has below fields:
265225
- `priority`: Plugin priority, `integer` type, for example:
266226
- **awesome-neovim** is `100`
267227
- **vimcolorschemes** is `0`
268-
- `source`: Data source, `string` type, for example:
269-
- **awesome-neovim** is `"https://www.trackawesomelist.com/rockerBOO/awesome-neovim/readme/#colorscheme"`
270228
- `git_path`: Git submodule file path, `string` type, for example:
271229
- `"folke-tokyonight.nvim"`
272-
- `git_branch`: Optional git branch of plugin (most plugins use default main/master branch, while some have specific branch), `string?` type, for example:
230+
- `git_branch`: (Optional) git branch of plugin (most plugins use default branch such as `main` or `master`, while some use specific branch such as `neovim`), `string?` type, for example:
273231
- `"neovim"`
274232
- `color_names`: Color names that plugin contains, `string[]` type, for example:
275233
- `["tokyonight","tokyonight-day","tokyonight-moon","tokyonight-night","tokyonight-storm"]`
@@ -342,7 +300,7 @@ The filetype timing needs to specify below 2 fields in its policy:
342300

343301
### Background
344302

345-
There're some colors (`tokyonight-day`, `rose-pine-dawn`) are forced to be light, e.g. they forced `set background=light` on loading. Thus the other following colors will continue use `light` background.
303+
There're some colors (`tokyonight-day`, `rose-pine-dawn`) are forced to be light, i.e. they forced `set background=light` on loading. Thus the other following colors will continue use `light` background.
346304

347305
If you want to bring the dark-able colors back to `dark`, please use:
348306

0 commit comments

Comments
 (0)