about summary refs log tree commit diff
path: root/users/sterni/emacs
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-05-10T14·16+0200
committerclbot <clbot@tvl.fyi>2022-05-10T18·18+0000
commit5cccb0c573b30899020dc59e636adb213f407c6b (patch)
treeabd5b6aa781d722568de08939fa0a226844b1c95 /users/sterni/emacs
parent1e3306ab574ab1faf13e7735b0d56bf5dd9c7f21 (diff)
feat(sterni/emacs): add key bindings for project-* commands r/4054
Change-Id: I482b629747adebe049e1e145c13efec17a0d2b7d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5571
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'users/sterni/emacs')
-rw-r--r--users/sterni/emacs/init.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/users/sterni/emacs/init.el b/users/sterni/emacs/init.el
index 4e2baef921f3..b0ce4c695449 100644
--- a/users/sterni/emacs/init.el
+++ b/users/sterni/emacs/init.el
@@ -119,6 +119,14 @@
 ; default, but allows ';' as prompt
 (setq shell-prompt-pattern "^[^#$%>;\n]*[#$%>;] *")
 
+;; projects (see also evil config)
+
+(setq project-switch-commands
+      '((project-find-file "Find file")
+        (project-find-regexp "Find regexp")
+        (project-dired "Dired")
+        (project-shell "Shell")))
+
 ;;; Configure packages
 (require 'use-package)
 
@@ -164,6 +172,14 @@
   (define-key evil-window-map (kbd "<right>") 'evil-window-right)
   (define-key evil-window-map (kbd "<up>") 'evil-window-up)
   (define-key evil-window-map (kbd "<down>") 'evil-window-down)
+  ;; projects
+  (evil-define-key 'normal 'global (kbd "<leader>pf") 'project-find-file)
+  (evil-define-key 'normal 'global (kbd "<leader>pg") 'project-find-regexp)
+  (evil-define-key 'normal 'global (kbd "<leader>pd") 'project-dired)
+  (evil-define-key 'normal 'global (kbd "<leader>ps") 'project-shell)
+  (evil-define-key 'normal 'global (kbd "<leader>pR") 'project-query-replace-regexp)
+  (evil-define-key 'normal 'global (kbd "<leader>pK") 'project-kill-buffers)
+  (evil-define-key 'normal 'global (kbd "<leader>pp") 'project-switch-project)
   ;; emacs
   (evil-define-key 'visual 'global (kbd "<leader>ee") 'eval-region)
   (evil-define-key 'normal 'global (kbd "<leader>ee") 'eval-last-sexp)