]> code.delx.au - gnu-emacs-elpa/blobdiff - counsel.el
counsel.el (counsel-expression-history): New command
[gnu-emacs-elpa] / counsel.el
index 54729699b36b92e07d65373151c68a4ccfaa5324..e0b421d5afe1462f570a4117b6d3fdc253f3c564 100644 (file)
@@ -1289,6 +1289,12 @@ INITIAL-INPUT can be given as the initial minibuffer input."
 
 ;;* Grep
 ;;** `counsel-ag'
+(defvar counsel-ag-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "C-l") 'counsel-git-grep-recenter)
+    (define-key map (kbd "M-q") 'counsel-git-grep-query-replace)
+    map))
+
 (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
@@ -1328,6 +1334,7 @@ INITIAL-INPUT can be given as the initial minibuffer input."
             'counsel-ag-function
             :initial-input initial-input
             :dynamic-collection t
+            :keymap counsel-ag-map
             :history 'counsel-git-grep-history
             :action #'counsel-git-grep-action
             :unwind (lambda ()
@@ -1862,6 +1869,12 @@ An extra action allows to switch to the process buffer."
                 :action action
                 :require-match t
                 :caller 'counsel-ace-link))))
+;;** `counsel-expression-history'
+;;;###autoload
+(defun counsel-expression-history ()
+  (interactive)
+  (ivy-read "Expr: " (delete-dups read-expression-history)
+            :action #'insert))
 
 ;;* Misc OS
 ;;** `counsel-rhythmbox'