]> git.eshelyaron.com Git - emacs.git/commitdiff
Add global bindings for project commands
authorTheodor Thornhill <theo@thornhill.no>
Wed, 17 Jun 2020 23:05:31 +0000 (02:05 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 17 Jun 2020 23:05:31 +0000 (02:05 +0300)
* lisp/progmodes/project.el
(project-prefix-map): New variable.
Add the new keymap to ctl-x-map.

lisp/progmodes/project.el

index 1c1891fcf55bf25fb4f6b7c3c8e8aac6f0db0f8e..14aafdf28996a8d0360e8bf03d4f4b0c1f6df17f 100644 (file)
@@ -490,6 +490,23 @@ DIRS must contain directory names."
   ;; Sidestep the issue of expanded/abbreviated file names here.
   (cl-set-difference files dirs :test #'file-in-directory-p))
 
+;;;###autoload
+(defvar project-prefix-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "f" 'project-find-file)
+    (define-key map "s" 'project-shell)
+    (define-key map "d" 'project-dired)
+    (define-key map "v" 'project-vc-dir)
+    (define-key map "c" 'project-compile)
+    (define-key map "e" 'project-eshell)
+    (define-key map "p" 'project-switch-project)
+    (define-key map "g" 'project-find-regexp)
+    (define-key map "r" 'project-query-replace-regexp)
+    map)
+  "Keymap for project commands.")
+
+;;;###autoload (define-key ctl-x-map "p" project-prefix-map)
+
 (defun project--value-in-dir (var dir)
   (with-temp-buffer
     (setq default-directory dir)