nicer predefined Helm

This commit is contained in:
Bozhidar Batsov 2012-04-10 16:16:52 +03:00
parent f8dfa4b099
commit 18b1fdfa64
3 changed files with 22 additions and 3 deletions

View file

@ -212,6 +212,25 @@
;; projectile is a project management mode ;; projectile is a project management mode
(require 'projectile) (require 'projectile)
(projectile-global-mode t) (projectile-global-mode t)
(require 'helm-projectile)
(defun helm-prelude ()
"Preconfigured `helm'."
(interactive)
(if (projectile-get-project-root)
;; add project files and buffers when in project
(helm-other-buffer '(helm-c-source-projectile-files-list
helm-c-source-projectile-buffers-list
helm-c-source-buffers-list
helm-c-source-recentf
helm-c-source-buffer-not-found)
"*helm prelude*")
;; otherwise fallback to helm-mini
(helm-other-buffer '(helm-c-source-buffers-list
helm-c-source-recentf
helm-c-source-buffer-not-found)
"*helm mini*")))
;; dired - reuse current buffer by pressing 'a' ;; dired - reuse current buffer by pressing 'a'
(put 'dired-find-alternate-file 'disabled nil) (put 'dired-find-alternate-file 'disabled nil)

View file

@ -100,8 +100,6 @@
(global-set-key (kbd "C-=") 'er/expand-region) (global-set-key (kbd "C-=") 'er/expand-region)
(global-set-key (kbd "C-c w") (make-repeatable-command 'er/expand-region)) (global-set-key (kbd "C-c w") (make-repeatable-command 'er/expand-region))
(global-set-key (kbd "C-c h") 'helm-mini)
(provide 'prelude-global-keybindings) (provide 'prelude-global-keybindings)
;;; prelude-global-keybindings.el ends here ;;; prelude-global-keybindings.el ends here

View file

@ -51,6 +51,7 @@
(define-key map (kbd "C-c r") 'prelude-rename-file-and-buffer) (define-key map (kbd "C-c r") 'prelude-rename-file-and-buffer)
(define-key map (kbd "C-c t") 'prelude-visit-term-buffer) (define-key map (kbd "C-c t") 'prelude-visit-term-buffer)
(define-key map (kbd "C-c k") 'prelude-kill-other-buffers) (define-key map (kbd "C-c k") 'prelude-kill-other-buffers)
(define-key map (kbd "C-c h") 'helm-prelude)
map) map)
"Keymap for Prelude mode.") "Keymap for Prelude mode.")
@ -81,7 +82,8 @@
("Navigation" ("Navigation"
["Enable arrow keys" prelude-restore-arrow-keys] ["Enable arrow keys" prelude-restore-arrow-keys]
["Go to symbol" prelude-ido-goto-symbol]) ["Go to symbol" prelude-ido-goto-symbol]
["Helm" helm-prelude])
("Windows" ("Windows"
["Swap windows" prelude-swap-windows]) ["Swap windows" prelude-swap-windows])