Allow users to customise candidate sort order
This commit is contained in:
parent
9f9b522faf
commit
776ab59b38
1 changed files with 20 additions and 0 deletions
|
|
@ -305,9 +305,13 @@ With a prefix ARG, invalidate the cache first."
|
|||
(projectile-current-project-files)
|
||||
:matcher #'counsel--find-file-matcher
|
||||
:require-match t
|
||||
:sort t
|
||||
:action counsel-projectile-find-file-action
|
||||
:caller 'counsel-projectile-find-file))
|
||||
|
||||
(unless (assq #'counsel-projectile-find-file ivy-sort-functions-alist)
|
||||
(push (list #'counsel-projectile-find-file) ivy-sort-functions-alist))
|
||||
|
||||
(ivy-set-display-transformer
|
||||
'counsel-projectile-find-file
|
||||
'counsel-projectile-find-file-transformer)
|
||||
|
|
@ -354,9 +358,13 @@ With a prefix ARG, invalidate the cache first."
|
|||
(ivy-read (projectile-prepend-project-name "Find dir: ")
|
||||
(counsel-projectile--project-directories)
|
||||
:require-match t
|
||||
:sort t
|
||||
:action counsel-projectile-find-dir-action
|
||||
:caller 'counsel-projectile-find-dir))
|
||||
|
||||
(unless (assq #'counsel-projectile-find-dir ivy-sort-functions-alist)
|
||||
(push (list #'counsel-projectile-find-dir) ivy-sort-functions-alist))
|
||||
|
||||
;;;; counsel-projectile-switch-to-buffer
|
||||
|
||||
(defcustom counsel-projectile-remove-current-buffer nil
|
||||
|
|
@ -412,9 +420,13 @@ names as in `ivy--buffer-list', and remove current buffer if
|
|||
(counsel-projectile--project-buffers)
|
||||
:matcher #'ivy--switch-buffer-matcher
|
||||
:require-match t
|
||||
:sort t
|
||||
:action counsel-projectile-switch-to-buffer-action
|
||||
:caller 'counsel-projectile-switch-to-buffer))
|
||||
|
||||
(unless (assq #'counsel-projectile-switch-to-buffer ivy-sort-functions-alist)
|
||||
(push (list #'counsel-projectile-switch-to-buffer) ivy-sort-functions-alist))
|
||||
|
||||
(ivy-set-display-transformer
|
||||
'counsel-projectile-switch-to-buffer
|
||||
'ivy-switch-buffer-transformer)
|
||||
|
|
@ -1008,8 +1020,12 @@ action."
|
|||
(abbreviate-file-name (projectile-project-root)))
|
||||
:action counsel-projectile-switch-project-action
|
||||
:require-match t
|
||||
:sort t
|
||||
:caller 'counsel-projectile-switch-project))
|
||||
|
||||
(unless (assq #'counsel-projectile-switch-project ivy-sort-functions-alist)
|
||||
(push (list #'counsel-projectile-switch-project) ivy-sort-functions-alist))
|
||||
|
||||
;;;; counsel-projectile
|
||||
|
||||
(counsel-projectile--defcustom-action
|
||||
|
|
@ -1109,9 +1125,13 @@ If not inside a project, call `counsel-projectile-switch-project'."
|
|||
(counsel-projectile--project-buffers-and-files)
|
||||
:matcher #'counsel-projectile--matcher
|
||||
:require-match t
|
||||
:sort t
|
||||
:action counsel-projectile-action
|
||||
:caller 'counsel-projectile)))
|
||||
|
||||
(unless (assq #'counsel-projectile ivy-sort-functions-alist)
|
||||
(push (list #'counsel-projectile) ivy-sort-functions-alist))
|
||||
|
||||
(ivy-set-display-transformer
|
||||
'counsel-projectile
|
||||
'counsel-projectile-transformer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue