summary refs log tree commit diff
path: root/config/init-project.el
blob: 62c246c8d43d089888bac6cacef950fa66d1b9a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
;;; init-project.el --- Configure project -*- lexical-binding: t -*-
;; Author: Franck Cuny <franck@fcuny.net>

;;; Commentary:

;; Configure project

;;; Code:

(use-package magit
  :ensure t
  :bind ("C-x g" . magit-status)
  :custom
  (magit-diff-refine-hunk t)
  (magit-repository-directories
   '(("~/workspace" . 1)))
  (magit-repolist-column-flag-alist
   '((magit-untracked-files . "N")
     (magit-unstaged-files . "U")
     (magit-staged-files . "S")))
  (magit-repolist-columns
   '(("Name" 25 magit-repolist-column-ident nil)
     ("" 3 magit-repolist-column-flag)
     ("Version" 25 magit-repolist-column-version
      ((:sort magit-repolist-version<)))
     ("B<U" 3 magit-repolist-column-unpulled-from-upstream
      ((:right-align t)
       (:sort <)))
     ("B>U" 3 magit-repolist-column-unpushed-to-upstream
      ((:right-align t)
       (:sort <)))
     ("Path" 99 magit-repolist-column-path nil)))
  (magit-clone-default-directory "~/workspace/")
  :config
  ;; show ANSI colors in the process buffer, so it's easier to read what's going on
  ;; for some reasons if it's in the `:custom' section it does not get set
  (setq magit-process-finish-apply-ansi-colors t))

(use-package vc
  :defer t
  :custom
  (vc-command-messages t)
  (vc-follow-symlinks t))

(use-package git-link
  :defines git-link-remote-alist
  :ensure t
  :bind ("C-c Y" . git-link)
  :commands (git-link git-link-commit git-link-homepage)
  :custom
  (git-link-open-in-browser t)
  :config
  ;; sets up roblox git enterprise as a git-link handler
  (add-to-list 'git-link-remote-alist '("github\\.rblx\\.com" git-link-github))
  (add-to-list 'git-link-commit-remote-alist '("github\\.rblx\\.com" git-link-commit-github)))

(use-package rg
  :ensure t
  :custom
  (rg-group-result t)
  (rg-show-columns t)
  (rg-align-line-number-field-length 3)
  (rg-align-column-number-field-length 3)
  (rg-align-line-column-separator "#")
  (rg-align-position-content-separator "|")
  (rg-hide-command nil)
  (rg-align-position-numbers t)
  (rg-command-line-flags '("--follow")))

(use-package project
  :config
  (setq project-switch-commands
        '((project-find-file "Find file" f)
          (project-dired "Dired" d)
          (project-eshell "Eshell" e)
          (magit-project-status "Magit" ?m))))

(provide 'init-project)

;;; init-project.el ends here