From: justbur Date: Mon, 14 Mar 2016 13:30:39 +0000 (-0400) Subject: counsel.el (counsel-ag): Add transformer X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/e8f516ec7ef27aac83ab4f2abe88bdb2266be514 counsel.el (counsel-ag): Add transformer Also change command options to match git grep output. This is not critical but it makes the commands more consistent. --- diff --git a/counsel.el b/counsel.el index 128763db6..81097b840 100644 --- a/counsel.el +++ b/counsel.el @@ -1265,15 +1265,16 @@ INITIAL-INPUT can be given as the initial minibuffer input." ;;* Grep ;;** `counsel-ag' -(defcustom counsel-ag-base-command "ag --vimgrep %s" +(defcustom counsel-ag-base-command "ag --nocolor --nogroup %s -- ." "Format string to use in `cousel-ag-function' to construct the command. %S will be replaced by the regex string. The default is -\"ag --vimgrep %S\"." +\"ag --nocolor --nogroup %s -- .\"." :type 'string :group 'ivy) (counsel-set-async-exit-code 'counsel-ag 1 "No matches found") (ivy-set-occur 'counsel-ag 'counsel-ag-occur) +(ivy-set-display-transformer 'counsel-ag 'counsel-git-grep-transformer) (defun counsel-ag-function (string) "Grep in the current directory for STRING."