Advertisement
Guest User

Short init.el

a guest
Apr 20th, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.05 KB | None | 0 0
  1.  
  2. ;; Melpa
  3. (require 'package)
  4. (add-to-list 'package-archives
  5.              '("melpa" . "http://melpa.org/packages/") t)
  6. (when (< emacs-major-version 24)
  7.   ;; For important compatibility libraries like cl-lib
  8.   (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
  9. (package-initialize)
  10.  
  11. (require 'helm)
  12. (helm-mode 1)
  13. (defun fu/helm-find-files-navigate-forward (orig-fun &rest args)
  14.   (if (file-directory-p (helm-get-selection))
  15.       (apply orig-fun args)
  16.     (helm-maybe-exit-minibuffer)))
  17. (advice-add 'helm-execute-persistent-action :around #'fu/helm-find-files-navigate-forward)
  18. (define-key helm-find-files-map (kbd "<return>") 'helm-execute-persistent-action)
  19. (define-key helm-find-files-map (kbd "RET") 'helm-execute-persistent-action)
  20.  
  21. (defun fu/helm-find-files-navigate-back (orig-fun &rest args)
  22.   (if (= (length helm-pattern) (length (helm-find-files-initial-input)))
  23.       (helm-find-files-up-one-level 1)
  24.     (apply orig-fun args)))
  25. (advice-add 'helm-ff-delete-char-backward :around #'fu/helm-find-files-navigate-back)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement