]> code.delx.au - gnu-emacs-elpa/commitdiff
counsel.el (counsel-ag): Add transformer
authorjustbur <justin@burkett.cc>
Mon, 14 Mar 2016 13:30:39 +0000 (09:30 -0400)
committerjustbur <justin@burkett.cc>
Mon, 14 Mar 2016 14:36:29 +0000 (10:36 -0400)
Also change command options to match git grep output. This is not
critical but it makes the commands more consistent.

counsel.el

index 128763db6808d0b141183e3b7e667e32cf9215c3..81097b84056bd367ab37d561e421b2e6dc056f4f 100644 (file)
@@ -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."