All Projects → zk-phi → phi-grep

zk-phi / phi-grep

Licence: other
Interactively-editable recursive grep implementation in elisp

Programming Languages

emacs lisp
2029 projects

Labels

phi-grep.el

Elisp 実装の編集可能な再帰 grep

interactively-editable recursive grep implementation in elisp

Screencast

screencast.gif

Usage

Require this script

(require 'phi-grep)

then following commands are available.

phi-grep-in-file
grep in a single file
phi-grep-in-directory
recursive grep in a directory tree

In dired-mode buffers, following commands are available in addition.

phi-grep-dired-in-dir-at-point
grep in a directory at point
phi-grep-dired-in-file-at-point
grep in a file at point
phi-grep-dired-in-marked-files
grep in all marked files
phi-grep-dired-in-all-files
grep in all listed files
phi-grep-dired-dwim
automatically choose one of above

In the phi-grep result buffer, you can also perform a recursive grep.

phi-grep-recursive
grep within the files in the current result

You can exit phi-grep with one of [C-g] or [RET]. [C-g] will jump you back to the original position where phi-grep is invoked, and [RET] does not.

You can optionally edit the result of grep, and you will asked whether to commit changes or not.

Advantages

  • Implemented in pure Elisp.
    • phi-grep can also search in opened buffers (not only files on the disk), thus the result can reflect unsaved changes.
    • phi-grep does not depends on the external command “grep”. So you can do grep-and-edit on every OS that Emacs can run on.
  • Result is editable INTERACTIVELY with preview.
  • Result is consistent even when you edit some parts of matched files after phi-grep.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].