diff options
| -rw-r--r-- | init.el | 13 | ||||
| -rw-r--r-- | ravi-ergodox-mode.el | 9 | ||||
| -rw-r--r-- | ravi-init-appearance.el | 3 | ||||
| -rw-r--r-- | ravi-init-files.el | 13 | ||||
| -rw-r--r-- | ravi-init-helm.el | 86 | ||||
| -rw-r--r-- | ravi-init-ido.el | 2 | ||||
| -rw-r--r-- | ravi-init-marks.el | 1 |
7 files changed, 122 insertions, 5 deletions
@@ -82,6 +82,9 @@ result)) ;; --------------------------------------------------------------------- +(defvar ravi/use-helm-instead-of-ido t + "Prefer helm to ido") + (when (file-exists-p (ravi/emacs-file "local.el")) (load-file (ravi/emacs-file "local.el")) ) @@ -103,8 +106,13 @@ (diminish 'ravi-ergodox-mode)) (progn ;; Temporary key-bindings - (bind-key "<f9>" 'ido-find-file) - (bind-key "<f8>" 'ido-switch-buffer) + (if (and (boundp 'ravi/use-helm-instead-of-ido) ravi/use-helm-instead-of-ido) + (progn + (bind-key "<f9>" 'helm-find-files) + (bind-key "<f8>" 'helm-mini)) + (progn + (bind-key "<f9>" 'ido-find-file) + (bind-key "<f8>" 'ido-switch-buffer))) (bind-key "<f12>" 'undo-tree-undo))) (use-package keyadvice @@ -125,6 +133,7 @@ (set varname (append basic-var (symbol-value hack-varname)))))) (require 'ravi-init-ido) +(require 'ravi-init-helm) (require 'ravi-init-marks) (require 'ravi-init-appearance) (require 'ravi-init-files) diff --git a/ravi-ergodox-mode.el b/ravi-ergodox-mode.el index 78221ab..8e1c2e8 100644 --- a/ravi-ergodox-mode.el +++ b/ravi-ergodox-mode.el @@ -58,8 +58,13 @@ Each function in the list receive no argument." (define-key ravi-ergodox-mode-map (kbd "H-m") 'magit-status) (define-key ravi-ergodox-mode-map (kbd "<f6>") 'ff-find-other-file) -(define-key ravi-ergodox-mode-map (kbd "<f1>") 'ido-switch-buffer) -(define-key ravi-ergodox-mode-map (kbd "<f2>") 'ido-find-file) +(if (and (boundp 'ravi/use-helm-instead-of-ido) ravi/use-helm-instead-of-ido) + (progn + (define-key ravi-ergodox-mode-map (kbd "<f1>") 'helm-mini) + (define-key ravi-ergodox-mode-map (kbd "<f2>") 'helm-find-files)) + (progn + (define-key ravi-ergodox-mode-map (kbd "<f1>") 'ido-switch-buffer) + (define-key ravi-ergodox-mode-map (kbd "<f2>") 'ido-find-file))) (defun ravi-ergodox-mode-enable () "Turn on ergodox bindings mode." diff --git a/ravi-init-appearance.el b/ravi-init-appearance.el index 23b50c0..16730a8 100644 --- a/ravi-init-appearance.el +++ b/ravi-init-appearance.el @@ -196,6 +196,9 @@ Delete all whitespace on a successive key press." "C-x 5" ;; frames "C-x n" ;; narrowing )) + (when (and (boundp ravi/use-helm-instead-of-ido) ravi/use-helm-instead-of-ido) + (add-to-list 'guide-key/guide-key-sequence "<escape>")) + (guide-key-mode 1) (use-package guide-key-tip diff --git a/ravi-init-files.el b/ravi-init-files.el index 9c1c8cb..44d1683 100644 --- a/ravi-init-files.el +++ b/ravi-init-files.el @@ -130,7 +130,18 @@ not exist, it is not added to the filecache." (ravi/emacs-file "past/projectile-bookmarks.eld")) ) :config - (projectile-global-mode) + (progn + (projectile-global-mode) + + (when (and (boundp 'ravi/use-helm-instead-of-ido) ravi/use-helm-instead-of-ido) + + (setq projectile-completion-system 'helm) + + (use-package helm-projectile + :config + (helm-projectile-on) + :ensure t) + )) :diminish projectile-mode :ensure t ) diff --git a/ravi-init-helm.el b/ravi-init-helm.el new file mode 100644 index 0000000..c09595d --- /dev/null +++ b/ravi-init-helm.el @@ -0,0 +1,86 @@ +;;; ravi-init-helm.el --- helm initialization -*- lexical-binding: t; -*- + +;; Copyright (C) 2015 + +;; Author: <ravi@nero.lan> +;; Keywords: abbrev + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Initialize helm instead of ido. The code in this file may steal +;; global keybindings that are currently used for ido-mode/smex. + +;;; Code: + +(use-package helm + :bind (("<escape>" . helm-command-prefix) + ("M-x" . helm-M-x) + ("<f1>" . helm-mini) + ("<f2>" . helm-find-files) + ("M-y" . helm-show-kill-ring) + ("H-`" . helm-all-mark-rings)) + :init + (progn + (require 'helm-config) + (setq helm-candidate-number-limit 100) + + ;; From https://gist.github.com/antifuchs/9238468 + (setq helm-idle-delay 0.0 ; update fast sources immediately (doesn't). + helm-input-idle-delay 0.01 ; this actually updates things + helm-quick-update t + helm-M-x-requires-pattern nil + helm-ff-skip-boring-files t) + + (setq helm-ff-file-name-history-use-recentf t) + + (helm-mode)) + :config + (progn + (unbind-key "C-x c") ; default helm prefix key + (bind-key "<tab>" 'helm-execute-persistent-action helm-map) + (bind-key "H-<tab>" 'helm-select-action helm-map) + + (use-package helm-swoop + :bind (("M-I" . helm-swoop)) + :commands helm-swoop-from-isearch + :init + (progn + (bind-key "M-i" 'helm-swoop-from-isearch isearch-mode-map) + ) + :config + (progn + (bind-key "M-i" 'helm-multi-swoop-from-all-helm-swoop helm-swoop-map) + + ;; Save buffer when helm-multi-swoop-edit complete + (setq helm-multi-swoop-edit-save t) + + ;; If this value is t, split window inside the current window + ;; (setq helm-swoop-split-with-multiple-windows nil) + + ;; Split direcion. 'split-window-vertically or 'split-window-horizontally + ;; (setq helm-swoop-split-direction 'split-window-vertically) + ) + :ensure t) + + (use-package helm-descbinds + :bind (("C-h b" . helm-descbinds)) + :ensure t)) + :if ravi/use-helm-instead-of-ido + :diminish helm-mode + :ensure t) + +(provide 'ravi-init-helm) +;;; ravi-init-helm.el ends here diff --git a/ravi-init-ido.el b/ravi-init-ido.el index e99a5d8..7aec0ce 100644 --- a/ravi-init-ido.el +++ b/ravi-init-ido.el @@ -68,6 +68,7 @@ ido-selected ido-final-text ido-show-confirm-message) + :if (not ravi/use-helm-instead-of-ido) :init (ido-mode 1) @@ -155,6 +156,7 @@ (use-package smex :init (global-set-key [remap execute-extended-command] 'smex) + :if (not ravi/use-helm-instead-of-ido) :ensure t ) diff --git a/ravi-init-marks.el b/ravi-init-marks.el index 345cead..4288b6b 100644 --- a/ravi-init-marks.el +++ b/ravi-init-marks.el @@ -71,6 +71,7 @@ This is the same as using \\[set-mark-command] with the prefix argument." (use-package browse-kill-ring :init (browse-kill-ring-default-keybindings) :ensure t + :if (not ravi/use-helm-instead-of-ido) ) (provide 'ravi-init-marks) |
