You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Grit is query language used for searching and modifying documents.
Getting started
Grit and Telescope need to be installed for this plugin to work
Lazy
{
"noahbald/grit-telescope.nvim"
}
Features
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)
Usage
: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
Configuration
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 oncwd=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 defaultkeys= {
{ "<leader>fq", "<cmd>Telescope grit query<cr>", desc="Telescope Grit Query" },
{ "<leader>fQ", "<cmd>Telescope grit list<cr>", desc="Telescope Grit User Patterns"},
},
}