-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.el
More file actions
144 lines (117 loc) · 4.37 KB
/
init.el
File metadata and controls
144 lines (117 loc) · 4.37 KB
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
144
;;; init.el --- Emacs configuration for Simulacra-Scheme project
;;; Commentary:
;; This configuration provides Geiser support for Guile Scheme
;; and enhances syntax highlighting for better presentations and demos.
;;; Code:
;; Package system setup
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
;; Install use-package if not already installed
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
;; Geiser for Scheme interaction
(use-package geiser
:config
(setq geiser-active-implementations '(guile)))
(use-package geiser-guile
:after geiser
:config
(setq geiser-guile-binary "guile")
(setq geiser-guile-load-path '("/Users/jasonwalsh/projects/jwalsh/simulacra-scheme")))
;; Enhanced Scheme mode with better syntax highlighting
(use-package scheme-mode
:ensure nil ; Built-in
:hook (scheme-mode . (lambda ()
(setq prettify-symbols-alist
'(("lambda" . ?λ)
("define" . ?≡)
("eq?" . ?≟)
("equal?" . ?≡)
("#t" . ?✓)
("#f" . ?✗)))))
:config
(setq scheme-program-name "guile"))
;; Rainbow delimiters for better bracket visibility
(use-package rainbow-delimiters
:hook (scheme-mode . rainbow-delimiters-mode))
;; Company for autocompletion
(use-package company
:hook (scheme-mode . company-mode)
:config
(setq company-idle-delay 0.1)
(setq company-minimum-prefix-length 1))
;; Paredit for structured editing
(use-package paredit
:hook (scheme-mode . paredit-mode))
;; Theme setup for presentations
(use-package doom-themes
:config
(load-theme 'doom-one t)
;; Enhanced contrast for presentations
(setq doom-one-brighter-comments t)
(setq doom-one-brighter-modeline t))
;; Nice mode line
(use-package doom-modeline
:init (doom-modeline-mode 1))
;; Helpful for demos - highlights the current line
(global-hl-line-mode 1)
;; Font settings suitable for presentations
(set-face-attribute 'default nil :font "Fira Code" :height 140)
(set-face-attribute 'variable-pitch nil :font "Fira Sans" :height 140)
;; Org-mode settings for documentation
(use-package org
:hook (org-mode . visual-line-mode)
:config
(setq org-startup-with-inline-images t)
;; Enable Mermaid diagrams in org-mode
(org-babel-do-load-languages
'org-babel-load-languages
'((scheme . t)
(mermaid . t))))
;; Functions for demo purposes
(defun simulacra-load-and-run ()
"Load the current Scheme file and run the main example."
(interactive)
(geiser-load-current-buffer)
(run-scheme "guile -l example.scm -c \"(run-social-media-simulation)\""))
(defun simulacra-generate-diagrams ()
"Generate Mermaid diagrams from Scheme code."
(interactive)
(async-shell-command "make generate-diagrams"))
;; Keybindings for Simulacra-Scheme project
(global-set-key (kbd "C-c r") 'simulacra-load-and-run)
(global-set-key (kbd "C-c g") 'simulacra-generate-diagrams)
(global-set-key (kbd "C-c s") 'run-scheme)
;; Project-specific settings
(add-hook 'scheme-mode-hook
(lambda ()
(when (string-match-p "simulacra-scheme" default-directory)
(setq left-margin-width 2)
(setq right-margin-width 2)
(set-window-buffer nil (current-buffer)))))
;; Tweak colors for Simulacra concepts
(defface simulacra-reality-face
'((t (:foreground "#98c379" :weight bold)))
"Face for reality concepts.")
(defface simulacra-hyperreality-face
'((t (:foreground "#c678dd" :weight bold)))
"Face for hyperreality concepts.")
(defface simulacra-simulation-face
'((t (:foreground "#e5c07b" :weight bold)))
"Face for simulation concepts.")
;; Add font-lock keywords for Simulacra concepts
(font-lock-add-keywords
'scheme-mode
'(("\\<\\(reality\\|original\\|authentic\\)\\>" . 'simulacra-reality-face)
("\\<\\(hyperreal\\|simulation\\|simulacra\\)\\>" . 'simulacra-hyperreality-face)
("\\<\\(first-order\\|second-order\\|third-order\\|fourth-order\\)\\>" . 'simulacra-simulation-face)))
;; Auto-start functionality
(add-hook 'after-init-hook
(lambda ()
(message "Simulacra-Scheme environment initialized!")))
(provide 'init)
;;; init.el ends here