https://github.com/david-kunz/ts-quickfix
Neovim plugin to populate a quickfix list with Tree-Sitter queries
https://github.com/david-kunz/ts-quickfix
neovim plugin vim
Last synced: about 2 months ago
JSON representation
Neovim plugin to populate a quickfix list with Tree-Sitter queries
- Host: GitHub
- URL: https://github.com/david-kunz/ts-quickfix
- Owner: David-Kunz
- License: unlicense
- Created: 2022-10-30T15:28:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-03T21:07:42.000Z (over 3 years ago)
- Last Synced: 2025-01-07T07:13:25.892Z (over 1 year ago)
- Topics: neovim, plugin, vim
- Language: Lua
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ts-quickfix
Neovim plugin to populate a [quickfix](https://neovim.io/doc/user/quickfix.html) list with [Tree-Sitter](https://tree-sitter.github.io/tree-sitter/) queries
## Installation
```lua
use 'David-Kunz/ts-quickfix'
```
## Usage
```lua
require('ts-quickfix').query([[
((comment) @comment
(#match? @comment "[^a-zA-Z0-9](TODO|HACK|WARNING|BUG|FIXME|XXX|REVISIT)"))
]])
```
This example is shipped with `require('ts-quickfix').todo()`.
You can also define queries in your `queries` folder and reference them by name:
```lua
require('ts-quickfix').query_name('myName')
```
### Tip:
You can define user commands for your favorite queries, e.g.
```lua
vim.api.nvim_create_user_command('Todo', require('ts-quickfix').todo, {})
```