Advertisement
Guest User

Untitled

a guest
Oct 25th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.44 KB | None | 0 0
  1. ;; I've tried this
  2. (setq ivy-sort-matches-functions-alist
  3.     '((t)
  4.     (read-file-name-internal . ivy--sort-by-length)
  5.     ))
  6.  
  7. (defun ivy--sort-by-length (_name candidates)
  8. (cl-sort (copy-sequence candidates)
  9.     (lambda (f1 f2)
  10.         (< (length f1) (length f2)))))
  11.  
  12. ;; and I've tried this
  13. (defun ivy-sort-file-function-default (_name candidates)
  14. (cl-sort (copy-sequence candidates)
  15.     (lambda (f1 f2)
  16.         (< (length f1) (length f2)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement