system-manager-wakasu
 1;;; config-projects.el --- -*- lexical-binding: t; -*-
 2;;; Commentary:
 3;;; Project related configuration.
 4;;; Code:
 5
 6(require 'json)
 7
 8(use-package project
 9  :commands (project-find-file project-find-regexp vde/project-vterm vde/project-run-in-vterm)
10  :custom ((project-switch-commands '((?f "File" project-find-file)
11				      (?g "Grep" project-find-regexp)
12				      (?d "Dired" project-dired)
13				      (?b "Buffer" project-switch-to-buffer)
14				      (?q "Query replace" project-query-replace-regexp)
15				      (?m "Magit" vde-project-magit-status)
16				      (?e "Eshell" project-eshell)
17				      (?E "Eat" vde/project-eat)
18				      (?s "Vterm" vde/project-vterm)
19				      (?R "README" vde/open-readme)
20				      (?g "Checkout GitHub PR" checkout-github-pr)))
21	   (project-mode-line t))
22  :bind (("C-x p v" . vde-project-magit-status)
23         ("C-x p s" . vde/project-vterm)
24         ("C-x p X" . vde/project-run-in-vterm)
25	 ("C-x p E" . vde/project-eat)
26	 ("C-x p G" . checkout-github-pr))
27  :init
28  ;; (require project-rootfile)
29  ;; (add-to-list 'project-find-functions #'project-rootfile-try-detect t)
30  ;; (setq project-rootfile-list '(".project"
31  ;;   "default.nix" "flake.nix"                               ; nix
32  ;;   "Makefile" "GNUMakefile" "CMakeLists.txt"               ; Make & CMake
33  ;;   "Cask" "Eldev" "Keg" "Eask"                             ; Emacs
34  ;;   "stack.yaml"                                            ; Haskell
35  ;;   "Cargo.toml"                                            ; Rust
36  ;;   "go.mod"                                                ; Go
37  ;;   ))
38  :config
39  (setq vde/project-local-identifier '(".project")) ;; "go.mod"
40
41  ;; (add-hook 'project-find-functions #'vde/project-try-local)
42
43  (setq-default project-compilation-buffer-name-function 'project-prefixed-buffer-name)
44  (defun vde-project-magit-status ()
45    "Run `magit-status' on project."
46    (interactive)
47    (magit-status (vde-project--project-current)))
48
49  ;; (general-leader
50  ;;   "p"  '(:ignore :which-key "Project")
51  ;;   "pp"  #'(project-switch-project :which-key "Switch to Project")
52  ;;   "ps"  #'(project-search :which-key "Grep in Project")
53  ;;   "pf"  #'(project-find-file :which-key "Find in Project")
54  ;;   "pd"  #'(project-dired :which-key "Dired in Project")
55  ;;   "pc"  #'(project-compile :which-key "Compile in Project")
56  ;;   "pb"  #'(project-switch-to-buffer :which-key "Switch to Project Buffer")
57  ;;   "pk"  #'(project-kill-buffers :which-key "Kill Project Buffers")
58  ;;   "ps"  #'(vde/project-vterm :which-key "Start a vterm in Project")
59  ;;   "pe"  #'(project-eshell :which-key "Start a eshell in Project")
60  ;;   "pE"  #'(vde/project-eat :which-key "Start a eat term in Project")
61  ;;   "px"  #'(vde/project-run-in-vterm :which-key "Execute command in vterm in Project"))
62  )
63
64(use-package conner
65  :bind (("C-x p C" . conner-run-project-command))
66  :commands (conner-run-project-command)
67  :config
68  (require 'vterm))
69
70(use-package project-x
71  :after project
72  :config
73  (add-hook 'project-find-functions 'project-x-try-local 90)
74  (add-hook 'kill-emacs-hook 'project-x--window-state-write)
75  (add-to-list 'project-switch-commands
76               '(?j "Restore windows" project-x-windows) t)
77  :bind (("C-x p w" . project-x-window-state-save)
78         ("C-x p j" . project-x-window-state-load)))
79
80(use-package jira
81  :commands (jira-issues)
82  :config
83  (setq jira-base-url "https://issues.redhat.com"
84	jira-username "vdemeest@redhat.com"
85	jira-token (passage-get "redhat/issues/token/myji")
86	jira-token-is-personal-access-token t
87	jira-api-version 2
88	jira-issues-max-results 500))
89
90(provide 'config-projects)
91;;; config-projects.el ends here