aboutsummaryrefslogtreecommitdiff
path: root/config/emacs/init.el
blob: ac89b443755bb7f6924bd184ad28ee82b33f1d96 (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
;;; -*- lexical-binding:t -*-

;;; TODO(nlordell):
;; 1. Update remaining init scripts:
;;        (load "~/.config/emacs/gtd.el" nil t)
;;        (load "~/.config/emacs/tree-sitter.el" nil t)
;; 2. Emacs over devcontainers/docker with TRAMP
;;    <https://happihacking.com/blog/posts/2023/dev-containers-emacs/>
;; 3. Investigate other potential sane Emacs defaults
;;    <https://idiomdrottning.org/bad-emacs-defaults>
;; 4. Setup GPTel - should be possible without FastGPT credits
;; 5. Resolve ELisp lint issues from Flycheck

(load "~/.config/emacs/sanemacs.el" nil t)
(load "~/.config/emacs/ligatures.el" nil t)

;;;
;;; General
;;;

(use-package ace-window
  :bind
  (("C-c o" . ace-window)))

(use-package avy
  :bind
  (("C-:" . avy-goto-char)
   ("M-g f" . avy-goto-line)))

(use-package flycheck
  :config
  (add-hook 'after-init-hook #'global-flycheck-mode))

(use-package flycheck-eglot
  :after (flycheck eglot)
  :config
  (global-flycheck-eglot-mode +1))

(use-package ligature
  :config
  (ligature-set-ligatures 'prog-mode ligatures-berkeley-mono)
  (global-ligature-mode +1))

(use-package magit
  :custom
  (transient-levels-file "~/.cache/emacs/transient/levels.el")
  (transient-values-file "~/.cache/emacs/transient/values.el")
  (transient-history-file "~/.cache/emacs/transient/history.el"))

(use-package projectile
  :bind-keymap
  ("C-c p" . projectile-command-map)
  :custom
  (projectile-known-projects-file "~/.cache/emacs/projectile-bookmarks.eld")
  (projectile-project-search-path '(("~/Developer/" . 2)))
  :config
  (projectile-mode +1))

(use-package undo-tree
  :custom
  (undo-tree-auto-save-history nil)
  :config
  (global-undo-tree-mode +1))

(use-package which-key
  :config
  (which-key-mode +1))

;;;
;;; OCaml
;;;

(use-package tuareg)

(use-package ocaml-eglot
  :after (flycheck tuareg)
  :custom
  (ocaml-eglot-syntax-checker 'flycheck)
  :hook
  (tuareg-mode . ocaml-eglot)
  (ocaml-eglot . eglot-ensure))

;;;
;;; macOS
;;;

;; Make the shell environement available when started on macOS Spotlight.
(when (memq window-system '(mac ns))
  (use-package exec-path-from-shell
    :config
    (exec-path-from-shell-initialize)))