krobelus / kakoune-find

Find and replace on open buffers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kakoune-find (and replace)

kakoune plugin to search for a pattern in all open buffers, and optionally replace it. Works similarly to grep.kak, but does not operate on files.

demo

Setup

Add find.kak to your autoload dir: ~/.config/kak/autoload/, or source it manually.

Usage

Finding

Call the find command. You can specify the pattern as the first argument, otherwise the content of the main selection will be used. From the *find* buffer you can jump to the actual match using <ret>.

Replacing

Replacing is done from the *find* buffer. Write directly there the changes that you want to make. Then, call find-apply-changes: the changes will be applied back to their respective buffers. Any lines that were not modified are simply ignored.

By default, this command only works on open buffers. However, you can specify -force to make kakoune temporarily open the file to write the change.

Since the format is the same as grep.kak's, this command can just as well be used from a *grep* buffer. Any line that doesn't follow the <file>:<line>:<column>:<content> pattern is simply ignored.

License

Unlicense

About

Find and replace on open buffers

License:The Unlicense


Languages

Language:KakouneScript 100.0%