helm for git-grep(1), an incremental git-grep(1).
- helm-git-grep.el
- Table of Contents
Created by gh-md-toc
- Grep submodules too, if submodules exists.
- Open in other window, other frame, or [
elscreen
]. - Toggle ignore case option when incremental greping.
- Save grep result in grep buffer which is writable with [
wgrep
].
-
wgrep enable a grep buffer editable and apply those changes to the file buffer.
-
You can open a file in elscleen.
-
git >= 1.9.0
You must have the git version 1.9.0 or above to use pathspec feature.
If you're an Emacs 24 user or you have a recent version of package.el
you can install helm-git-grep.el
from the MELPA repository.
Add the following to your emacs init file.
(require 'helm-git-grep) ;; Not necessary if installed by package.el
(global-set-key (kbd "C-c g") 'helm-git-grep)
;; Invoke `helm-git-grep' from isearch.
(define-key isearch-mode-map (kbd "C-c g") 'helm-git-grep-from-isearch)
;; Invoke `helm-git-grep' from other helm.
(eval-after-load 'helm
'(define-key helm-map (kbd "C-c g") 'helm-git-grep-from-helm))
Helm git grep. if submodules exists, grep submodules too.
Helm git grep with symbol at point. if submodules exists, grep submodules too.
These Actions are available.
Action | Description |
---|---|
Find file | Jump to result. |
Find file other frame | Jump to result in other frame. |
Find file in Elscreen | Jump to result in elscreen. |
Save results in grep buffer | Save helm git grep result in a grep-mode buffer. |
Find file other window | Jump to result in other window. |
These commands are available when executing incremental [git grep] by helm-git-grep
.
For more information about keymap, execute C-c ? helm-git-grep-help
.
Key | Command | Description |
---|---|---|
C-z | helm-git-grep-persistent-action | Persistent action. With a prefix arg record candidate in mark-ring . |
C-c C-o | helm-git-grep-run-other-frame-action | Jump to result in other frame. |
C-c e | helm-git-grep-run-elscreen-action | Jump to result in elscreen. |
C-x C-s | helm-git-grep-run-save-buffer | Save helm git grep result in a grep-mode buffer. |
C-c o | helm-git-grep-run-other-window-action | Jump to result in other window. |
C-c i | helm-git-grep-toggle-ignore-case | Toggle ignore case option. |
C-w | helm-yank-text-at-point | Yank text at point in invocation buffer into minibuffer. |
C-c ? | helm-git-grep-help | Help command for helm-git-grep . |
M-<down> | helm-goto-next-file | Go to precedent file in helm git grep buffers. |
M-<up> | helm-goto-precedent-file | Go to next file in helm git grep buffers. |
Toggle ignore case option when incremental greping.
The ignore case option is correspond to -i
option of git grep
.
A buffer name is *helm git grep [i]*
with ignore case option.
A buffer name is *helm git grep*
without ignore case option.
(Default: '(helm-git-grep-source helm-git-grep-submodule-source)
)
Default helm sources for helm-git-grep
.
If you don't want to search in submodules, Set only helm-git-grep-source
like this:
(setq helm-git-grep-sources '(helm-git-grep-source))
(Default: 300
)
Limit candidate number helm-git-grep
.
(Default: 100
)
Max number of elements to save in helm-git-grep-history
.
(Default: t
)
Use Arrow keys to jump to occurrences.
(Default: t
)
Ignore case when matching.
(Default: nil
)
Deactivate the mark when helm-git-grep-at-point
is invoked.
(Default: 'root
)
Base directory for search by git-grep(1).
Possible value are:
- root: git root directory
- current: current directory (default directory of current buffer)
(Default: nil
)
Pattern used to limit paths in git-grep(1) commands.
Each pathspec have not to be quoted by singe quotation like executing git command in inferior shell. Because helm-git-grep
run git command by start-process
, and start-process
is not executed in inferior shell. So, if pathspec is quoted by singe quotation, pathspec can't work in git-grep(1) by helm-git-grep
.
For more information about pathspec, See pathspec in Git gitglossary Documentation.
If there is something wrong about pathspec configuration, you can check limit paths by pathspec using helm-git-grep-ls-files-limited-by-pathspec
.
Face used to highlight git-grep(1) matches.
Face used to highlight git-grep(1) results filenames.
Face used to highlight git-grep(1) number lines.