summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-08-06 01:40:23 -0400
committerKyle Meyer <kyle@kyleam.com>2015-08-06 01:40:23 -0400
commit20863271fd69f2e06628d16ceba8d13a5c01cb06 (patch)
tree579f642336120fa43f25e9489cae6505b7e7e669 /lisp
parent064e722903834c872bd129945392601ab3c48138 (diff)
downloademacs.d-20863271fd69f2e06628d16ceba8d13a5c01cb06.tar.gz
Add helm binding to display file
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-helm.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/init-helm.el b/lisp/init-helm.el
index e49ae9c..ff5c8d9 100644
--- a/lisp/init-helm.el
+++ b/lisp/init-helm.el
@@ -14,6 +14,13 @@
(with-helm-alive-p
(helm-quit-and-execute-action #'display-buffer)))
+(defun km/helm-display-file ()
+ (interactive)
+ (with-helm-alive-p
+ (helm-quit-and-execute-action
+ (lambda (f)
+ (display-buffer (find-file-noselect f))))))
+
(defun km/helm-ff-org-open-file ()
"Run `org-open-file' from `helm-source-find-files'."
(interactive)
@@ -26,6 +33,9 @@
(after 'helm-files
(define-key helm-find-files-map (kbd "C-c x") 'km/helm-ff-org-open-file)
(define-key helm-generic-files-map (kbd "C-c x") 'km/helm-ff-org-open-file)
+ ;; Overrides `helm-ff-run-switch-other-frame'.
+ (define-key helm-find-files-map (kbd "C-c C-o") 'km/helm-display-file)
+ (define-key helm-generic-files-map (kbd "C-c C-o") 'km/helm-display-file)
;; Overrides `helm-buffer-switch-other-frame'.
(define-key helm-buffer-map (kbd "C-c C-o") 'km/helm-display-buffer))