-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
2841 lines (2401 loc) · 114 KB
/
init.el
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
;; Set `init-file-debug' to t in the dotspacemacs/user-init to obtain timestamps
(defun my=dbg=tstp ()
0
;; (if (functionp #'dbg=tstp) (dbg=tstp) (car (time-convert nil t)))
)
(setq my=dbg=init-time
0
;; (if (boundp #'dbg=init-time) dbg=init-time (my=dbg=tstp))
)
(setq my=dbg=fmt (if (boundp #'dbg=fmt) dbg=fmt "%012d"))
(defun my=log (fun-point)
(format "%s %s [%%s] (length load-path) %s"
(format my=dbg=fmt (- (my=dbg=tstp) my=dbg=init-time))
(if (eq fun-point #'beg) "{{{{{{{{" "}}}}}}}}")
(length load-path)))
(defun my=beg (f)
"TODO my=beg could / should be done using (advice-add :before ...)"
;; (message (my=log #'beg) f)
)
(defun my=end (f)
"TODO my=end could / should be done using (advice-add :after ...)"
;; (message (my=log #'end) f)
)
;; When running from bash on a non-Guix system, some environment variables may
;; not be defined.
;; It seems that this macro cannot be added to emacs-tweaks, as it only gets
;; loaded during a later stage of Spacemacs initialization.
(defmacro my=def-evar (elisp-var def-val evar-name)
"Define an Emacs variable from environment with defaults. Warn if
differences were encountered."
`(let* ((evar-val (or (getenv ,evar-name) ,def-val)))
(setq ,elisp-var (or (getenv ,evar-name) ,def-val))
(unless (string= ,elisp-var (expand-file-name ,def-val))
(message "WARN (expand-file-name def-val): %s and evar: %s=%s differ"
(expand-file-name ,def-val) ,evar-name evar-val))))
(my=def-evar dev "~/dev" "dev")
(my=def-evar dotf "~/dev/dotfiles" "dotf")
(let ((emacs-default-dir "~/.emacs.d")
(emacs-distros-dir "~/.emacs.d.distros/"))
(if (file-directory-p emacs-distros-dir)
(setq sp-dir "spguimacs"
sp-home-dir (concat emacs-distros-dir sp-dir))
(setq sp-dir emacs-default-dir
sp-home-dir emacs-default-dir)))
(setq hostname (system-name))
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(my=beg #'dotspacemacs/layers)
(setq-default ; of dotspacemacs/layers
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
;; or `spacemacs'. (default 'spacemacs)
dotspacemacs-distribution 'spacemacs
;; Lazy installation of layers (i.e. layers are installed only when a file
;; with a supported type is opened). Possible values are `all', `unused'
;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
;; lazy install any layer that support lazy installation even the layers
;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
;; installation feature and you have to explicitly list a layer in the
;; variable `dotspacemacs-configuration-layers' to install it.
;; (default 'unused)
dotspacemacs-enable-lazy-installation 'unused
;; If non-nil then Spacemacs will ask for confirmation before installing
;; a layer lazily. (default t)
dotspacemacs-ask-for-lazy-installation t
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. "~/.mycontribs/")
;; Direct jump with ~g f~ to $dotf/.emacs.d.sp---macs/
;; The path is the same for all sp*macs.
dotspacemacs-configuration-layer-path
`(,(concat dotf "/.emacs.d.sp---macs/"))
;; List of configuration layers to load.
dotspacemacs-configuration-layers
`(
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press `SPC f e R' (Vim style) or
;; `M-m f e R' (Emacs style) to install them.
;; ----------------------------------------------------------------
;;
;; Layers added in alphabetic order
;; Enable asciidoc layer for editing asciidoc content e.g. docs.cider.mx
;; editing
;; asciidoc
;; Add tool tips to show doc string of functions
;; Show snippets in the auto-completion popup
;; Show suggestions by most commonly used
(auto-completion :variables
;; (setq
auto-completion-enable-help-tooltip t
auto-completion-enable-snippets-in-popup t
auto-completion-enable-sort-by-usage t
;; auto-completion-enable-help-tooltip 'manual
;; )
)
better-defaults
;; (setq org-babel-clojure-backend 'cider)
;; (setq gui-elements 1) ; because of CIDER menu
;; (define-key cider-repl-mode-map "s-<delete>" nil)
;; (unbind-key "s-<delete>" cider-repl-mode-map)
;; https://develop.spacemacs.org/layers/+lang/clojure/README.html
;; cider package location configured by
;; ~/.emacs.d.distros/spguimacs/layers/+lang/clojure/packages.el
;; in its 'use-package'
(clojure
:variables
;; (Default '(macro core deprecated))
;; cider-font-lock-dynamically '(macro core function var)
;; (Default undef)
cider-overlays-use-font-lock t
;; (Default nil)
cider-preferred-build-tool 'clojure-cli
;; Limit lines shown in REPL buffer. (Default nil)
;; cider-repl-buffer-size-limit 500
;; (Default undef) - really undef?
cider-repl-use-pretty-printing t
;; Pretty printing with sorted keys / set values
cider-print-fn 'puget
;; Run Cider without any LSP features. (Default nil)
;; clojure-backend 'cider
;; (Default nil) - really nil?
clojure-enable-clj-refactor t
;; (Default t) - really t?
cljr-warn-on-eval nil
;; (Default ?)
clojure-enable-linters 'clj-kondo
;; Debugger & Profiler. Requires:
;; {:deps {com.billpiel/sayid {:mvn/version "0.1.0"}}}
;; in the deps.end of a given Clojure project. (Default nil)
clojure-enable-sayid t
;; Evaluate expressions in comment as top level. (Default nil)
clojure-toplevel-inside-comment-form t
;; Indentation of function forms
;; https://github.com/clojure-emacs/clojure-mode#indentation-of-function-forms
;; (setq clojure-indent-style 'align-arguments)
;; Vertically align s-expressions
;; https://github.com/clojure-emacs/clojure-mode#vertical-alignment
;; (setq clojure-align-forms-automatically t)
;; Auto-indent code automatically
;; https://emacsredux.com/blog/2016/02/07/auto-indent-your-code-with-aggressive-indent-mode/
;; (add-hook 'clojure-mode-hook #'aggressive-indent-mode)
)
;; Nyan cat indicating relative position in current buffer
;; :variables colors-enable-nyan-cat-progress-bar (display-graphic-p)
colors
;; SPC a L displays key and command history in a separate buffer
;; Show commands as you type in a separate buffer
;; command-log ;; deprecated - log keystrokes
;; Tools to work with comma separate values e.g. data science data
;; https://develop.spacemacs.org/layers/+lang/csv/README.html
csv
;; docker
elixir ; Erlang VM
;; For Spacemacs configuration files and packages
emacs-lisp
;; Include emojis into everything
;; emoji
;; M-x erc/default-servers `SPC a c i D`
(erc :variables
erc-fill-column 120
;; erc-fill-function 'erc-fill-variable
erc-fill-function 'erc-fill-static
erc-fill-static-center 15
;; erc-enable-notifications nil
erc-autojoin-channels-alist
'(("libera.chat" "#guix"
;; "#systemcrafters"
))
erc-prompt-for-nickserv-password nil
erc-server-list
(list (list "irc.libera.chat" :port "6667"
:nick (getenv "IRC_USER")
:password (getenv "IRC_PASSWD"))))
(git :variables
;; TODO implement it as spacemacs|toggle
;; (setq
;; git-magit-status-fullscreen t ;; (Default nil)
;; git-enable-magit-todos-plugin t ;; (Default nil)
;; `nil' Never show fine differences. (Default nil)
;; `t' Show fine differences for the current diff hunk only.
;; `'all' Show fine differences for all displayed diff hunks.
magit-diff-refine-hunk t
;; )
)
;; Try some of the following commands:
;; git submodule add https://github.com/mitchellw/fennel-layer.git \
;; ~/.emacs.d.distros/spguimacs/layers/fennel
;; git submodule update --init
;; fennel ;; fennel = lua in lisp
;; gnus
;; go
;; graphviz - open-source graph declaration system
;; Used to generated graphs of Clojure project dependencies,
;; erc-social-graph-draw, etc.
;; https://develop.spacemacs.org/layers/+lang/graphviz/README.html
graphviz
;; the guix packaes emacs-haskell-mode and/or emacs-haskell-snippets cause
;; Error (use-package): tweaks/:catch: Opening directory: Aucun fichier ou dossier de ce type, /gnu/store/...-emacs-haskell-snippets-.../share/emacs/site-lisp/snippets
;; haskell
;; hy ;; hylang - lisp embedded in python
(helm :variables
;; (setq
;; When non-nil, save last state of ‘helm-follow-mode’ for the next
;; Emacs sessions. Each time you turn on or off ‘helm-follow-mode’,
;; the current source name will be stored or removed from
;; `helm-source-names-using-follow'. (Default nil)
;; helm-follow-mode-persistent t
;; helm-display-function 'helm-display-buffer-in-own-frame
;; nil - use the longest `buffer-name' length found. (Default 20)
;; When in M-x helm-mini ~s-]~ see also:
;; ~C-]~ / M-x helm-ff-run-toggle-basename
;; C-i
;; Doesn't work / does nothing
;; (add-to-list 'helm-commands-using-frame #'helm-M-x) ;; (Default nil)
;; (setq helm-commands-using-frame nil) ;; (Default nil)
;; (Default ((width . 80) (height . 2)))
;; (setq minibuffer-frame-alist '((minibuffer . only)))
;; (setq minibuffer-frame-alist '((width . 80) (height . 2)))
;; (setq minibuffer-frame-alist '((top . 1) (left . 1) (width . 80) (height . 2)))
;; (setq helm-split-window-inside-p t) ;; (Default nil)
;; (setq helm-split-window-inside-p nil) ;; (Default nil)
;; https://github.com/emacs-helm/helm/issues/2039#issuecomment-390103697
;; (setq helm-always-two-windows nil) ;; (Default nil)
;; (setq helm-display-buffer-default-height 23) ;; (Default nil)
;; (setq helm-display-buffer-default-height nil) ;; (Default nil)
;; (setq helm-default-display-buffer-functions '(display-buffer-in-side-window))
;; Max column width of buffer names before truncate. (Default 20)
helm-buffer-max-length nil
;; Truncate lines in ‘helm-buffers-list’ when non-nil. (Default t)
;; helm-buffers-truncate-lines nil
;; helm-display-buffer-width 100 ;; (Default 72)
;; Value is `spacemacs//display-helm-window'. Original value was
;; `helm-default-display-buffer'
;; helm-display-function 'helm-default-display-buffer
;; )
)
html
;;;; ivy ;; helm replacement
;; Operate on buffers as in dired.
;; (ibuffer :variables ibuffer-group-buffers-by 'projects)
(java
;; :variables
;; eclim-eclipse-dirs "~/eclipse-java-neon"
;; eclim-executable "~/eclipse-java-neon/eclim"
)
javascript
json
markdown
;;; ,(let ((maildir "~/Mail"))
;;; (when (file-directory-p maildir)
;;; (mu4e
;;; :variables
;;; ;; mu4e-installation-path "/usr/share/emacs/site-lisp"
;;;
;;; ;; This is set to 't' to avoid mail syncing issues when using mbsync
;;; mu4e-change-filenames-when-moving t
;;;
;;; ;; Refresh mail using isync every 10 minutes.
;;; ;; (Default nil - don't update automatically)
;;; mu4e-update-interval (* 10 60)
;;;
;;; mu4e-maildir maildir
;;; mu4e-get-mail-command "mbsync -a"
;;; ;; mu4e-compose-signature-auto-include nil
;;; mu4e-drafts-folder "/[Gmail]/Drafts"
;;; mu4e-sent-folder "/[Gmail]/Sent Mail"
;;; mu4e-refile-folder "/[Gmail]/All Mail"
;;; mu4e-trash-folder "/[Gmail]/Trash"
;;;
;;; mu4e-maildir-shortcuts '(
;;; (:maildir "/Inbox" :key ?i)
;;; (:maildir "/[Gmail]/Sent Mail" :key ?s)
;;; (:maildir "/[Gmail]/Trash" :key ?t)
;;; (:maildir "/[Gmail]/Drafts" :key ?d)
;;; (:maildir "/[Gmail]/All Mail" :key ?a)
;;; ))))
;; multiple-cursors
;; nginx
(latex
;; :variables
;; latex-build-command "LaTeX" ;; defaults to "LatexMk"
;; latex-enable-folding t ;; defaults to nil
;; latex-enable-auto-fill nil ;; defaults to t
;; latex-enable-magic t ;; defaults to nil
)
(llm-client
:variables
;; (setq
gptel-api-key (getenv "OPENAI_KEY")
gptel-model 'gpt-4o
llm-client-enable-gptel t
;; )
)
;; Language Server Protocol https://emacs-lsp.github.io/lsp-mode/
(lsp
:variables ; (setq
;; lsp-enable-file-watchers nil
;; lsp-file-watch-threshold 1500
;; lsp-keymap-prefix "C-M-s-l"
;; lsp-enable-which-key-integration t
;; Indent regions using the file formatting functionality provided by the
;; language server. Set to nil to use CIDER features instead of LSP UI
lsp-enable-indentation nil
;; Enable textDocument/onTypeFormatting integration
lsp-enable-on-type-formatting nil
;; lsp-file-watch-ignored-director
;; docstring popup - delay in seconds for mouse and cursor
lsp-ui-doc-delay 2
;; show code actions and diagnostics text as right-hand side of buffer
lsp-ui-sideline-enable nil
;; show reference count for functions (assume more lenses added in future)
lsp-lens-enable t ; )
)
(lua
:variables
lua-backend 'lua-mode ;; 'lsp is better, but requires more setup
)
;; Editing multiple lines of text concurrently
;; `g r' menu in Emacs normal state
multiple-cursors
;; Direct jump with ~g f~ $dotf/.emacs.d.spacemacs/my=tweaks/funcs.el doesn't work.
;; The '=' in the file-path makes problems.
my=tweaks ;; See `dotspacemacs-configuration-layer-path'.
octave
(org :variables
;; Don't ask for confirmation before interactively evaluating code
org-confirm-babel-evaluate nil ;; (Default t)
org-support-shift-select 'always
org-src-tab-acts-natively nil ;; default is t
;; org-roam-v2-ack t ; switch off the ' Org-roam v2!' warning
;; org-enable-roam-support t
;; capture content from external applications such as the browser
;; org-enable-roam-protocol t
)
pdf
php
;; Breaks the ~C-h k command~
;; Error message is "mapcar: Symbol’s value as variable is void: code-cells-mode""
;; See https://github.com/syl20bnr/spacemacs/issues/15548
(python
;; :variables
;; ;; TODO use a list of prefered python interpreters
;; python-shell-interpreter "python3.9.9"; python3.8 python3.7 python3.6
;; ;; -i : inspect interactively after running script; forces a prompt even
;; ;; if stdin does not appear to be a terminal; also PYTHONINSPECT=x
;; python-shell-interpreter-args "-i"
)
;; https://gist.github.com/soegaard/942a3074513655292816e0b79c466620
racket ;; see https://racket-mode.com
;; dired alternatives & related stuff :
;; https://github.com/alexluigit/dirvish
;; https://github.com/Fuco1/dired-hacks
;; https://github.com/jojojames/dired-sidebar
;; (ranger :variables ; (setq
;; ranger-override-dired 'ranger
;; ranger-show-dotfiles t
;; ;; ranger-show-preview t
;; ranger-show-hidden t
;; ranger-cleanup-eagerly t
;; ranger-cleanup-on-disable t
;; ranger-ignored-extensions '("mkv" "flv" "iso" "mp4") ; )
;; )
;; rust
;; see https://github.com/syl20bnr/spacemacs/issues/12462
;; try also:
;; dotspacemacs-excluded-packages '(ensime)
(scala :variables scala-backend 'scala-metals)
(scheme :variables ; M-x run-guile
scheme-implementations '(guile))
(shell
;; :variables
;; (Default 'ansi-term)
;; shell-default-shell 'eshell
;; shell-default-height 30
;; shell-default-position 'bottom
)
shell-scripts
;; spacemacs-layouts layer added to set variables
;; ~SPC TAB~ restricted to current layout buffers
;; Kill buffers when killing layer - ~SPC l x~
(spacemacs-layouts :variables
spacemacs-layouts-restrict-spc-tab t
persp-autokill-buffer-on-remove 'kill-weak)
;; smex ; smart M-x enhacements - recent & most used commands
;; requires:
;; sudo apt install --yes aspell-en aspell-fr aspell-de aspell-sk
spell-checking ;; ~SPC S~ / M-x flyspell-mode
sql
;; swift
syntax-checking
systemd
;; M-x centaur-tab-mode
;; (tabs :variables
;; ;; tabs-auto-hide t
;; ;; tabs-auto-hide-delay 3
;; ;; tabs-highlight-current-tab 'left
;; )
themes-megapack
;; Customise the Spacemacs themes
;; https://develop.spacemacs.org/layers/+themes/theming/README.html
;; Code in dotspacemacs/user-init to reduce size of modeline
theming
;; Visual file manager - ~SPC p t~
(treemacs
:variables
;; Removes file and directory icons
;; treemacs-no-png-images t
;; treemacs-indentation 1
;; treemacs-use-filewatch-mode t
;; treemacs-use-follow-mode t
)
typescript
;; Support font ligatures (fancy symbols) in all modes
;; 'prog-mode for only programming languages
;; including text-mode may cause issues with org-mode and magit
(unicode-fonts :variables
unicode-fonts-enable-ligatures t
unicode-fonts-ligature-modes '(prog-mode))
;; Highlight changes in buffers
;; ~SPC g .~ transient state for navigating changes
(version-control :variables
version-control-diff-tool 'diff-hl
version-control-global-margin t)
;; vimscript
;; dired alternatives & related stuff :
(vinegar :variables
vinegar-reuse-dired-buffer t
vinegar-dired-hide-details nil)
openai
;; windows-scripts
yaml
) ;; End of dotspacemacs-configuration-layers
;; List of additional packages that will be installed without being wrapped
;; in a layer (generally the packages are installed only and should still be
;; loaded using load/require/use-package in the user-config section below in
;; this file). If you need some configuration for these packages, then
;; consider creating a layer. You can also put the configuration in
;; `dotspacemacs/user-config'. To use a local version of a package, use the
;; `:location' property: '(your-package :location "~/path/to/your-package/")
;; Also include the dependencies as they will not be resolved automatically.
;;
;; Note:
;; '(your-package :location local) requires '(require 'your-package) or
;; '(use-package your-package ...) in the `dotspacemacs/user-config'.
dotspacemacs-additional-packages
'(
;; {{{ Guile IDE
arei ;; Guile IDE
plantuml-mode ;; Edit and preview PlantUML diagrams
;; }}}
;; Real-time collaborative editing environment
crdt
;; Launch and manage detached processes
detached
;; dired alternative
dirvish
;; Emacs interface (not only) for GNU Guix package manager `guix package'.
;; It also provides highlighting and tools for Guix code.
;;
;; Installation:
;; 1. Via Spacemacs installation mechanism:
;; Note: The version installed by spacemacs contains:
;; '(geiser-company--setup geiser-repl-company-p)'
;; However geiser-company.el has been removed in upstream repo:
;; https://gitlab.com/emacs-geiser/geiser/-/commit/18faa0ba32c9ce751c16960b2a39b3880b523272
;; See e.g. ~/.emacs.d.distros/spacemacs/elpa/29.4/develop/guix-20231206.2147/guix-repl.el
guix
;;
;; 2. By Guix:
;; $ guix install emacs-guix
;; then use
;; $ ls /gnu/store/*-emacs-guix-*
;; to get the elisp-code location.
;; (guix :location "/gnu/store/a0fr1hkq5kd0xywwakby1dbk4c6qqs13-emacs-guix-0.5.2-5.c9aef52/share/emacs/site-lisp/guix-0.5.2-5.c9aef52/")
;;
;; 3. From local clone of the
;; https://git.savannah.gnu.org/git/guix/emacs-guix.git
;; (guix :location "~/dev/emacs-guix/") ;; not working
;; gptel ; part of the layer `llm-client'
;; chatgpt
;; chatgpt-shell
;; ob-chatgpt-shell
;; pcsv ;; CSV parser needed by `chatgpt-shell-load-awesome-prompts'
;; (copilot :location (recipe
;; :fetcher github
;; :repo "zerolfx/copilot.el"
;; :files ("*.el" "dist")))
;; Highlight output from `strace'
;; strace-mode
;; Customize / extend keyboard functionality https://github.com/kmonad
(kbd-mode :location (recipe :fetcher github :repo "kmonad/kbd-mode"))
;; ;; JSX major mode. JSX is an XML-like syntax extension to ECMAScript
;; rjsx-mode
;; ;; Minor mode to format JS code on file save
;; prettier-js
;; yasnippet-snippets
;; (yasnippet :location ;; local
;; (recipe :fetcher github :repo "Bost/yasnippet"
;; ;; :min-version "1"
;; ))
;; send files marked in dired via MTP to Android
;; dired-mtp ; not found
;; android-mode ; doesn't work
;; Never lose your cursor again - see also 'Highlight current line'
beacon
use-package-chords
;; Discover elisp functions
suggest
crux
;; Save buffers when they lose focus
super-save
zop-to-char
fish-mode
transpose-frame
;; google-this
;; Pop-up menus of commands with common prefixes for CIDER
cider-hydra
;; Emacs mode for the Lean theorem prover
;; lean-mode
;; helm-lean
evil-vimish-fold
;; crosshairs-mode messes up with the background color of the current-line
;; (crosshairs :location local)
;; (hl-line+ :location local)
;; (vline :location local)
;; (col-highlight :location local)
;; cobol-mode
;; racket ;; ;; org-mode-babel packages {{{
;; racket ;; ;; see also org-babel-load-languages
;; racket ;; (ob-racket
;; racket ;; :location (recipe :fetcher github :repo "hasu/emacs-ob-racket"))
;; racket ;; ;; TODO add scribble-mode pollen-mode to the racket layer; with :defer t
;; racket ;; ;; (defun racket/init-pollen-mode () (use-package pollen-mode :defer t))
;; racket ;; ;; (defun racket/init-scribble-mode () (use-package scribble-mode :defer t))
;; racket ;; scribble-mode
;; racket ;; pollen-mode
;; racket ;; ;; }}}
helm-cider-history
helm-system-packages
;; helm-descbinds
;; helm-slime
helm-dictionary ;; look up words in dictionaries
;; telegram client for emacs
;; TODO document the ln -s `which gcc` ~/bin/cc
;; telega
;; Error: Package fonts-symbola is unavailable
;; fonts-symbola ;; for the telega
;; Fonts installed using:
;; guix package -i font-gnu-{freefont,unifont}
;; https://gitter.im/syl20bnr/spacemacs?at=5dba1a66e886fb5aa225bcf8
;; dired-x is part of the spacemacs-defaults layer, so it's used by default.
;; It extends dired by:
;; Omitting uninteresting files
;; Guessing shell commands
;; Running Dired command in non-Dired
;; Finding a file mentioned in a buffer
;; Commands using file marking
;; dired+ is unavailable
sqlite3 ;; for magit
tldr ;; access `tldr' pages from within Emacs
;; M-x xhair-mode
;; https://github.com/Boruch-Baum/emacs-xhair
(xhair :location (recipe :fetcher github :repo "Boruch-Baum/emacs-xhair"))
) ;; End of dotspacemacs-additional-packages
;; A list of packages that cannot be updated.
dotspacemacs-frozen-packages '()
;; A list of packages that will not be installed and loaded.
dotspacemacs-excluded-packages '()
;; Defines the behaviour of Spacemacs when installing packages.
;; Possible values are `used-only', `used-but-keep-unused' and `all'.
;; `used-only' installs only explicitly used packages and deletes any unused
;; packages as well as their unused dependencies. `used-but-keep-unused'
;; installs only the used packages but won't delete unused ones. `all'
;; installs *all* packages supported by Spacemacs and never uninstalls them.
;; (default is `used-only')
;; `used-but-keep-unused' is handy for debugging, when often restarting emacs
dotspacemacs-install-packages
'used-but-keep-unused
;; 'used-only
)
(my=end #'dotspacemacs/layers)
)
(defun dotspacemacs/init ()
"Initialization:
This function is called at the very beginning of Spacemacs startup,
before layer configuration.
It should only modify the values of Spacemacs settings."
(my=beg #'dotspacemacs/init)
;; This setq-default sexp is an exhaustive list of all the supported
;; spacemacs settings.
(setq-default
configuration-layer-elpa-archives
;; Default values
;; `(("melpa" . "melpa.org/packages/")
;; ("gnu" . "elpa.gnu.org/packages/")
;; ("nongnu" . "elpa.nongnu.org/nongnu/"))
;; Local mirrors created by https://github.com/d12frosted/elpa-mirror
;; See also:
;; https://github.com/redguardtoo/elpa-mirror
;; https://github.com/melpa/melpa
;; Update by running (fish-shell):
;; set mirror $dev/elpa-mirror.d12frosted
;; git --git-dir=$mirror/.git --work-tree=$mirror pull --rebase
(let ((mirror (concat dev "/elpa-mirror.d12frosted")))
`(("melpa" . ,(concat mirror "/melpa/"))
("gnu" . ,(concat mirror "/gnu/"))
("nongnu" . ,(concat mirror "/nongnu/"))))
;; If non-nil then enable support for the portable dumper. You'll need to
;; compile Emacs 27 from source following the instructions in file
;; EXPERIMENTAL.org at to root of the git repository.
;;
;; WARNING: pdumper does not work with Native Compilation, so it's disabled
;; regardless of the following setting when native compilation is in effect.
;;
;; (default nil)
dotspacemacs-enable-emacs-pdumper nil
;; Name of executable file pointing to emacs 27+. This executable must be
;; in your PATH.
;; (default "emacs")
dotspacemacs-emacs-pdumper-executable-file "emacs"
;; Name of the Spacemacs dump file. This is the file will be created by the
;; portable dumper in the cache directory under dumps sub-directory.
;; To load it when starting Emacs add the parameter `--dump-file'
;; when invoking Emacs 27.1 executable on the command line, for instance:
;; ./emacs --dump-file=$HOME/.emacs.d.distros/spguimacs/.cache/dumps/spguimacs-27.1.pdmp
;; (default (format "spguimacs-%s.pdmp" emacs-version))
dotspacemacs-emacs-dumper-dump-file (format "spguimacs-%s.pdmp" emacs-version)
;; If non-nil ELPA repositories are contacted via HTTPS whenever it's
;; possible. Set it to nil if you have no way to use HTTPS in your
;; environment, otherwise it is strongly recommended to let it set to t.
;; This variable has no effect if Emacs is launched with the parameter
;; `--insecure' which forces the value of this variable to nil.
;; (default t)
dotspacemacs-elpa-https t
;; Maximum allowed time in seconds to contact an ELPA repository.
;; (default 5)
dotspacemacs-elpa-timeout 5
;; Set `gc-cons-threshold' and `gc-cons-percentage' when startup finishes.
;; This is an advanced option and should not be changed unless you suspect
;; performance issues due to garbage collection operations.
;; (default '(100000000 0.1))
dotspacemacs-gc-cons '(100000000 0.1)
;; Set `read-process-output-max' when startup finishes.
;; This defines how much data is read from a foreign process.
;; Setting this >= 1 MB should increase performance for lsp servers
;; in emacs 27.
;; (default (* 1024 1024))
dotspacemacs-read-process-output-max (* 1024 1024)
;; If non-nil then Spacelpa repository is the primary source to install
;; a locked version of packages. If nil then Spacemacs will install the
;; latest version of packages from MELPA. Spacelpa is currently in
;; experimental state please use only for testing purposes.
;; (default nil)
dotspacemacs-use-spacelpa nil
;; If non-nil then verify the signature for downloaded Spacelpa archives.
;; (default t)
dotspacemacs-verify-spacelpa-archives t
;; If non-nil then spacemacs will check for updates at startup
;; when the current branch is not `develop'. Note that checking for
;; new versions works via git commands, thus it calls GitHub services
;; whenever you start Emacs. (default nil)
dotspacemacs-check-for-update nil
;; If non-nil, a form that evaluates to a package directory. For example, to
;; use different package directories for different Emacs versions, set this
;; to `emacs-version'. (default 'emacs-version)
dotspacemacs-elpa-subdirectory 'emacs-version
;; One of `vim', `emacs' or `hybrid'.
;; `hybrid' is like `vim' except that `insert state' is replaced by the
;; `hybrid state' with `emacs' key bindings. The value can also be a list
;; with `:variables' keyword (similar to layers). Check the editing styles
;; section of the documentation for details on available variables.
;; (default 'vim)
dotspacemacs-editing-style 'vim
;; If non-nil show the version string in the Spacemacs buffer. It will
;; appear as (spacemacs version)@(emacs version)
;; (default t)
dotspacemacs-startup-buffer-show-version t
;; Specify the startup banner. Default value is `official', it displays
;; the official spacemacs logo. An integer value is the index of text
;; banner, `random' chooses a random text banner in `core/banners'
;; directory. A string value must be a path to an image format supported
;; by your Emacs build.
;; If the value is nil then no banner is displayed. (default 'official)
dotspacemacs-startup-banner 'official
;; Scale factor controls the scaling (size) of the startup banner. Default
;; value is `auto' for scaling the logo automatically to fit all buffer
;; contents, to a maximum of the full image height and a minimum of 3 line
;; heights. If set to a number (int or float) it is used as a constant
;; scaling factor for the default logo size.
dotspacemacs-startup-banner-scale 'auto
;; List of items to show in startup buffer or an association list of
;; the form `(list-type . list-size)`. If nil then it is disabled.
;; Possible values for list-type are:
;; `recents' `recents-by-project' `bookmarks' `projects' `agenda' `todos'.
;; List sizes may be nil, in which case
;; `spacemacs-buffer-startup-lists-length' takes effect.
;; The exceptional case is `recents-by-project', where list-type must be a
;; pair of numbers, e.g. `(recents-by-project . (7 . 5))', where the first
;; number is the project limit and the second the limit on the recent files
;; within a project.
dotspacemacs-startup-lists '((recents . 10)
(projects . 14))
;; True if the home buffer should respond to resize events. (default t)
dotspacemacs-startup-buffer-responsive t
;; Show numbers before the startup list lines. (default t)
dotspacemacs-show-startup-list-numbers t
;; The minimum delay in seconds between number key presses. (default 0.4)
dotspacemacs-startup-buffer-multi-digit-delay 0.4
;; If non-nil, show file icons for entries and headings on Spacemacs home buffer.
;; This has no effect in terminal or if "all-the-icons" package or the font
;; is not installed. (default nil)
dotspacemacs-startup-buffer-show-icons t
;; Default major mode for a new empty buffer. Possible values are mode
;; names such as `text-mode'; and `nil' to use Fundamental mode.
;; (default `text-mode')
dotspacemacs-new-empty-buffer-major-mode 'text-mode
;; Default major mode of the scratch buffer (default `text-mode')
dotspacemacs-scratch-mode 'text-mode
;; If non-nil, *scratch* buffer will be persistent. Things you write down in
;; *scratch* buffer will be saved and restored automatically.
dotspacemacs-scratch-buffer-persistent nil
;; If non-nil, `kill-buffer' on *scratch* buffer
;; will bury it instead of killing.
dotspacemacs-scratch-buffer-unkillable nil
;; Initial message in the scratch buffer, such as "Welcome to Spacemacs!"
;; (default nil)
dotspacemacs-initial-scratch-message nil
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press `SPC T n' to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one light)
;;
;; '(<theme-name> :location local)' on a:
;; - non-Guix machine:
;; ~/.emacs.d.distros/spguimacs/private/local/<theme-name>-theme/
;; - Guix machine:
;; /gnu/store/*-spacemacs-rolling-release-*/private/local
;; TODO check the
;; /gnu/store/*-spacemacs-rolling-release-*/private/local/<theme-name>-theme/
;; I.e. the ':location local' won't work on Guix for private themes. Use
;; `custom-theme-load-path' and/or `custom-theme-directory'.
dotspacemacs-themes
`(
;; WTF? The quoting works only if farmhouse-light-mod is the first item in
;; the list
,(if (string= hostname "martin")
'(farmhouse-light-mod :location local)
'farmhouse-light-mod)
spacemacs-dark
material
misterioso
spacemacs-light
twilight-anti-bright
underwater
solarized-dark-high-contrast
heroku
)
;; Set the theme for the Spaceline. Supported themes are `spacemacs',
;; `all-the-icons', `custom', `doom', `vim-powerline' and `vanilla'. The
;; first three are spaceline themes. `doom' is the doom-emacs mode-line.
;; `vanilla' is default Emacs mode-line. `custom' is a user defined themes,
;; refer to the DOCUMENTATION.org for more info on how to create your own
;; spaceline theme. Value can be a symbol or list with additional properties.
;; (default '(spacemacs :separator wave :separator-scale 1.5))
dotspacemacs-mode-line-theme '(spacemacs :separator wave :separator-scale 1.0)
;; If non-nil the cursor color matches the state color in GUI Emacs.
;; (default t)
dotspacemacs-colorize-cursor-according-to-state t
;; Default font or prioritized list of fonts. This setting has no effect when
;; running Emacs in terminal. The font set here will be used for default and
;; fixed-pitch faces. The `:size' can be specified as
;; a non-negative integer (pixel size), or a floating-point (point size).
;; Point size is recommended, because it's device independent. (default 10.0)
;; See functions and keybindings for `text-scale-...' and `zoom-...'
;; Reset by (spacemacs/set-default-font dotspacemacs-default-font)
dotspacemacs-default-font
`("Source Code Pro"
:size
,(let* ((default 10.0)
;; The `text-scale-mode-step' is not accessible at this moment.
(text-scale-mode-step 1.2)
(point-size (cond
((string= hostname "edge") 19.0)
((or (string= hostname "ecke")
(string= hostname "tuxedo"))
;; (+ default (* 6 text-scale-mode-step)) ; 17.2
;; (+ default (* 7 text-scale-mode-step)) ; 18.4
default)
;; TODO this is a pixel-size not point-size
((string= hostname "geek") 17)
(t default))))
;; (message "### dotspacemacs-default-font hostname: %s; point-size: %s"
;; hostname point-size)
point-size)
:weight normal
:width normal)
;; The leader key (default "SPC")
dotspacemacs-leader-key "SPC"
;; The key used for Emacs commands `M-x' (after pressing on the leader key).
;; (default "SPC")
dotspacemacs-emacs-command-key "SPC"
;; The key used for Vim Ex commands (default ":")
dotspacemacs-ex-command-key ":"
;; The leader key accessible in `emacs state' and `insert state'
;; (default "M-m")
dotspacemacs-emacs-leader-key "M-m"
;; Major mode leader key is a shortcut key which is the equivalent of
;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
dotspacemacs-major-mode-leader-key ","
;; Major mode leader key accessible in `emacs state' and `insert state'.
;; (default "C-M-m" for terminal mode, "<M-return>" for GUI mode).
;; Thus M-RET should work as leader key in both GUI and terminal modes.
;; C-M-m also should work in terminal mode, but not in GUI mode.
dotspacemacs-major-mode-emacs-leader-key (if window-system "<M-return>" "C-M-m")
;; These variables control whether separate commands are bound in the GUI to
;; the key pairs `C-i', `TAB' and `C-m', `RET'.
;; Setting it to a non-nil value, allows for separate commands under `C-i'
;; and TAB or `C-m' and `RET'.
;; In the terminal, these pairs are generally indistinguishable, so this only