mhinz / mhinz/vim-grepper

As a function writer, I'd like to be able to write "sync" queries

Open
#227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
1.2k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

From first glance, it doesn't seem like there's a way to script Grepper into a function and "wait" until the query is over.

What I'm trying to do

  • :MoveFileAndRename foo/bar/spam
  • Find all usages of an import statement for the current file 'foo/bar/baz' (quickfix)
  • Replace them with 'foo/bar/zoo' (cfdo)

And it looks like I need to add a sleep 1 in my function body for this to work because vimgrepper makes an async search.

Think there's an easy way to return the job ID and wait on it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the vimgrepper asynchronous search path and the function body described in the issue. Determine how a function can observe completion, including whether the search should expose a job ID or a wait mechanism. Done means a function can run the import-replacement workflow without an arbitrary sleep.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.