aboutsummaryrefslogtreecommitdiff
path: root/bard-emacs-modules/bard-emacs-prog.el
blob: 98b2c18dd4b0bdd169973acd603bbe81c8872fcf (plain)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
(use-package haskell-mode
  :ensure t
  :config
  (setq haskell-interactive-popup-errors nil))

;; CPP Mode
(use-package emacs
  :config
  (setq-default c-basic-offset 4)
  (setq c-default-style '((c-mode . "gnu")
                          (java-mode . "java")
                          (awk-mode . "awk"))))

;; Haskell

(use-package emacs
  :config
  (add-to-list 'exec-path "$HOME/.ghcup/bin")
  (add-to-list 'exec-path "/home/bard/.cabal/bin")
  (add-to-list 'exec-path "/home/bard/.local/bin")
  (add-to-list 'exec-path "/home/bard/opt/")
  (let ((bard/ghcup-path (expand-file-name "~/.ghcup/bin")))
    (setenv "PATH" (concat bard/ghcup-path ":" (getenv "PATH")))
    (add-to-list 'exec-path bard/ghcup-path)))

;; Lisp
(use-package clojure-mode
  :ensure t)

(use-package cider
  :ensure t)

(use-package sly
  :ensure t
  :config
  (setq inferior-lisp-program (executable-find "sbcl")))

(use-package geiser
  :ensure t)

(use-package geiser-gauche
  :ensure t)

;; parens packages

(use-package c++-mode
  :ensure nil
  :bind
  (:map c++-mode-map
        ("C-c C-c" . project-compile))
  :config
  (defun bard/c++-completion-or-indent ()
    "Complete if point is at a symbol; otherwise, indent."
    (interactive)
    (if (or (completion-at-point) (looking-at "\\_>"))
        (completion-at-point)
      (c-indent-line-or-region)))

  (defun bard/setup-c++-mode ()
    "Configure completion behavior for `c++-mode'."
    (local-set-key (kbd "<tab>") 'bard/c++-completion-or-indent))

  (add-hook 'c++-mode-hook #'bard/setup-c++-mode)
  (add-hook 'c-mode-hook #'bard/setup-c++-mode)
  )

(use-package flycheck
  :ensure t
  :config
  (global-flycheck-mode t))

(use-package ggtags
  :ensure t
  :config
  (add-hook 'c-mode-common-hook
            (lambda ()
              (when (derived-mode-p 'c-mode 'c++-mode 'java-mode)
                (ggtags-mode 1)
                (setq-local imenu-create-index-function #'ggtags-build-imenu-index)))
            ))

(use-package compile
  :ensure nil
  :defer 2
  :config
  (require 'bard-compile)
  (setq compilation-scroll-output t
        compilation-auto-jump-to-first-error nil)
  )

;; Version control
(use-package magit
  :ensure t
  :config
  (setq magit-repository-directories
        '(("~/Code"                    . 1)
          ("~/Repositories"            . 1)
          ("~/dotfiles-stow"           . 0)
          ("~/.emacs.d"                . 0)
          ("~/Pictures/wallpaper"      . 0)))
  :bind ("C-c g" . magit-status)
  )

;; (use-package ada-mode
;;   :load-path "~/.emacs.d/old-ada"
;;   :bind
;;   (:map ada-mode-map
;; 	("C-j" . dired-jump)))

(provide 'bard-emacs-prog)