Skip to content

Commit

Permalink
docs: add docs for notify option
Browse files Browse the repository at this point in the history
  • Loading branch information
shellRaining committed Jun 9, 2023
1 parent f2904b5 commit ddbf215
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 50 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ The script comes with the following defaults:
chunk = {
enable = true,
use_treesitter = true,
notify = true, -- notify if some situation(like disable chunk mod double time)
chars = {
horizontal_line = "",
vertical_line = "",
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Plug "shellRaining/hlchunk.nvim"
{
chunk = {
enable = true,
notify = true, -- 在某些情况下弹出提示(比如连续两次使用 disableHLChunk 命令)
use_treesitter = true,
chars = {
horizontal_line = "",
Expand Down
17 changes: 10 additions & 7 deletions docs/en/blank.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
blank have four configurable items

1. enable
2. chars
3. style
4. exclude_filetype
2. notify
3. chars
4. style
5. exclude_filetype

enable is used to control whether enable hl_blank, if set it to false, its usercmd and autocmd will not set, so it will not work
`enable` is used to control whether enable hl_blank, if set it to false, its usercmd and autocmd will not set, so it will not work

chars is used to configure what char to render the blank, it is a table contains many char, like this
`notify` same as chunk mod

`chars` is used to configure what char to render the blank, it is a table contains many char, like this

```lua
chars = {
Expand All @@ -24,9 +27,9 @@ chars = {
},
```

style is a RGB string or RGB string list, if it is a table, it will choice different color to render different blank (indent)
`style` is a RGB string or RGB string list, if it is a table, it will choice different color to render different blank (indent)

exclude_filetype is opposite of support_filetypes, it is a lua table like this
`exclude_filetype` is opposite of support_filetypes, it is a lua table like this

```lua
exclude_filetype = {
Expand Down
13 changes: 8 additions & 5 deletions docs/en/chunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ it is used to highlight the code block where the cursor is located.
chunk have four configurable items

1. enable
2. use_treesitter
3. exclude_filetypes
4. support_filetypes
5. chars
6. style
2. notify
3. use_treesitter
4. exclude_filetypes
5. support_filetypes
6. chars
7. style

`enable` is used to control whether the mod is started, the default is true.

If set to false, the usercmd and autocmd it carries will not be generated, and the mod will be closed at this time

`notify` is used to control whether to pop up a prompt in some cases (such as using the disableHLChunk command twice in a row), the default is true

`use_treesitter` is used to control whether to use treesitter to highlight the code block, the default is true

If set to false, vim's match will be used to highlight the code block, otherwise treesitter will be used to determine the current code block
Expand Down
21 changes: 12 additions & 9 deletions docs/en/indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
chunk have five configurable items

1. enable
2. use_treesitter
3. chars
4. style
5. exclude_filetype
2. notify
3. use_treesitter
4. chars
5. style
6. exclude_filetype

enable is used to control whether enable hl_indent, if set it to false, its usercmd and autocmd will not set, so it will not work
`enable` is used to control whether enable hl_indent, if set it to false, its usercmd and autocmd will not set, so it will not work

use_treesitter is a boolean value, if set it to true, this mod will judge indent by using treesitter
`notify` is used to control whether notify when some situation(like disable indent mod double time)

chars is used to configure what char to render the indent line, it is a table contains many char, like this
`use_treesitter` is a boolean value, if set it to true, this mod will judge indent by using treesitter

`chars` is used to configure what char to render the indent line, it is a table contains many char, like this

```lua
chars = {
Expand All @@ -25,9 +28,9 @@ chars = {
},
```

style is a RGB string or RGB string list, if it is a table, it will choice different color to render different indent line
`style` is a RGB string or RGB string list, if it is a table, it will choice different color to render different indent line

exclude_filetype is opposite of support_filetypes, it is a lua table like this
`exclude_filetype` is opposite of support_filetypes, it is a lua table like this

```lua
exclude_filetype = {
Expand Down
13 changes: 8 additions & 5 deletions docs/en/line_num.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
line_num have three configurable items

1. enable
2. style
3. support_filetypes
2. notify
3. style
4. support_filetypes

enable is used to control whether enable hl_line_num, if set it to false, its usercmd and autocmd will not set, so it will not work
`enable` is used to control whether enable hl_line_num, if set it to false, its usercmd and autocmd will not set, so it will not work

style is a RGB string, it will set the color of font color of line number
`notify` same as chunk mod

support_filetypes is a table, you can set like this
`style` is a RGB string, it will set the color of font color of line number

`support_filetypes` is a table, you can set like this

```lua
support_filetypes = {
Expand Down
17 changes: 10 additions & 7 deletions docs/zh_CN/blank.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
blank mod 有四个配置项

1. enable
2. chars
3. style
4. exclude_filetype
2. notify
3. chars
4. style
5. exclude_filetype

enable 是用来控制该 mod 是否启动的,如果设置为 false,其所携带的 usercmd 和 autocmd 均不会产生,此时该 mod 关闭
`enable` 是用来控制该 mod 是否启动的,如果设置为 false,其所携带的 usercmd 和 autocmd 均不会产生,此时该 mod 关闭

chars 是一个 lua 表,其中的字符用来指示如何渲染 blank 字符
`notify` 是用来控制是否在某些情况下通知用户,比如禁用 blank mod 两次

`chars` 是一个 lua 表,其中的字符用来指示如何渲染 blank 字符

```lua
chars = {
Expand All @@ -24,9 +27,9 @@ chars = {
},
```

style 是一个 RGB 字符串或者一个表,如果是表,他将会使用不同颜色来渲染 blank
`style` 是一个 RGB 字符串或者一个表,如果是表,他将会使用不同颜色来渲染 blank

exclude_filetype 是 support_filetype 的反面,用来控制在哪些文件类型不渲染 blank
`exclude_filetype` 是 support_filetype 的反面,用来控制在哪些文件类型不渲染 blank

```lua
exclude_filetype = {
Expand Down
13 changes: 8 additions & 5 deletions docs/zh_CN/chunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@
chunk mod 有四个配置项

1. enable
2. use_treesitter
3. exclude_filetypes
4. support_filetypes
5. chars
6. style
2. notify
3. use_treesitter
4. exclude_filetypes
5. support_filetypes
6. chars
7. style

`enable` 是用来控制该 mod 是否启动的,默认为 true。

如果设置为 false,其所携带的 usercmd 和 autocmd 均不会产生,此时该 mod 关闭

`notify` 是用来控制是否在某些情况下弹出提示(比如连续两次使用 disableHLChunk 命令),默认为 true

`use_treesitter` 是用来控制是否使用 treesitter 来高亮代码块,默认为 true

如果设置为 false,将使用 vim 的 match 来高亮代码块,反之使用 treesitter 来判断当前代码块
Expand Down
21 changes: 12 additions & 9 deletions docs/zh_CN/indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
indent mod 有五个配置项

1. enable
2. use_treesitter
3. chars
4. style
5. exclude_filetype
2. notify
3. use_treesitter
4. chars
5. style
6. exclude_filetype

enable 是用来控制该 mod 是否启动的,如果设置为 false,其所携带的 usercmd 和 autocmd 均不会产生,此时该 mod 关闭
`enable` 是用来控制该 mod 是否启动的,如果设置为 false,其所携带的 usercmd 和 autocmd 均不会产生,此时该 mod 关闭

use_treesitter 是一个布尔类型,如果设置为 false,将不会采用基于 treesitter 的渲染
`notify` 是用来控制是否在某些情况下通知用户,比如禁用 indent mod 两次

chars 是一个 lua 表,其中的字符用来指示如何渲染 indent line,这个表中包含五个部分
`use_treesitter` 是一个布尔类型,如果设置为 false,将不会采用基于 treesitter 的渲染

`chars` 是一个 lua 表,其中的字符用来指示如何渲染 indent line,这个表中包含五个部分

```lua
chars = {
Expand All @@ -25,9 +28,9 @@ chars = {
},
```

style 是一个 RGB 字符串或者一个表,如果是表,他将会使用不同颜色来渲染 indent line
`style` 是一个 RGB 字符串或者一个表,如果是表,他将会使用不同颜色来渲染 indent line

exclude_filetype 是 support_filetype 的反面,用来控制在哪些文件类型不渲染 indent line
`exclude_filetype` 是 support_filetype 的反面,用来控制在哪些文件类型不渲染 indent line

```lua
exclude_filetype = {
Expand Down
9 changes: 6 additions & 3 deletions docs/zh_CN/line_num.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
line_num 有三个配置项

1. enable
2. notify
2. style
3. support_filetypes

enable 是用来控制该 mod 是否启动的,如果设置为 false,其所携带的 usercmd 和 autocmd 均不会产生,此时该 mod 关闭
`enable` 是用来控制该 mod 是否启动的,如果设置为 false,其所携带的 usercmd 和 autocmd 均不会产生,此时该 mod 关闭

style 是一个 RGB 字符串或者一个表,如果是表,他将会使用不同颜色来渲染 chunk line
`notify` 是用来控制是否在某些情况下通知用户,比如禁用 line_num mod 两次

support_filetypes 是一个 lua table 类型,例子如下
`style` 是一个 RGB 字符串或者一个表,如果是表,他将会使用不同颜色来渲染 chunk line

`support_filetypes` 是一个 lua table 类型,例子如下

```lua
support_filetypes = {
Expand Down

0 comments on commit ddbf215

Please sign in to comment.