mirror of
https://github.com/NotAShelf/syntax-gaslighting.nvim.git
synced 2026-04-17 00:13:48 +00:00
docs: update demo image; document custom hl groups
This commit is contained in:
parent
b4cd8ff197
commit
71c30a336a
2 changed files with 45 additions and 22 deletions
BIN
.github/assets/gaslight.png
vendored
BIN
.github/assets/gaslight.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 134 KiB |
31
README.md
31
README.md
|
|
@ -5,12 +5,19 @@
|
||||||
<img src=".github/assets/gaslight.png" alt="Syntax Gaslighting in action">
|
<img src=".github/assets/gaslight.png" alt="Syntax Gaslighting in action">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Let's face it, syntax highlighting is boring. Why worry about syntax and
|
||||||
|
diagnostics when you can worry about issues that don't even exist? Introducing:
|
||||||
|
**Syntax Gaslighting**. Informs you about very real issues in your code (source:
|
||||||
|
trust me) in real time, making you think twice before you commit another
|
||||||
|
atrocity to production.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
_Use what?_
|
_Use what?_
|
||||||
|
|
||||||
Install with your favorite package manager (or Nix), then call the `setup`
|
Install with your favorite package manager (or Nix), then call the `setup`
|
||||||
function.
|
function. Available configuration options, and configuration recipes are
|
||||||
|
documented below.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require("syntax-gaslighting").setup()
|
require("syntax-gaslighting").setup()
|
||||||
|
|
@ -35,9 +42,9 @@ require("syntax-gaslighting").setup({
|
||||||
|
|
||||||
-- Option to merge user messages with the default ones (default: false)
|
-- Option to merge user messages with the default ones (default: false)
|
||||||
-- If disabled, the messages table will override default messages.
|
-- If disabled, the messages table will override default messages.
|
||||||
merge_messages = true, -- Default is false
|
merge_messages = true,
|
||||||
|
|
||||||
-- Highlight group for gaslighting messages (linked to Comment by default)
|
-- Highlight group for gaslighting messages (linked to 'Comment' by default)
|
||||||
highlight = "GaslightingUnderline",
|
highlight = "GaslightingUnderline",
|
||||||
|
|
||||||
-- Debounce delay for updates in milliseconds (default: 500ms)
|
-- Debounce delay for updates in milliseconds (default: 500ms)
|
||||||
|
|
@ -47,10 +54,26 @@ require("syntax-gaslighting").setup({
|
||||||
auto_update = true,
|
auto_update = true,
|
||||||
|
|
||||||
-- List of filetypes to ignore (default: {"netrw"})
|
-- List of filetypes to ignore (default: {"netrw"})
|
||||||
filetypes_to_ignore = { "netrw", "markdown" }, -- Add filetypes to ignore here
|
filetypes_to_ignore = { "netrw", "markdown" },
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Better Inline Messages
|
||||||
|
|
||||||
|
By default we use the `Comment` highlight group for gaslighting. You may wish to
|
||||||
|
use a different color, e.g., to resemble diagnostic messages. In which case you
|
||||||
|
may define a higlight group, which by default should be named
|
||||||
|
`GaslightingUnderline`, with your own desired properties.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
vim.api.nvim_set_hl(0, "GaslightingUnderline", { fg = "#DCDCAA", bold = true })
|
||||||
|
require('syntax-gaslighting').setup({})
|
||||||
|
```
|
||||||
|
|
||||||
|
The name of this group can be customized by setting `config.highlight` to the
|
||||||
|
name of your desired highlight group. This should be useful to integrate with
|
||||||
|
your favorite theme plugins.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[VSCode extension]: https://github.com/eNiiju/syntax-gaslighting
|
[VSCode extension]: https://github.com/eNiiju/syntax-gaslighting
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue