summaryrefslogtreecommitdiff
path: root/doc/Home.mdpp
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2015-02-16 11:57:09 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2015-02-16 11:57:09 +0100
commitffd193f4a8e96004f0c0b68f9e625c3e45b39022 (patch)
tree1b8f53423b567702ffd9d208b4fddef50a1e330a /doc/Home.mdpp
parent2b356c5493ae2d4cb0f4d1663ad9a8e51f150335 (diff)
* doc/Home.mdpp: Document grep highlighting.
Diffstat (limited to 'doc/Home.mdpp')
-rw-r--r--doc/Home.mdpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/Home.mdpp b/doc/Home.mdpp
index 7f1fc6b5..b78c506d 100644
--- a/doc/Home.mdpp
+++ b/doc/Home.mdpp
@@ -612,6 +612,42 @@ _NOTE:_ You can save differents named helm grep buffers.
Editing the `helm-grep-mode` buffer is possible with [Emacs-wgrep](https://github.com/mhayashi1120/Emacs-wgrep).
Saving this buffer will apply changes to corresponding files.
+## Highlighting grep matched results
+
+By default helm have its own implementation to highlight matched items, however it is better to
+use the backend way to highlight result with ANSI sequences e.g:
+
+For ack-grep:
+
+ (setq helm-grep-default-command
+ "ack-grep -Hn --smart-case --no-group %e %p %f"
+ helm-grep-default-recurse-command
+ "ack-grep -H --smart-case --no-group %e %p %f")
+
+For grep:
+
+ (setq helm-grep-default-command
+ "grep --color=always -d skip %e -n%cH -e %p %f"
+ helm-grep-default-recurse-command
+ "grep --color=always -d recurse %e -n%cH -e %p %f")
+
+For git-grep
+
+ (setq helm-ls-git-grep-command
+ "git grep -n%cH --color=always --full-name -e %p %f")
+
+
+The color of git-grep can be customized from global .gitconfig file.
+
+See the docstring of `helm-grep-default-command` for more infos.
+
+NOTE: The non--matched part of the resulting lines in grep will be hidden
+when using "--color=always", to fix this you have to set the env var "GREP_COLORS" for emacs:
+
+ (setenv "GREP_COLORS" "ms=30;43:mc=30;43:sl=01;37:cx=:fn=35:ln=32:bn=32:se=36")
+
+This will colorize in black/yellow matched items.
+
# Helm M-x
It is bound to `helm-command-prefix-key` `M-x`, you should bind it to `M-x`.