mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-19 13:43:36 -05:00
Refactor initfiles
This commit is contained in:
@@ -48,6 +48,35 @@
|
||||
ido-enable-tramp-completion t
|
||||
ido-enable-last-directory-history t)
|
||||
|
||||
;;; Filters ido-matches setting acronynm matches in front of the results
|
||||
(defadvice ido-set-matches-1 (after ido-smex-acronym-matches activate)
|
||||
(if (and (fboundp 'smex-already-running) (smex-already-running)
|
||||
(> (length ido-text) 1))
|
||||
(let ((regex (concat "^" (mapconcat 'char-to-string ido-text "[^-]*-")))
|
||||
(acronym-matches (list))
|
||||
(remove-regexes '("-menu-")))
|
||||
;; Creating the list of the results to be set as first
|
||||
(dolist (item items)
|
||||
(if (string-match (concat regex "[^-]*$") item) ;; strict match
|
||||
(add-to-list 'acronym-matches item)
|
||||
(if (string-match regex item) ;; appending relaxed match
|
||||
(add-to-list 'acronym-matches item t))))
|
||||
|
||||
;; Filtering ad-return-value
|
||||
(dolist (to_remove remove-regexes)
|
||||
(setq ad-return-value
|
||||
(delete-if (lambda (item)
|
||||
(string-match to_remove item))
|
||||
ad-return-value)))
|
||||
|
||||
;; Creating resulting list
|
||||
(setq ad-return-value
|
||||
(append acronym-matches
|
||||
ad-return-value))
|
||||
|
||||
(delete-dups ad-return-value)
|
||||
(reverse ad-return-value))))
|
||||
|
||||
;;#projectile
|
||||
(projectile-global-mode)
|
||||
(setq projectile-completion-system 'grizzl
|
||||
|
Reference in New Issue
Block a user