2014-07-15 02:21:56 -04:00
|
|
|
(require-packages
|
2014-07-16 03:28:06 -04:00
|
|
|
'(ido-ubiquitous ; enhances ido-everywhere
|
|
|
|
projectile ; project search (like ctrlp)
|
|
|
|
helm ; augments search of, well, anything
|
|
|
|
grizzl ; better searching engine for projectile
|
|
|
|
ag ; the_silver_searcher support
|
|
|
|
flx-ido ; enhances ido's flex matching
|
|
|
|
ido-vertical-mode ; vertical listing for ido completion
|
2014-07-17 05:26:23 -04:00
|
|
|
project-explorer ; sidebar for navigation project files
|
2014-07-20 09:01:56 -04:00
|
|
|
dired+
|
2014-07-15 02:21:56 -04:00
|
|
|
))
|
|
|
|
|
2014-07-20 09:01:56 -04:00
|
|
|
(diminish 'projectile-mode)
|
|
|
|
|
2014-07-15 02:21:56 -04:00
|
|
|
;;#dired
|
|
|
|
(setq dired-recursive-deletes 'always
|
|
|
|
dired-recursive-copies 'always
|
|
|
|
|
|
|
|
;; if there is a dired buffer displayed in the next window, use its
|
|
|
|
;; current subdir, instead of the current subdir of this dired buffer
|
|
|
|
dired-dwim-target t)
|
|
|
|
|
|
|
|
;; ido remaps its keys every time it's invoked, this screws with
|
|
|
|
;; custom mappings. So we've gotta neuter ido.
|
|
|
|
(defun ido-init-completion-maps ())
|
|
|
|
|
|
|
|
(setq ido-common-completion-map (make-sparse-keymap))
|
|
|
|
(setq ido-file-dir-completion-map (make-sparse-keymap))
|
|
|
|
(setq ido-file-completion-map (make-sparse-keymap))
|
|
|
|
(setq ido-buffer-completion-map (make-sparse-keymap))
|
|
|
|
|
|
|
|
(set-keymap-parent ido-common-completion-map minibuffer-local-map)
|
|
|
|
(set-keymap-parent ido-file-dir-completion-map ido-common-completion-map)
|
|
|
|
(set-keymap-parent ido-file-completion-map ido-file-dir-completion-map)
|
|
|
|
(set-keymap-parent ido-buffer-completion-map ido-common-completion-map)
|
|
|
|
|
|
|
|
(ido-mode 1)
|
2014-07-16 03:28:06 -04:00
|
|
|
(ido-vertical-mode 1)
|
2014-07-15 02:21:56 -04:00
|
|
|
(ido-everywhere 1)
|
|
|
|
(flx-ido-mode 1)
|
2014-07-20 09:01:56 -04:00
|
|
|
(add-to-list 'ido-ignore-files "\\`.DS_Store\\'")
|
2014-07-15 02:21:56 -04:00
|
|
|
(setq ido-use-faces nil
|
|
|
|
ido-confirm-unique-completion t
|
|
|
|
ido-case-fold t
|
|
|
|
ido-enable-tramp-completion nil
|
|
|
|
ido-enable-flex-matching t
|
|
|
|
ido-create-new-buffer 'always
|
|
|
|
ido-enable-tramp-completion t
|
|
|
|
ido-enable-last-directory-history t)
|
|
|
|
|
2014-07-22 23:24:02 -04:00
|
|
|
;; (add-to-list 'ido-ubiquitous-default-function-overrides '(disable exact "evil-ex"))
|
|
|
|
|
2014-07-21 03:52:01 -04:00
|
|
|
;;; 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))))
|
|
|
|
|
2014-07-15 02:21:56 -04:00
|
|
|
;;#projectile
|
2014-07-17 04:12:16 -04:00
|
|
|
(projectile-global-mode)
|
2014-07-15 02:21:56 -04:00
|
|
|
(setq projectile-completion-system 'grizzl
|
|
|
|
projectile-enable-caching t)
|
|
|
|
|
2014-07-17 05:26:23 -04:00
|
|
|
;;#project-explorer
|
|
|
|
(setq pe/width 24)
|
|
|
|
(evil-set-initial-state 'project-explorer-mode 'emacs)
|
|
|
|
(add-hook 'project-explorer-mode-hook
|
|
|
|
(lambda() (no-linum)))
|
|
|
|
|
2014-07-15 02:21:56 -04:00
|
|
|
;;
|
|
|
|
(provide 'core-project)
|