Refactor ivy config

This commit is contained in:
Henrik Lissner 2016-06-13 02:12:22 -04:00
parent 7038a5b66d
commit d00582ae9c
2 changed files with 20 additions and 12 deletions

View file

@ -59,5 +59,18 @@ DIR specifies the default-directory from which ag is run."
(interactive "<r><a><!>")
(doom:ivy-ag-search beg end search regex-p default-directory))
;;;###autoload
(defun doom*counsel-ag-function (string)
"Advice to get rid of the character limit from `counsel-ag-function', which
interferes with my custom :ag ex command `doom:ivy-ag-search'."
(if (< (length string) 1)
(counsel-more-chars 1)
(let ((default-directory counsel--git-grep-dir)
(regex (counsel-unquote-regex-parens
(setq ivy--old-re (ivy--regex string)))))
(counsel--async-command
(format counsel-ag-base-command (shell-quote-argument regex)))
nil)))
(provide 'defuns-ivy)
;;; defuns-ivy.el ends here