Skip to content

Commit

Permalink
docs: about how to enable plugin specficly
Browse files Browse the repository at this point in the history
  • Loading branch information
shellRaining committed May 25, 2024
1 parent 2f25e09 commit 9322a67
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,32 @@ The specific configuration methods for each mod can be found in their respective
- [line_num](./docs/en/line_num.md)
- [blank](./docs/en/blank.md)

You can config the whole plugin by using setup function:

```lua
require('hlchunk').setup({
chunk = {
enable = true
-- ...
},
indent = {
enable = true
-- ...
}
})
```

Require the specific mod alone also work

```lua
local indent = require('hlchunk.mods.indent')
indent({
style = {
-- ...
}
}):enable() -- don't forget call enable method
```

## command

Sometimes (e.g., for performance reasons), you may want to manually disable a certain mod, you can follow the rules below: enter `DisableHLxxxx`, replacing `xxxx` with the name of the mod you want to disable, for example, to disable `chunk`, you can enter `DisableHLchunk`.
Expand Down
26 changes: 26 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,32 @@ local default_conf = {
- [line_num](./docs/zh_CN/line_num.md)
- [blank](./docs/zh_CN/blank.md)

你可以通过一个总的 setup 函数来进行配置:

```lua
require('hlchunk').setup({
chunk = {
enable = true
-- ...
},
indent = {
enable = true
-- ...
}
})
```

也可以通过引入单独的 mod 来启动:

```lua
local indent = require('hlchunk.mods.indent')
indent({
style = {
-- ...
}
}):enable() -- 不要忘记加上 enable 来明确的表示启动
```

## command

有时候(比如性能原因),你可能想要手动关闭某个 mod,可以遵循下面的规则:输入 `DisableHLxxxx`,其中把 `xxxx` 替换为你想要关闭的 mod 名称,比如关闭 `chunk`,你可以输入 `DisableHLchunk`
Expand Down

0 comments on commit 9322a67

Please sign in to comment.