summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-08-30 01:32:01 -0400
committerKyle Meyer <kyle@kyleam.com>2014-08-30 01:32:01 -0400
commit75fdb84ed814d85e43fa2339380edefd7b982d3c (patch)
treec50773d9d4085e1d7befc20a550f141e9ecdb0db /lisp
parenta81a5b01a23728806655c9802d0e07c342f40abb (diff)
downloademacs.d-75fdb84ed814d85e43fa2339380edefd7b982d3c.tar.gz
Make prefix map for dired-copy-filename functions
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-dired.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/init-dired.el b/lisp/init-dired.el
index b92af65..ba91452 100644
--- a/lisp/init-dired.el
+++ b/lisp/init-dired.el
@@ -36,9 +36,6 @@ path is always relative to `projectile-project-root'."
(let ((project-dir (projectile-project-root)))
(km/dired-copy-filename-relative-to-directory project-dir)))
-(after 'projectile
- (define-key dired-mode-map "W" 'km/dired-copy-project-filename-as-kill))
-
(defun km/dired-copy-filename-relative-to-directory (directory)
"Like `dired-copy-filename-as-kill', but the filename is always
relative to DIRECTORY."
@@ -67,6 +64,17 @@ window."
(other-window 1)
default-directory))
+(define-prefix-command 'km/dired-copy-filename-map)
+(after 'projectile
+ (define-key km/dired-copy-filename-map "o"
+ 'km/dired-copy-relative-filename-as-kill))
+(define-key km/dired-copy-filename-map "w" 'dired-copy-filename-as-kill)
+(define-key km/dired-copy-filename-map "p"
+ 'km/dired-copy-project-filename-as-kill)
+
+;; This overrides the default binding for `dired-copy-filename-as-kill'.
+(define-key dired-mode-map "w" 'km/dired-copy-filename-map)
+
(defun km/dired-switch-to-buffer ()
(interactive)
(let ((buffer-name (km/dired-completing-buffer)))