Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; Melpa
- (require 'package)
- (add-to-list 'package-archives
- '("melpa" . "http://melpa.org/packages/") t)
- (when (< emacs-major-version 24)
- ;; For important compatibility libraries like cl-lib
- (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
- (package-initialize)
- (require 'helm)
- (helm-mode 1)
- (defun fu/helm-find-files-navigate-forward (orig-fun &rest args)
- (if (file-directory-p (helm-get-selection))
- (apply orig-fun args)
- (helm-maybe-exit-minibuffer)))
- (advice-add 'helm-execute-persistent-action :around #'fu/helm-find-files-navigate-forward)
- (define-key helm-find-files-map (kbd "<return>") 'helm-execute-persistent-action)
- (define-key helm-find-files-map (kbd "RET") 'helm-execute-persistent-action)
- (defun fu/helm-find-files-navigate-back (orig-fun &rest args)
- (if (= (length helm-pattern) (length (helm-find-files-initial-input)))
- (helm-find-files-up-one-level 1)
- (apply orig-fun args)))
- (advice-add 'helm-ff-delete-char-backward :around #'fu/helm-find-files-navigate-back)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement