blob: f783eb064c9bd03fe0f0a28670c19a69d152727e (
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
;;; bard-emacs-prog.el --- configuration for progamming environment -*- lexical-binding: t -*-
;; Author: Bardman
;; Maintainer: Bardman
;; Version: 0.1.0
;; Package-Requires: ((Emacs "28.1"))
;; This file is not part of GNU Emacs
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
;; Input methods
(use-package emacs
:bind
(("<f10>" . toggle-input-method)))
(use-package prog-mode
:hook
((prog-mode . display-line-numbers-mode)
(prog-mode . whitespace-mode)
(prog-mode . hl-todo-mode)))
(use-package haskell-mode
:hook
((haskell-mode . interactive-haskell-mode)
(haskell-mode . haskell-doc-mode)
(haskell-mode . haskell-indent-mode))
:bind
(:map haskell-mode-map ("C-`" . complete)))
;; CPP Mode
(use-package prog-mode
:config
(setq-default c-basic-offset 4))
;;; Haskell
;; disable ghci popups
(use-package haskell-mode
:config
(setq haskell-interactive-popup-errors nil))
(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
:bind
(:map clojure-mode-map
("C-<tab>" . cider-switch-to-repl-buffer))
:hook
(clojure-mode . paredit-mode))
(use-package cider
:bind
(:map cider-repl-mode-map
("C-<tab>" . cider-switch-to-last-clojure-buffer)))
(use-package sly
:config
(setq inferior-lisp-program (executable-find "sbcl")))
(use-package geiser
:ensure t)
(use-package geiser-gauche
:ensure t)
;; parens packages
(use-package paredit
:ensure t)
(use-package scheme-mode
:hook (scheme-mode . paredit-mode))
(use-package lisp-mode
:hook (lisp-mode . paredit-mode))
(use-package emacs-lisp-mode
:hook (emacs-lisp-mode . paredit-mode))
(use-package haskell-mode
:ensure t)
(use-package flycheck
:ensure t
:init
(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)))))
;; Version control
(use-package magit
:ensure t
:config
(define-key global-map (kbd "C-c g") #'magit))
(use-package ada-mode
:after dired
:load-path "~/.emacs.d/old-ada/"
:bind
(:map ada-mode-map
("C-j" . dired-jump)))
(use-package diff-hl
:ensure t
:after magit
(add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)
:init
(add-hook 'prog-mode-hook 'diff-hl-mode))
(provide 'bard-emacs-prog)
;;; bard-emacs-prog.el ends here
|