Minor updates.

This commit is contained in:
Derek Taylor
2020-08-11 17:27:59 -05:00
parent c00618a23a
commit 367af05623
154 changed files with 2484 additions and 1801 deletions

View File

@@ -77,6 +77,26 @@ Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with
((format "%s" val)))
t)))
;;;###autoload
(defun +ivy-format-function-line-or-arrow (cands)
"Transform CANDS into a string for minibuffer.
If in terminal, prefix candidates with a chevron to make it more obvious which
one you're selecting, especially in themes that can't set a good background for
`ivy-current-match'. This is a combination of `ivy-format-function-line' and
`ivy-format-function-arrow'.
In the GUI, this is the same as `ivy-format-function-line'."
(if (display-graphic-p)
(ivy-format-function-line cands)
(ivy--format-function-generic
(lambda (str)
(ivy--add-face (concat "> " str "\n") 'ivy-current-match))
(lambda (str)
(concat " " str "\n"))
cands
"")))
;;
;; Library

View File

@@ -69,7 +69,7 @@ results buffer.")
;; Highlight each ivy candidate including the following newline, so that it
;; extends to the right edge of the window
(setf (alist-get 't ivy-format-functions-alist)
#'ivy-format-function-line)
#'+ivy-format-function-line-or-arrow)
;; Integrate `ivy' with `better-jumper'; ensure a jump point is registered
;; before jumping to new locations with ivy
@@ -278,11 +278,11 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
"Change `counsel-file-jump' to use fd or ripgrep, if they are available."
:override #'counsel--find-return-list
(cl-destructuring-bind (find-program . args)
(cond ((executable-find doom-projectile-fd-binary)
(append (list doom-projectile-fd-binary
"--color=never" "-E" ".git"
"--type" "file" "--type" "symlink" "--follow")
(if IS-WINDOWS '("--path-separator=/"))))
(cond ((when-let (fd (executable-find (or doom-projectile-fd-binary "fd")))
(append (list fd
"--color=never" "-E" ".git"
"--type" "file" "--type" "symlink" "--follow")
(if IS-WINDOWS '("--path-separator=/")))))
((executable-find "rg")
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "--no-messages")
(cl-loop for dir in projectile-globally-ignored-directories
@@ -296,10 +296,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(cons find-program args)
(lambda ()
(goto-char (point-min))
(let ((offset (if (member find-program (list "rg" doom-projectile-fd-binary)) 0 2))
files)
(let (files)
(while (< (point) (point-max))
(push (buffer-substring (+ offset (line-beginning-position)) (line-end-position))
(push (buffer-substring (line-beginning-position) (line-end-position))
files)
(forward-line 1))
(nreverse files)))))))

View File

@@ -1,18 +1,18 @@
;; -*- no-byte-compile: t; -*-
;;; completion/ivy/packages.el
(package! swiper :pin "544e7de63a4543a74596c5d95efa0bb9da25791e")
(package! swiper :pin "c6b60d34ac37bf4d91a25f16d22e528f85e06938")
(package! ivy)
(package! ivy-hydra)
(package! counsel)
(package! amx :pin "7fb7b874291e0cdeb1f0acb18564a686ec86788d")
(package! amx :pin "ccfc92c600df681df5e8b5fecec328c462ceb71e")
(package! counsel-projectile :pin "77392cbbc42e98fc137b43f1db1b111ba6e2dd75")
(package! ivy-rich :pin "10970130b41c6ef9570893cdab8dfbe720e2b1a9")
(package! wgrep :pin "f0ef9bfa44db503cdb2f83fcfbd2fa4e2382ef1f")
(if (featurep! +prescient)
(package! ivy-prescient :pin "3ab7605d997fb8337bf5ded2ad960b98ac0e1fd7")
(package! ivy-prescient :pin "b11d79b10df12c58edc3487371c2c47dfb9b50e6")
(when (featurep! +fuzzy)
(package! flx :pin "17f5c9cb2af18aa6f52910ff4a5a63591261ced5")))