Skip to content

noahbald/grit-telescope.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

grit-telescope.nvim

Grit is query language used for searching and modifying documents.

Getting started

Grit and Telescope need to be installed for this plugin to work

Recording of using gritql for a basic match query

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 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"},
  },
}

About

Telescope plugin for interacting with Grit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages