# New plugin: kak-live-grep

**URL:** <https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129>\
**Category:** Plugins\
**Created:** [September 21, 2022, 2:46am UTC](https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129 "2022-09-21T02:46:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![raiguard](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/raiguard/32/838_2.png) [@raiguard](https://discuss.kakoune.com/u/raiguard)\
**Post date:** [September 21, 2022, 2:46am UTC](https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129/1 "2022-09-21T02:46:03Z")

</div>

[![asciicast](https://asciinema.org/a/QFCtdSfpXby5OFfDcFCAaLiRS.svg)](https://asciinema.org/a/QFCtdSfpXby5OFfDcFCAaLiRS)

It has always bothered me that Kakoune does such a good job with visual feedback when editing, but that it does not extend to the grep integration. To use `:grep`, you have to type your regex, _then_ see if it worked, then try again if it didn’t. I got fed up with it. I tried to integrate an external fuzzy finder like FZF, but I wanted something integrated into Kakoune itself.

Introducing [kak-live-grep](https://git.sr.ht/~raiguard/kak-live-grep)! The plugin is so simple that I can’t believe it wasn’t already made (unless my googling powers are failing me).

There isn’t much to explain, the main feature is fairly obvious. Call the `live-grep` command, and it will open the `*grep*` buffer with a prompt. As you type, the `*grep*` buffer will populate with the results. You can easily spot and fix mistakes with your regex as you go.

~~An extra feature can be enabled with the `live_grep_select_matches` option. If this option is enabled, the exact matches of your regex will be selected in the `*grep*` buffer as you type. Once you are finished typing the query and exit prompt mode, you can easily replace what you searched for with whatever you need. Combined with [grep-write.kak](https://github.com/JacobTravers/grep-write.kak), this enables a very smooth find/replace workflow!~~ This feature has been changed, see below.

One note: the plugin is incredibly stupid, and calls `grepcmd` synchronously on every keystroke. I tested it on small and medium sized projects, but it may chug a bit in large projects.

---

<div class="post-metadata">

**Author:** ![raiguard](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/raiguard/32/838_2.png) [@raiguard](https://discuss.kakoune.com/u/raiguard)\
**Post date:** [September 21, 2022, 8:05pm UTC](https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129/2 "2022-09-21T20:05:10Z")

</div>

After attempting to use this in a real workflow, I encountered a few usability issues and errors.

The live-selection of matches in the results buffer had many issues, and with incomplete regexes, could cause kakoune to hang for seconds at a time. This feature has been removed. Instead, I have added an optional `LiveGrepMatch` face that will live-highlight matches in the results buffer as you type. This solves the performance issues and still lets you see the matches if you wish.

The auto-selection of matches now happens when you complete the query. Using `<ret>` will place you in the grep buffer like normal, but will keep the matches highlighted with `LiveGrepMatch`. Completing the query with `<s-ret>` will remove the highlighter and select the matches as it did before. This is much more ergonomic than changing an option, and allows you to use either modes when you need them. I also fixed several escaping issues when selecting the matches.

Please let me know what you think!

---

<div class="post-metadata">

**Author:** ![raiguard](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/raiguard/32/838_2.png) [@raiguard](https://discuss.kakoune.com/u/raiguard)\
**Post date:** [May 6, 2023, 7:21pm UTC](https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129/3 "2023-05-06T19:21:45Z")

</div>

I have moved back to GitHub, so the new plugin URL is [https://github.com/raiguard/kak-live-grep](https://github.com/raiguard/kak-live-grep). Sorry for the confusion!

---

<div class="post-metadata">

**Author:** ![enricozb](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/enricozb/32/808_2.png) [@enricozb](https://discuss.kakoune.com/u/enricozb)\
**Post date:** [May 15, 2023, 3:13am UTC](https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129/4 "2023-05-15T03:13:58Z")

</div>

It looks like the recording was archived! Could you make a new one?

---

<div class="post-metadata">

**Author:** ![raiguard](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/raiguard/32/838_2.png) [@raiguard](https://discuss.kakoune.com/u/raiguard)\
**Post date:** [December 14, 2023, 5:35pm UTC](https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129/5 "2023-12-14T17:35:35Z")

</div>

Sorry for missing this, recording has been updated on the GitHub readme.

The plugin has also been updated with a few new customization options. `live_grep_timeout` will adjust the timeout when updating results (defaults to 300), and `live_grep_results_limit` adjust the maximum number of results that will be displayed (defaults to 10,000). Both of these are to fix performance issues I’ve experienced when using this plugin in large codebases.

---

<div class="post-metadata">

**Author:** ![raiguard](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/raiguard/32/838_2.png) [@raiguard](https://discuss.kakoune.com/u/raiguard)\
**Post date:** [December 28, 2025, 9:37pm UTC](https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129/6 "2025-12-28T21:37:22Z")

</div>

kak-live-grep now lives on [Codeberg](https://codeberg.org/raiguard/kak-live-grep). Please update your plugin managers accordingly!

---

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [December 29, 2025, 1:31am UTC](https://discuss.kakoune.com/t/new-plugin-kak-live-grep/2129/7 "2025-12-29T01:31:53Z")

</div>

Split this topic on December 29, 2025, 1:31am UTC

2 posts were split to a new topic: [Codeberg, Sourcehut, Oh-My](https://discuss.kakoune.com/t/codeberg-sourcehut-oh-my/2801)
