summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2025-03-09 21:28:36 +0200
committerGravatar Uko Kokņevičs2025-03-09 23:18:10 +0200
commit1d9121b6e716563b502252f621f81f0f95d5ea93 (patch)
tree72bf359ea2ad87cf60b25f14217bece2e871f38a
parentAdd arkta-cosmetic.el, add stuff from init.el (diff)
downloademacs.d-1d9121b6e716563b502252f621f81f0f95d5ea93.tar.gz
emacs.d-1d9121b6e716563b502252f621f81f0f95d5ea93.tar.xz
emacs.d-1d9121b6e716563b502252f621f81f0f95d5ea93.zip
Add arkta-progmodes.el, add stuff from init.el
-rw-r--r--arkta/arkta-progmodes.el250
-rw-r--r--init.el247
2 files changed, 251 insertions, 246 deletions
diff --git a/arkta/arkta-progmodes.el b/arkta/arkta-progmodes.el
new file mode 100644
index 0000000..06d736b
--- /dev/null
+++ b/arkta/arkta-progmodes.el
@@ -0,0 +1,250 @@
1;; -*- lexical-binding: t -*-
2;; Copyright © 2018-2025 Uko Koknevics
3
4(use-package c-ts-mode
5 :after treesit
6 :straight '(c-ts-mode :type built-in)
7 :mode ("\\.c\\'"
8 ("\\.cpp\\'" . c++-ts-mode))
9 :init
10 (defun arkta/c-setup ()
11 (set-tab-usage t)
12 (set-tab-width c-ts-mode-indent-offset))
13 :hook (c-ts-base-mode . arkta/c-setup)
14 :custom
15 (c-ts-mode-indent-offset 8)
16 (c-ts-mode-indent-style (lambda ()
17 `(((node-is ")") parent-bol 0)
18 ((node-is "}") parent-bol 0)
19 ((node-is "access_specifier") parent-bol 0)
20 ((parent-is "argument_list") parent-bol c-ts-mode-indent-offset)
21 ((parent-is "parameter_list") parent-bol c-ts-mode-indent-offset)
22 ((parent-is "field_declaration_list") parent-bol c-ts-mode-indent-offset)
23 ,@(alist-get 'linux (c-ts-mode--indent-styles 'c))))))
24
25(use-package cmake-ts-mode
26 :after treesit
27 :straight '(cmake-ts-mode :type built-in)
28 :mode ("CMakeLists\\.txt\\'"
29 "\\.cmake\\'"))
30
31(use-package csharp-mode
32 :after treesit
33 :straight '(csharp-mode :type built-in)
34 :mode "\\.cs\\'")
35
36(use-package css-mode
37 :after treesit
38 :straight '(css-mode :type built-in)
39 :mode "\\.css\\'")
40
41(use-package dart-mode
42 :straight t
43 :mode "\\.dart\\'")
44
45(use-package dockerfile-ts-mode
46 :after treesit
47 :straight '(dockerfile-ts-mode :type built-in)
48 :mode "Dockerfile\\'")
49
50(use-package ebuild-mode
51 :straight t
52 :mode ("\\.ebuild\\'"
53 "\\.eclass\\'"))
54
55(use-package elisp-mode
56 :straight '(elisp-mode :type built-in)
57 :mode ("\\.el\\'" . emacs-lisp-mode)
58 :init
59 (use-package auto-compile
60 :straight t
61 :hook ((emacs-lisp-mode . auto-compile-on-load-mode)
62 (emacs-lisp-mode . auto-compile-on-save-mode))))
63
64(use-package elixir-mode
65 :straight t
66 :mode "\\.exs?\\'"
67 :init
68 (defun arkta/elixir-setup ()
69 (add-hook 'before-save-hook #'elixir-format nil t))
70 :hook (elixir-mode . arkta/elixir-setup))
71
72(use-package gdscript-mode
73 :straight t
74 :mode "\\.gd\\'")
75
76(use-package go-ts-mode
77 :after treesit
78 :straight '(go-ts-mode :type built-in)
79 :mode "\\.go\\'"
80 :init
81 (defun arkta/go-setup ()
82 (add-hook 'before-save-hook #'gofmt-before-save nil t)
83 (set-tab-usage t)
84 (set-tab-width go-ts-mode-indent-offset))
85 :hook (go-ts-mode . arkta/go-setup))
86
87(use-package groovy-mode
88 :straight t
89 :mode ("Jenkinsfile\\'"
90 "\\.gradle\\'"
91 "\\.groovy\\'"))
92
93(use-package haskell-mode
94 :straight t
95 :mode "\\.hs\\'")
96
97(use-package java-ts-mode
98 :after treesit
99 :straight '(java-ts-mode :type built-in)
100 :mode "\\.java\\'")
101
102(use-package js
103 :after treesit
104 :straight '(js :type built-in)
105 :mode ("\\.js\\'" . js-ts-mode))
106
107(use-package json-ts-mode
108 :after treesit
109 :straight '(json-ts-mode :type built-in)
110 :mode "\\.json\\'")
111
112(use-package lisp-mode
113 :straight '(lisp-mode :type built-in)
114 :mode "\\.lisp\\'"
115 :init
116 (use-package slime
117 :straight t
118 :after lisp-mode
119 :commands slime
120 :custom
121 (inferior-lisp-program (executable-find "sbcl"))))
122
123(use-package lua-mode
124 :straight t
125 :custom
126 (lua-indent-level 4)
127 :mode ("\\.lua\\'" "\\.rockspec\\'"))
128
129(use-package make-mode
130 :straight '(make-mode :type built-in)
131 :mode (("Makefile\\'" . makefile-gmake-mode)
132 "GNUmakefile\\'"
133 "\\.mk\\(\\.template\\)?\\'"))
134
135(use-package markdown-mode
136 :straight t
137 :mode ("\\.md\\'" . gfm-mode))
138
139(use-package nasm-mode
140 :straight t
141 :mode ("\\.asm\\'"
142 "\\.inc\\'")
143 :init
144 (defun arkta/nasm-setup ()
145 (set-tab-width 4))
146 :hook (nasm-mode . arkta/nasm-setup))
147
148(use-package nix-mode
149 :straight t
150 :mode "\\.nix\\'")
151
152(use-package nxml-mode
153 :straight '(nxml-mode :type built-in)
154 :mode ("\\.xml\\'"
155 "\\.plist\\'"
156 "\\.svg\\'"))
157
158(use-package org
159 :straight '(org :type built-in)
160 :bind (("C-c l" . org-store-link)
161 ("C-c a" . org-agenda))
162 :mode ("\\.org\\'" . org-mode)
163 :init
164 (use-package htmlize
165 :straight t)
166 :custom
167 (org-agenda-files '("~/TODO.org"))
168 (org-log-done t))
169
170(use-package php-mode
171 :straight t
172 :mode "\\.php\\'")
173
174(use-package pico8-mode
175 :straight '(pico8-mode :host github
176 :repo "Kaali/pico8-mode")
177 :mode "\\.p8\\'")
178
179(use-package prolog
180 :straight '(prolog :type built-in)
181 :mode ("\\.pl\\'" . prolog-mode))
182
183(use-package python
184 :after treesit
185 :straight '(python :type built-in)
186 :mode ("\\.py\\'" . python-ts-mode))
187
188(use-package ruby-ts-mode
189 :after treesit
190 :straight '(ruby-ts-mode :type built-in)
191 :mode "\\.rb\\'")
192
193(use-package rust-ts-mode
194 :after treesit
195 :straight '(rust-ts-mode :type built-in)
196 :mode "\\.rs\\'")
197
198(use-package scala-mode
199 :straight t
200 :mode "\\.scala\\'")
201
202(use-package scheme
203 :straight '(scheme :type built-in)
204 :commands scheme-mode
205 :mode ("\\.scm\\'" . scheme-mode)
206 :config
207 (put 'module 'scheme-indent-function 2))
208
209(use-package smalltalk-mode
210 :straight t
211 :mode "\\.st\\'")
212
213(use-package svelte-mode
214 :straight t
215 :mode ("\\.svelte\\'" "\\.svx\\'"))
216
217(use-package sml-mode
218 :straight t
219 :mode "\\.sml\\'"
220 :init
221 (use-package company-mlton
222 :after company
223 :straight '(company-mlton :host github
224 :repo "MatthewFluet/company-mlton")
225 :hook (sml-mode . company-mlton-init)))
226
227(use-package toml-ts-mode
228 :after treesit
229 :straight '(toml-ts-mode :type built-in)
230 :mode "\\.toml\\'")
231
232(use-package typescript-ts-mode
233 :after treesit
234 :straight '(typescript-ts-mode :type built-in)
235 :mode "\\.ts\\'")
236
237(use-package typst-mode
238 :straight t
239 :mode "\\.typ\\'")
240
241(use-package yaml-ts-mode
242 :after treesit
243 :straight '(yaml-ts-mode :type built-in)
244 :mode "\\.ya?ml\\'")
245
246(use-package zig-mode
247 :straight t
248 :mode "\\.zig\\'")
249
250(provide 'arkta-progmodes)
diff --git a/init.el b/init.el
index 05184e0..662e5b9 100644
--- a/init.el
+++ b/init.el
@@ -199,6 +199,7 @@
199;; HIC SVNT DRACONES 199;; HIC SVNT DRACONES
200 200
201(require 'arkta-cosmetic) 201(require 'arkta-cosmetic)
202(require 'arkta-progmodes)
202(require 'arkta-project) 203(require 'arkta-project)
203 204
204(use-package ace-window 205(use-package ace-window
@@ -211,33 +212,6 @@
211 :config 212 :config
212 (amx-mode +1)) 213 (amx-mode +1))
213 214
214(use-package c-ts-mode
215 :after treesit
216 :straight '(c-ts-mode :type built-in)
217 :mode ("\\.c\\'"
218 ("\\.cpp\\'" . c++-ts-mode))
219 :init
220 (defun arkta/c-setup ()
221 (set-tab-usage t)
222 (set-tab-width c-ts-mode-indent-offset))
223 :hook (c-ts-base-mode . arkta/c-setup)
224 :custom
225 (c-ts-mode-indent-offset 8)
226 (c-ts-mode-indent-style (lambda ()
227 `(((node-is ")") parent-bol 0)
228 ((node-is "}") parent-bol 0)
229 ((node-is "access_specifier") parent-bol 0)
230 ((parent-is "argument_list") parent-bol c-ts-mode-indent-offset)
231 ((parent-is "parameter_list") parent-bol c-ts-mode-indent-offset)
232 ((parent-is "field_declaration_list") parent-bol c-ts-mode-indent-offset)
233 ,@(alist-get 'linux (c-ts-mode--indent-styles 'c))))))
234
235(use-package cmake-ts-mode
236 :after treesit
237 :straight '(cmake-ts-mode :type built-in)
238 :mode ("CMakeLists\\.txt\\'"
239 "\\.cmake\\'"))
240
241(use-package company 215(use-package company
242 :straight t 216 :straight t
243 :custom 217 :custom
@@ -273,20 +247,6 @@
273 :config 247 :config
274 (counsel-mode +1)) 248 (counsel-mode +1))
275 249
276(use-package csharp-mode
277 :after treesit
278 :straight '(csharp-mode :type built-in)
279 :mode "\\.cs\\'")
280
281(use-package css-mode
282 :after treesit
283 :straight '(css-mode :type built-in)
284 :mode "\\.css\\'")
285
286(use-package dart-mode
287 :straight t
288 :mode "\\.dart\\'")
289
290(use-package dashboard 250(use-package dashboard
291 :straight t 251 :straight t
292 :demand t 252 :demand t
@@ -302,16 +262,6 @@
302 :config 262 :config
303 (dashboard-setup-startup-hook)) 263 (dashboard-setup-startup-hook))
304 264
305(use-package dockerfile-ts-mode
306 :after treesit
307 :straight '(dockerfile-ts-mode :type built-in)
308 :mode "Dockerfile\\'")
309
310(use-package ebuild-mode
311 :straight t
312 :mode ("\\.ebuild\\'"
313 "\\.eclass\\'"))
314
315(use-package editorconfig 265(use-package editorconfig
316 :straight t 266 :straight t
317 :config 267 :config
@@ -326,23 +276,6 @@
326 :documentOnTypeFormattingProvider)) 276 :documentOnTypeFormattingProvider))
327 (eglot-autoshutdown t)) 277 (eglot-autoshutdown t))
328 278
329(use-package elisp-mode
330 :straight '(elisp-mode :type built-in)
331 :mode ("\\.el\\'" . emacs-lisp-mode)
332 :init
333 (use-package auto-compile
334 :straight t
335 :hook ((emacs-lisp-mode . auto-compile-on-load-mode)
336 (emacs-lisp-mode . auto-compile-on-save-mode))))
337
338(use-package elixir-mode
339 :straight t
340 :mode "\\.exs?\\'"
341 :init
342 (defun arkta/elixir-setup ()
343 (add-hook 'before-save-hook #'elixir-format nil t))
344 :hook (elixir-mode . arkta/elixir-setup))
345
346(use-package elpher 279(use-package elpher
347 :straight t 280 :straight t
348 :commands (elpher) 281 :commands (elpher)
@@ -362,31 +295,6 @@
362 :config 295 :config
363 (gcmh-mode +1)) 296 (gcmh-mode +1))
364 297
365(use-package gdscript-mode
366 :straight t
367 :mode "\\.gd\\'")
368
369(use-package go-ts-mode
370 :after treesit
371 :straight '(go-ts-mode :type built-in)
372 :mode "\\.go\\'"
373 :init
374 (defun arkta/go-setup ()
375 (add-hook 'before-save-hook #'gofmt-before-save nil t)
376 (set-tab-usage t)
377 (set-tab-width go-ts-mode-indent-offset))
378 :hook (go-ts-mode . arkta/go-setup))
379
380(use-package groovy-mode
381 :straight t
382 :mode ("Jenkinsfile\\'"
383 "\\.gradle\\'"
384 "\\.groovy\\'"))
385
386(use-package haskell-mode
387 :straight t
388 :mode "\\.hs\\'")
389
390(use-package ibuffer 298(use-package ibuffer
391 :straight '(ibuffer :type built-in) 299 :straight '(ibuffer :type built-in)
392 :bind (("C-x C-b" . ibuffer) 300 :bind (("C-x C-b" . ibuffer)
@@ -405,122 +313,10 @@
405 :config 313 :config
406 (ivy-mode +1)) 314 (ivy-mode +1))
407 315
408(use-package java-ts-mode
409 :after treesit
410 :straight '(java-ts-mode :type built-in)
411 :mode "\\.java\\'")
412
413(use-package js
414 :after treesit
415 :straight '(js :type built-in)
416 :mode ("\\.js\\'" . js-ts-mode))
417
418(use-package json-ts-mode
419 :after treesit
420 :straight '(json-ts-mode :type built-in)
421 :mode "\\.json\\'")
422
423(use-package lisp-mode
424 :straight '(lisp-mode :type built-in)
425 :mode "\\.lisp\\'"
426 :init
427 (use-package slime
428 :straight t
429 :after lisp-mode
430 :commands slime
431 :custom
432 (inferior-lisp-program (executable-find "sbcl"))))
433
434(use-package lua-mode
435 :straight t
436 :custom
437 (lua-indent-level 4)
438 :mode ("\\.lua\\'" "\\.rockspec\\'"))
439
440(use-package magit 316(use-package magit
441 ;; TODO: Do some proper setup 317 ;; TODO: Do some proper setup
442 :straight t) 318 :straight t)
443 319
444(use-package make-mode
445 :straight '(make-mode :type built-in)
446 :mode (("Makefile\\'" . makefile-gmake-mode)
447 "GNUmakefile\\'"
448 "\\.mk\\(\\.template\\)?\\'"))
449
450(use-package markdown-mode
451 :straight t
452 :mode ("\\.md\\'" . gfm-mode))
453
454(use-package nasm-mode
455 :straight t
456 :mode ("\\.asm\\'"
457 "\\.inc\\'")
458 :init
459 (defun arkta/nasm-setup ()
460 (set-tab-width 4))
461 :hook (nasm-mode . arkta/nasm-setup))
462
463(use-package nix-mode
464 :straight t
465 :mode "\\.nix\\'")
466
467(use-package nxml-mode
468 :straight '(nxml-mode :type built-in)
469 :mode ("\\.xml\\'"
470 "\\.plist\\'"
471 "\\.svg\\'"))
472
473(use-package org
474 :straight '(org :type built-in)
475 :bind (("C-c l" . org-store-link)
476 ("C-c a" . org-agenda))
477 :mode ("\\.org\\'" . org-mode)
478 :init
479 (use-package htmlize
480 :straight t)
481 :custom
482 (org-agenda-files '("~/TODO.org"))
483 (org-log-done t))
484
485(use-package php-mode
486 :straight t
487 :mode "\\.php\\'")
488
489(use-package pico8-mode
490 :straight '(pico8-mode :host github
491 :repo "Kaali/pico8-mode")
492 :mode "\\.p8\\'")
493
494(use-package prolog
495 :straight '(prolog :type built-in)
496 :mode ("\\.pl\\'" . prolog-mode))
497
498(use-package python
499 :after treesit
500 :straight '(python :type built-in)
501 :mode ("\\.py\\'" . python-ts-mode))
502
503(use-package ruby-ts-mode
504 :after treesit
505 :straight '(ruby-ts-mode :type built-in)
506 :mode "\\.rb\\'")
507
508(use-package rust-ts-mode
509 :after treesit
510 :straight '(rust-ts-mode :type built-in)
511 :mode "\\.rs\\'")
512
513(use-package scala-mode
514 :straight t
515 :mode "\\.scala\\'")
516
517(use-package scheme
518 :straight '(scheme :type built-in)
519 :commands scheme-mode
520 :mode ("\\.scm\\'" . scheme-mode)
521 :config
522 (put 'module 'scheme-indent-function 2))
523
524(use-package server 320(use-package server
525 :config 321 :config
526 (setq server-socket-dir (expand-file-name local-dir "server"))) 322 (setq server-socket-dir (expand-file-name local-dir "server")))
@@ -532,24 +328,6 @@
532 :custom 328 :custom
533 (backward-delete-char-untabify-method nil)) 329 (backward-delete-char-untabify-method nil))
534 330
535(use-package smalltalk-mode
536 :straight t
537 :mode "\\.st\\'")
538
539(use-package sml-mode
540 :straight t
541 :mode "\\.sml\\'"
542 :init
543 (use-package company-mlton
544 :after company
545 :straight '(company-mlton :host github
546 :repo "MatthewFluet/company-mlton")
547 :hook (sml-mode . company-mlton-init)))
548
549(use-package svelte-mode
550 :straight t
551 :mode ("\\.svelte\\'" "\\.svx\\'"))
552
553(use-package swiper 331(use-package swiper
554 :straight t 332 :straight t
555 :bind (([remap isearch-forward] . swiper-isearch) 333 :bind (([remap isearch-forward] . swiper-isearch)
@@ -557,11 +335,6 @@
557 ("C-s" . swiper-isearch) 335 ("C-s" . swiper-isearch)
558 ("C-r" . swiper-isearch-backward))) 336 ("C-r" . swiper-isearch-backward)))
559 337
560(use-package toml-ts-mode
561 :after treesit
562 :straight '(toml-ts-mode :type built-in)
563 :mode "\\.toml\\'")
564
565(use-package treemacs 338(use-package treemacs
566 :straight t 339 :straight t
567 :commands (treemacs treemacs-select-window) 340 :commands (treemacs treemacs-select-window)
@@ -599,21 +372,3 @@
599 (unless (treesit-language-available-p name) 372 (unless (treesit-language-available-p name)
600 (treesit-install-language-grammar name)))) 373 (treesit-install-language-grammar name))))
601 treesit-language-source-alist)) 374 treesit-language-source-alist))
602
603(use-package typescript-ts-mode
604 :after treesit
605 :straight '(typescript-ts-mode :type built-in)
606 :mode "\\.ts\\'")
607
608(use-package typst-mode
609 :straight t
610 :mode "\\.typ\\'")
611
612(use-package yaml-ts-mode
613 :after treesit
614 :straight '(yaml-ts-mode :type built-in)
615 :mode "\\.ya?ml\\'")
616
617(use-package zig-mode
618 :straight t
619 :mode "\\.zig\\'")