From d9e52eb75846f61694de8a32ecd179c1fbe23606 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 3 Feb 2015 14:33:23 +0000 Subject: Emacs: Reinstall ido and related packages --- tag-emacs/emacs.d/Cask | 4 +++ tag-emacs/emacs.d/init.el | 82 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 79 insertions(+), 7 deletions(-) (limited to 'tag-emacs') diff --git a/tag-emacs/emacs.d/Cask b/tag-emacs/emacs.d/Cask index 40ed34a..49cc011 100644 --- a/tag-emacs/emacs.d/Cask +++ b/tag-emacs/emacs.d/Cask @@ -28,6 +28,8 @@ (depends-on "fancy-narrow") (depends-on "fasd") (depends-on "feature-mode") +(depends-on "flx") +(depends-on "flx-ido") (depends-on "flycheck") (depends-on "framemove") (depends-on "geiser") @@ -46,6 +48,7 @@ (depends-on "help-fns+") (depends-on "hemisu-theme") (depends-on "highlight-stages") +(depends-on "ido-vertical-mode") (depends-on "jinja2-mode") (depends-on "jquery-doc") (depends-on "js2-mode") @@ -82,6 +85,7 @@ (depends-on "smart-tab") (depends-on "smart-tabs-mode") (depends-on "smartparens") +(depends-on "smex") (depends-on "toml-mode") (depends-on "tup-mode") (depends-on "typo") diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el index eadd68b..39f7b53 100644 --- a/tag-emacs/emacs.d/init.el +++ b/tag-emacs/emacs.d/init.el @@ -578,9 +578,7 @@ :demand t :diminish helm-mode :ensure helm - :bind (("C-x i". helm-semantic-or-imenu) - ("M-x" . helm-M-x) - ("C-x C-b" . helm-mini)) + :bind (("C-x i" . helm-semantic-or-imenu)) :config (progn (setq helm-idle-delay .1 helm-input-idle-delay 0 @@ -596,6 +594,77 @@ (define-key helm-read-file-map (kbd "C-i") #'helm-execute-persistent-action) (define-key helm-read-file-map (kbd "C-z") #'helm-select-action))) +(req-package ido + :bind (("C-x b" . ido-switch-buffer)) + :init (progn + (setq ido-save-directory-list-file (expand-file-name "ido-state" user-emacs-directory)) + (bind-key* "C-x C-f" #'ido-find-file) + (ido-mode 1) + (ido-everywhere 1)) + :config (progn + (setq ido-auto-merge-delay-time 99999 + ido-enable-flex-matching t) + + (ido-init-completion-maps) + (defun ido-manual-merge () + (interactive) + (ido-initiate-auto-merge (current-buffer))) + (bind-key "C-c C-s" #'ido-manual-merge ido-file-dir-completion-map))) + +(defun ap/ido-projectile-switch-buffer-dwim (force-ido) + (interactive "p") + (if (and (projectile-project-p) (eq force-ido 1)) + (call-interactively #'projectile-switch-to-buffer) + (call-interactively #'ido-switch-buffer))) + +(bind-key "s-x b" #'ap/ido-projectile-switch-buffer-dwim) +(bind-key "s-x s-b" #'ap/ido-projectile-switch-buffer-dwim) + +(req-package ido-vertical-mode + :require ido + :init (progn + (setq ido-vertical-decorations '("\n❯ " + "" + "\n " + "\n …" + "[" + "]" + " [No match]" + " [Matched]" + " [Not readable]" + " [Too big]" + " [Confirm]" + "\n❯ " + "" + ))) + :config (ido-vertical-mode 1)) + +(req-package flx-ido + :require ido + :init (progn + (flx-ido-mode 1) + (setq flx-ido-threshhold 1000))) + +(req-package smex + :require ido + :bind (("M-x" . smex) + ("" . smex) + ("" . smex) + ("M-X" . smex-major-mode-commands) + ("C-c M-x" . execute-extended-command)) + :config (progn + (setq smex-key-advice-ignore-menu-bar t + smex-auto-update nil) + (defun smex-update-after-load (_unused) + (if (boundp 'smex-cache) + (smex-update))) + (add-hook 'after-load-functions 'smex-update-after-load)) + :init (progn + (setq smex-history-length 100 + smex-save-file (concat user-emacs-directory + "smex-items")) + (smex-initialize))) + ;;;; Modeline (column-number-mode t) @@ -891,9 +960,8 @@ mouse-1: Display Line and Column Mode Menu")))))) (ap/-add-known-subfolder-projects (ido-read-directory-name "Add projects under: "))) (defun ap/open-subfolder-project (from-dir &optional arg) - (let ((project-dir (helm-comp-read "Open project: " - (ap/subfolder-projects from-dir) - :must-match t))) + (let ((project-dir (projectile-completing-read "Open project: " + (ap/subfolder-projects from-dir)))) (projectile-switch-project-by-name (expand-file-name project-dir from-dir) arg))) (defun ap/open-work-project (&optional arg) @@ -907,7 +975,7 @@ mouse-1: Display Line and Column Mode Menu")))))) (setq projectile-switch-project-action #'projectile-dired projectile-remember-window-configs t - projectile-completion-system 'helm))) + projectile-completion-system 'ido))) (req-package helm-projectile :ensure projectile -- cgit 1.4.1