summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/init-ido.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/init-ido.el b/lisp/init-ido.el
index be8f5f3..64417fc 100644
--- a/lisp/init-ido.el
+++ b/lisp/init-ido.el
@@ -40,11 +40,22 @@
(defun km/recentf-ido-find-file ()
"Find a recent file using ido."
(interactive)
- (-when-let (file (ido-completing-read "Choose recent file: "
- recentf-list nil t))
+ (-when-let (file (km/read-recent-file))
(find-file file)))
+(defun km/recentf-ido-find-file-other-window ()
+ "Find a recent file in other window using ido."
+ (interactive)
+ (-when-let (file (km/read-recent-file))
+ (find-file-other-window file)))
+
+(defun km/read-recent-file ()
+ (ido-completing-read "Choose recent file: " recentf-list nil t))
+
(key-chord-define-global ",r" 'km/recentf-ido-find-file)
+;; Remap find-file-read-only-other-window to free up "r".
+(define-key ctl-x-4-map "R" 'find-file-read-only-other-window)
+(define-key ctl-x-4-map "r" 'km/recentf-ido-find-file-other-window)
(key-chord-define-global ",b" 'ido-switch-buffer)
(provide 'init-ido)