From 5cccb0c573b30899020dc59e636adb213f407c6b Mon Sep 17 00:00:00 2001 From: sterni Date: Tue, 10 May 2022 16:16:28 +0200 Subject: feat(sterni/emacs): add key bindings for project-* commands Change-Id: I482b629747adebe049e1e145c13efec17a0d2b7d Reviewed-on: https://cl.tvl.fyi/c/depot/+/5571 Tested-by: BuildkiteCI Reviewed-by: sterni Autosubmit: sterni --- users/sterni/emacs/init.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'users/sterni') 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 "") 'evil-window-right) (define-key evil-window-map (kbd "") 'evil-window-up) (define-key evil-window-map (kbd "") 'evil-window-down) + ;; projects + (evil-define-key 'normal 'global (kbd "pf") 'project-find-file) + (evil-define-key 'normal 'global (kbd "pg") 'project-find-regexp) + (evil-define-key 'normal 'global (kbd "pd") 'project-dired) + (evil-define-key 'normal 'global (kbd "ps") 'project-shell) + (evil-define-key 'normal 'global (kbd "pR") 'project-query-replace-regexp) + (evil-define-key 'normal 'global (kbd "pK") 'project-kill-buffers) + (evil-define-key 'normal 'global (kbd "pp") 'project-switch-project) ;; emacs (evil-define-key 'visual 'global (kbd "ee") 'eval-region) (evil-define-key 'normal 'global (kbd "ee") 'eval-last-sexp) -- cgit 1.4.1