summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-dired.el13
-rw-r--r--lisp/init-python.el6
2 files changed, 11 insertions, 8 deletions
diff --git a/lisp/init-dired.el b/lisp/init-dired.el
index 93a9105..ca5bb5c 100644
--- a/lisp/init-dired.el
+++ b/lisp/init-dired.el
@@ -70,10 +70,6 @@
(define-key km/dired-narrow-prefix-map "f" 'dired-narrow-fuzzy)
(define-key km/dired-narrow-prefix-map "r" 'dired-narrow-regexp)
-(defun km/dired-narrow-bindings ()
- (local-set-key (kbd "C-c m n") 'km/dired-narrow-prefix-map))
-(add-hook 'dired-mode-hook 'km/dired-narrow-bindings)
-
(define-key dired-mode-map "/" 'dired-narrow-fuzzy)
(require-package 'dired-subtree)
@@ -92,8 +88,11 @@
(define-key km/dired-subtree-prefix-map "@" 'dired-subtree-mark-subtree)
(define-key km/dired-subtree-prefix-map "." 'dired-subtree-unmark-subtree)
-(defun km/dired-subtree-bindings ()
- (local-set-key (kbd "C-c m s") 'km/dired-subtree-prefix-map))
-(add-hook 'dired-mode-hook 'km/dired-subtree-bindings)
+(define-prefix-command 'km/dired-prefix-map)
+
+(define-key km/dired-prefix-map "n" 'km/dired-narrow-prefix-map)
+(define-key km/dired-prefix-map "s" 'km/dired-subtree-prefix-map)
+
+(define-key dired-mode-map (kbd "C-c m") 'km/dired-prefix-map)
(provide 'init-dired)
diff --git a/lisp/init-python.el b/lisp/init-python.el
index decc081..c020b08 100644
--- a/lisp/init-python.el
+++ b/lisp/init-python.el
@@ -80,7 +80,12 @@ This is inspired by `ess-eval-function-or-paragraph-and-step'."
(goto-char pos)
n))
+(define-prefix-command 'km/python-prefix-map)
+(define-key km/python-prefix-map "t" 'km/find-python-test-file-other-window)
+
(after 'python
+ (define-key python-mode-map (kbd "C-c m") 'km/python-prefix-map)
+
;; Rebind `python-shell-send-buffer'.
(define-key python-mode-map (kbd "C-c C-c")
'km/python-shell-send-function-or-paragraph-and-step)
@@ -91,7 +96,6 @@ This is inspired by `ess-eval-function-or-paragraph-and-step'."
(define-key python-mode-map (kbd "C-M-x") 'python-eldoc-at-point))
(defun km/python-hook ()
- (local-set-key (kbd "C-c m t") 'km/find-python-test-file-other-window)
(set (make-local-variable 'compile-command) "py.test"))
(add-hook 'python-mode-hook 'km/python-hook)