Grit is query language used for searching and modifying documents.
Grit and Telescope need to be installed for this plugin to work
{
"noahbald/grit-telescope.nvim"
}
If you think a feature is missing, please create an issue for it :)
- Query using grit patterns and workflows
- Display preview of matches
- Display preview of modifications
- Action to apply a specific entry
- Action to apply all entries (Note, only works for future version of grit)
:Telescope grit
key | action |
---|---|
<C-space> |
Apply replacement to selected entry |
<C-f> |
Apply replacement to selected file |
<C-a> |
Apply replacement to all files |
<cr> |
Open file |
:Telescope grit_list
key | action |
---|---|
<cr> |
Run :Telescope grit with the pattern pre-filled |
This plugin wraps around the apply command. The preview always runs the command as a dry run, so no changes are applied without confirmation.
Read grit's reference to see the available options for configuration
{
"noahbald/grit-telescope.nvim",
opts = {
-- Change the directory patterns are queried on
cwd = vim.loop.cwd()
-- Change the default language to use for the pattern.
language = "js",
-- Interpret the request as a natural language request.
ai = false,
-- The source of patterns to display when running `:Telescope grit_list`
source = "user",
},
-- NOTE: Keys are not provided by default
keys = {
{ "<leader>fq", "<cmd>Telescope grit query<cr>", desc = "Telescope Grit Query" },
{ "<leader>fQ", "<cmd>Telescope grit list<cr>", desc = "Telescope Grit User Patterns"},
},
}