helm-ag2.el
provides interfaces of The Silver Searcher and ripgrep with helm.
helm-ag2.el
uses rg
command if ripgrep is installed, otherwise it uses ag
command. ripgrep
must be built with pcre2
feature.
- Edit search result like wgrep
Input search word with ag
command. You can change search directory
with C-u
prefix.
Call helm-ag2
at project root. helm-ag2
seems directory as project root where
there is .git
.
Move to point before jump
Clear context stack
Please set helm-follow-mode-persistent
to non-nil if you want to use helm-follow-mode
by default. You must set it before loading helm-ag2.el
.
(custom-set-variables
'(helm-follow-mode-persistent t))
You can see file content temporarily by persistent action(C-j
).
Pattern: -Gmd$ search_pattern
Command line options is -Gmd$
and search pattern is search_pattern
.
helm-ag2
treats words which starts with -
as command line option.
Pattern: -- --count
Search pattern is --count
.
helm-ag2
treats words after --
as search pattern.
ag
(ack
, pt
) takes Perl compatible PCRE so that you need to escape meta characters
likes brackets, braces, asterisk, when you search them as literals.
Don't use space between option and its value. For example -tcpp
is ok, -t cpp
is not ok.
Please always use =
separator for using long option. Don't use space as separator. For example --ignore=pattern
is ok, --ignore pattern
is not ok.
Base command of ag
.
Insert thing at point as default search pattern, if this value is non nil
.
You can set the parameter same as thing-at-point
(Such as 'word
, symbol
etc).
Save buffers you edit at editing completed.
helm-ag2-map
are inherited by helm-map
.
Key | Action |
---|---|
C-c o |
Open other window |
C-l |
Search in parent directory |
C-c C-e |
Switch to edit mode |
C-x C-s |
Save ag results to buffer(Ask save buffer name if prefix key is specified) |
C-c C-f |
Enable helm-follow-mode |
C-c > , right |
Move to next file |
C-c < , left |
Move to previous file |
C-c ? |
Show help message |
Key | Action |
---|---|
C-c C-c |
Commit changes |
C-c C-k |
Abort |
C-c C-d |
Mark delete line |
C-c C-u |
Unmark |
You can use next-error
and previous-error
for seeing file content which
current line indicates.
Key | Action |
---|---|
RET |
Jump to current line position |
C-o |
Jump to current line position in other window |
g |
Update result |
(custom-set-variables
'(helm-ag2-base-command '("ag" "--nocolor" "--nogroup" "--ignore-case"))
'(helm-ag2-insert-at-point 'symbol))