ARCHIVED: I won’t maintain this package anymore.
Emacs package for more context in compilation/grep buffers. Works with wgrep, ack, ag, ivy, ripgrep.
Use M-x package-install RET grep-context RET
to install this package.
Install dash, then put path to grep-context.el
in your load path:
(add-to-list 'load-path "<path-to-dir-containing-grep-context.el>")
To insert context lines around match at point, call
grep-context-more-around-point
. To kill context lines, call
grep-context-less-around-point
.
These commands take a prefix argument that says how many lines to insert or kill.
The easiest way to enable keybindings for these commands in all compilation
buffers is to use grep-context-mode
, where they’re bound to +
and -
keys:
(add-hook 'compilation-mode-hook #'grep-context-mode)
This package will work with any compilation buffer except it needs
to know how to format context lines. If you want to use it in your
mode, you can add an entry to grep-context-line-format-alist
. You
can also add an entry to grep-context-separator-alist
to specify a
separator for non-contiguous regions of context.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.