(when file
(find-file file))))
+(defun counsel-git-grep-count (str)
+ "Quickly count the amount of git grep STR matches."
+ (shell-command-to-string
+ (format "git grep -c '%s' | sed 's/.*:\\(.*\\)/\\1/g' | awk '{s+=$1} END {print s}'" str)))
+
(defun counsel-git-grep-function (string &optional _pred &rest _unused)
"Grep in the current git repository for STRING."
(split-string
(define-key map (kbd "C-j") 'ivy-alt-done)
(define-key map (kbd "C-n") 'ivy-next-line)
(define-key map (kbd "C-p") 'ivy-previous-line)
+ (define-key map (kbd "<down>") 'ivy-next-line)
+ (define-key map (kbd "<up>") 'ivy-previous-line)
(define-key map (kbd "C-s") 'ivy-next-line-or-history)
(define-key map (kbd "C-r") 'ivy-previous-line-or-history)
(define-key map (kbd "SPC") 'self-insert-command)
(define-key map (kbd "DEL") 'ivy-backward-delete-char)
(define-key map (kbd "M-<") 'ivy-beginning-of-buffer)
(define-key map (kbd "M->") 'ivy-end-of-buffer)
+ (define-key map (kbd "<left>") 'ivy-beginning-of-buffer)
+ (define-key map (kbd "<right>") 'ivy-end-of-buffer)
(define-key map (kbd "M-n") 'ivy-next-history-element)
(define-key map (kbd "M-p") 'ivy-previous-history-element)
(define-key map (kbd "C-g") 'minibuffer-keyboard-quit)
ivy--old-cands)
((and ivy--old-re
(not (equal ivy--old-re ""))
- (eq 0 (cl-search ivy--old-re re)))
+ (memq (cl-search
+ (if (string-match "\\\\)$" ivy--old-re)
+ (substring ivy--old-re 0 -2)
+ ivy--old-re)
+ re) '(0 2)))
(ignore-errors
(cl-remove-if-not
(lambda (x) (string-match re x))
(interactive)
(swiper--ivy initial-input))
-(defvar swiper--overlays nil
- "Store overlays.")
-
(defvar swiper--anchor nil
"A line number to which the search should be anchored.")
(setq expose (overlay-get ov 'isearch-open-invisible)))
(funcall expose ov)))))
+(defvar swiper--overlays nil
+ "Store overlays.")
+
(defun swiper--cleanup ()
"Clean up the overlays."
(while swiper--overlays