Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/folke/paint.nvim
Easily add additional highlights to your buffers
https://github.com/folke/paint.nvim
neovim neovim-plugin
Last synced: 5 days ago
JSON representation
Easily add additional highlights to your buffers
- Host: GitHub
- URL: https://github.com/folke/paint.nvim
- Owner: folke
- License: apache-2.0
- Created: 2022-11-16T07:43:42.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-19T19:15:08.000Z (over 1 year ago)
- Last Synced: 2024-02-16T14:30:46.870Z (9 months ago)
- Topics: neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 34.2 KB
- Stars: 149
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎨 Paint
Simple Neovim plugin to easily add additional highlights to your buffers.
See the `@something` comments in the screenshot. Those are not coming from the `comment` **Treesitter** parser.
![image](https://user-images.githubusercontent.com/292349/202141321-0c501a4f-163a-4a6f-8d0d-0c79d11a05a3.png)
## ❓ Why?
The reason I implemented this is because of the slow performance of [tree-sitter-comment](https://github.com/stsewd/tree-sitter-comment)
in large files. **Treesitter** will inject the `comment` language for every line
comment, which is far from ideal. I've disabled the `comment` parser, but still wanted
to see `@something` highlighted in Lua comments.## ⚡️ Requirements
- Neovim >= 0.8.0
## 📦 Installation
Install the plugin with your preferred package manager:
```lua
-- Packer
use({
"folke/paint.nvim",
config = function()
require("paint").setup({
---@type PaintHighlight[]
highlights = {
{
-- filter can be a table of buffer options that should match,
-- or a function called with buf as param that should return true.
-- The example below will paint @something in comments with Constant
filter = { filetype = "lua" },
pattern = "%s*%-%-%-%s*(@%w+)",
hl = "Constant",
},
},
})
end,
})
```