added global prefix for projectile, added job projects

This commit is contained in:
2023-06-16 19:32:09 +02:00
parent 0f09f650b8
commit 4b6b9df47a

View File

@@ -1,41 +1,55 @@
;; *** Projectile
(use-package projectile
:config
(projectile-mode +1)
:defer nil
(defun tvd-dir-to-projectile ()
"drop a .projectile wherever we are"
(interactive)
(with-temp-file ".projectile"
(insert "-.snapshot\n-.git\n-.RCS\n"))
(message (format "Turned %s into projectile project" default-directory)))
:init
(global-unset-key (kbd "C-p"))
;; FIXME: add custom docstring
(when (fboundp 'defhydra)
(defhydra hydra-projectile
( :color teal
:columns 4)
"Projectile (use C-p for this menu)"
("s" projectile-switch-project "Switch Project")
("f" projectile-find-file "Find File")
("r" projectile-recentf "Recent Files")
("b" projectile-ibuffer "Show Project Buffers")
:bind (:map projectile-mode-map
("C-p" . projectile-command-map))
("g" projectile-grep "Grep")
("o" projectile-multi-occur "Multi Occur")
("d" projectile-dired "Project Dired")
("R" projectile-replace "Replace in Project")
:config
(projectile-mode +1)
("C" projectile-invalidate-cache "Clear Cache")
("t" projectile-regenerate-tags "Regenerate Tags")
("X" projectile-cleanup-known-projects "Cleanup Known Projects")
("n" tvd-dir-to-projectile "Turn current directory into Projectile")
(defun tvd-dir-to-projectile ()
"drop a .projectile wherever we are"
(interactive)
(with-temp-file ".projectile"
(insert "-.snapshot\n-.git\n-.RCS\n"))
(message (format "Turned %s into projectile project" default-directory)))
("c" projectile-commander "Commander")
("k" projectile-kill-buffers "Kill Buffers")
("q" nil "Cancel" :color blue))
(setq projectile-project-search-path '("~/fits/jobs/" "~/.fits/")
projectile-auto-discover t)
(global-set-key (kbd "C-x p") 'hydra-projectile/body)))
(projectile-register-project-type 'fitsjob '("README")
:project-file '("README?*" "?*.org" "instances"))
;; FIXME: add custom docstring
(when (fboundp 'defhydra)
(defhydra hydra-projectile
( :color teal
:columns 4)
"Projectile (use C-x p for this menu)"
("s" projectile-switch-project "Switch Project")
("f" projectile-find-file "Find File")
("r" projectile-recentf "Recent Files")
("b" projectile-ibuffer "Show Project Buffers")
("g" projectile-grep "Grep")
("o" projectile-multi-occur "Multi Occur")
("d" projectile-dired "Project Dired")
("R" projectile-replace "Replace in Project")
("C" projectile-invalidate-cache "Clear Cache")
("t" projectile-regenerate-tags "Regenerate Tags")
("X" projectile-cleanup-known-projects "Cleanup Known Projects")
("n" tvd-dir-to-projectile "Turn current directory into Projectile")
("c" projectile-commander "Commander")
("k" projectile-kill-buffers "Kill Buffers")
("q" nil "Cancel" :color blue))
(global-set-key (kbd "C-x p") 'hydra-projectile/body)))
(provide 'init-projectile)