Find and replace on open buffers
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md update asciinema Feb 4, 2018
UNLICENSE First commit Sep 19, 2017
find.kak

README.md

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