summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rwxr-xr-xbin/init13
-rw-r--r--early-init.el17
-rw-r--r--init.el815
-rw-r--r--logo.pngbin0 -> 50994 bytes
-rw-r--r--shared/custom.el14
6 files changed, 863 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d3326d6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
1.cache/
2auto-save-list/
3local/
4straight/ \ No newline at end of file
diff --git a/bin/init b/bin/init
new file mode 100755
index 0000000..a4feab4
--- /dev/null
+++ b/bin/init
@@ -0,0 +1,13 @@
1#!/bin/sh
2:;set -e # -*- mode: emacs-lisp; lexical-binding: t -*-
3:;exec emacs --script "$0" "$@"
4
5(setq gc-cons-threshold (* 128 1024 1024))
6
7(setq load-prefer-newer t)
8
9(setq user-emacs-directory
10 (expand-file-name ".." (file-name-directory (file-truename load-file-name))))
11
12(load (expand-file-name "init.el" user-emacs-directory))
13
diff --git a/early-init.el b/early-init.el
new file mode 100644
index 0000000..097923d
--- /dev/null
+++ b/early-init.el
@@ -0,0 +1,17 @@
1;; -*- lexical-binding: t -*-
2
3;; Shutdown GC during initialisation
4;; It will be replaced by GCMH :)
5(setq gc-cons-threshold most-positive-fixnum)
6
7;; Disable package.el in favour of straight.el
8(setq package-enable-at-startup nil)
9
10;; UTF-8 duh
11(set-language-environment "UTF-8")
12(setq selection-coding-system 'utf-8
13 default-input-method nil)
14
15(setq user-emacs-directory (file-name-directory load-file-name))
16
17(defconst loaded-early-init t)
diff --git a/init.el b/init.el
new file mode 100644
index 0000000..aac823d
--- /dev/null
+++ b/init.el
@@ -0,0 +1,815 @@
1;; -*- lexical-binding: t -*-
2;; Copyright © 2018-2024 Uko Koknevics
3
4;; Make sure early-init has been loaded.
5(unless (boundp 'loaded-early-init)
6 (load (expand-file-name "early-init" (file-name-directory load-file-name)) nil t))
7
8(when (version< emacs-version "29.1")
9 (error "Using %s. Minimum supported version is 29.1."
10 (emacs-version)))
11
12(setq-default user-full-name "Uko Kokņevičs"
13 user-email-address "perkontevs@gmail.com")
14
15(defconst +linux+ (eq system-type 'gnu/linux))
16(defconst +mac+ (eq system-type 'darwin))
17(defconst +bsd+ (or +mac+ (eq system-type 'berkeley-unix)))
18(defconst +windows+ (memq system-type '(cygwin windows-nt ms-dos)))
19
20(defconst base-dir user-emacs-directory)
21(defconst local-dir (expand-file-name "local" base-dir))
22(defconst local-config-dir (expand-file-name "config" local-dir))
23(defconst tmp-dir (expand-file-name "tmp" local-dir))
24(defconst shared-dir (expand-file-name "shared" base-dir))
25
26(setq auto-save-file-name-transforms `((".*" ,tmp-dir t))
27 backup-directory-alist `((".*" . ,tmp-dir))
28 custom-file (expand-file-name "custom.el" shared-dir)
29 shared-game-score-directory (expand-file-name "shared-game-score" shared-dir))
30
31(defun $adv-write-to-sane-paths (fn &rest args)
32 "Write 3rd party files to `local-config-dir` to keep `user-emacs-directory` clean."
33 (let ((user-emacs-directory local-config-dir)
34 (user-init-file custom-file))
35 (apply fn args)))
36
37(advice-add #'enable-command :around #'$adv-write-to-sane-paths)
38(advice-add #'disable-command :around #'$adv-write-to-sane-paths)
39(advice-add #'locate-user-emacs-file :around #'$adv-write-to-sane-paths)
40
41(when (file-exists-p custom-file)
42 (load custom-file))
43
44;; Improve Emacs security somewhat
45(setq gnutls-min-prime-bits 3072
46 gnutls-verify-error (and (fboundp 'gnutls-available-p)
47 (gnutls-available-p)
48 (not (getenv-internal "INSECURE")))
49 tls-checktrust gnutls-verify-error
50 tls-program '("openssl s_client -connect %h:%p -CAfile %t -nbio -no_ssl3 -no_tls1 -no_tls1_1 -ign_eof"
51 "gnutls-cli -p %p --dh-bits=3072 --ocsp --x509cafile=%t --strict-tofu --priority='SECURE128:+SECURE192:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3' %h"
52 "gnutls-cli -p %p %h"))
53
54(setq gnutls-algorithm-priority
55 (when (boundp 'libgnutls-version)
56 (concat "SECURE128:+SECURE192:-VERS-ALL"
57 (if (and (not +windows+)
58 (>= libgnutls-version 30605))
59 ":+VERS-TLS1.3"
60 ":+VERS-TLS1.2"))))
61
62;; Make sure authinfo is GPG'd
63(setq auth-sources (list (expand-file-name "authinfo.gpg" local-config-dir)
64 "~/.authinfo.gpp"))
65
66;; Force case sensitivity (if case insensitive, `auto-mode-alist` will be scanned twice).
67(setq auto-mode-case-fold nil)
68
69;; Don't draw stuff in other windows.
70(setq-default cursor-in-non-selected-windows nil)
71(setq highlight-nonselected-windows nil)
72
73;; Faster scrolling
74(setq fast-but-imprecise-scrolling t)
75
76;; Don't ping random stuff
77(setq ffap-machine-p-known 'reject)
78
79;; Inhibit frame resizing
80(setq frame-inhibit-implied-resize t)
81
82(setq inhibit-compacting-font-caches t)
83
84(setq read-process-output-max (* 64 1024))
85
86;; Don't fontify if stuck on reading input anyways
87(setq redisplay-skip-fontification-on-input t)
88
89(when +windows+
90 (setq w32-get-true-file-attributes nil
91 w32-pipe-read-delay 0
92 w32-pipe-buffer-size read-process-output-max))
93
94(setq inhibit-startup-screen t
95 inhibit-startup-echo-area-message user-login-name
96 inhibit-default-init t
97 initial-major-mode 'fundamental-mode
98 initial-scratch-message nil)
99
100;; Install straight.el
101(defvar bootstrap-version)
102(let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
103 (bootstrap-version 6))
104 (unless (file-exists-p bootstrap-file)
105 (message "This might take a long time...")
106 (with-current-buffer (url-retrieve-synchronously
107 "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
108 'inhibit-cookies)
109 (goto-char (point-max))
110 (eval-print-last-sexp)))
111 (load bootstrap-file))
112
113;; I don't want these
114(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
115(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
116
117;; Helper functions
118(defmacro defsetter (name &rest emacs-names)
119 (let ((name (intern (concat "set-" (symbol-name name)))))
120 `(defun ,name (value &optional default)
121 (if default
122 (progn
123 ,@(mapcar (lambda (name) `(setq-default ,name value)) emacs-names))
124 ,@(mapcar (lambda (name) `(setq ,name value)) emacs-names)))))
125
126(defsetter fill-width fill-column)
127(defsetter tab-usage indent-tabs-mode)
128(defsetter tab-width c-basic-offset nasm-offset standard-indent tab-width)
129
130(set-face-attribute 'default nil :height 130)
131
132(set-fill-width 120 t)
133(set-tab-usage nil t)
134(set-tab-width 4 t)
135
136(add-hook 'before-save-hook #'delete-trailing-whitespace)
137
138;; use-package
139(use-package use-package
140 :custom
141 (use-package-always-defer t))
142
143;; HIC SVNT DRACONES
144
145(use-package ace-window
146 :straight t
147 :demand t
148 :bind (([remap other-window] . ace-window)
149 ("C-x o" . ace-window)))
150
151(use-package auto-compile
152 :straight t
153 :demand t
154 :config
155 (auto-compile-on-load-mode)
156 (auto-compile-on-save-mode))
157
158(use-package battery
159 :straight '(battery :type built-in)
160 :demand t
161 :config
162 (display-battery-mode))
163
164(use-package c-ts-mode
165 :after treesit
166 :straight '(c-ts-mode :type built-in)
167 :mode ("\\.c\\'"
168 ("\\.cpp\\'" . c++-ts-mode))
169 :hook (c-ts-base-mode . (lambda () (set-tab-usage t) (set-tab-width 8)))
170 :custom
171 (c-ts-mode-indent-offset 8)
172 (c-ts-mode-indent-style (lambda ()
173 `(((node-is ")") parent-bol 0)
174 ((parent-is "argument_list") parent-bol 8)
175 ((parent-is "parameter_list") parent-bol 8)
176 ,@(alist-get 'linux (c-ts-mode--indent-styles 'c))))))
177
178(use-package centaur-tabs
179 :straight t
180 :demand t
181 :hook ((dashboard-mode . (lambda () (centaur-tabs-local-mode +1))))
182 :bind (("C-x <C-right>" . centaur-tabs-forward)
183 ("C-x <right>" . centaur-tabs-forward)
184 ("C-x <C-left>" . centaur-tabs-backward)
185 ("C-x <left>" . centaur-tabs-backward))
186 :custom
187 (centaur-tabs-style "alternate")
188 (centaur-tabs-height 35)
189 (centaur-tabs-set-icons t)
190 (centaur-tabs-gray-out-icons 'buffer)
191 (centaur-tabs-icon-type 'nerd-icons)
192 (centaur-tabs-set-bar 'over)
193 (centaur-tabs-set-close-button nil)
194 (centaur-tabs-set-modified-marker t)
195 (centaur-tabs-modified-marker "●")
196 (centaur-tabs-cycle-scope 'tabs)
197 :config
198 (centaur-tabs-mode +1))
199
200(use-package cmake-ts-mode
201 :after treesit
202 :straight '(cmake-ts-mode :type built-in)
203 :mode ("CMakeLists\\.txt\\'"
204 "\\.cmake\\'"))
205
206(use-package company-mlton
207 :straight '(company-mlton :host github
208 :repo "MatthewFluet/company-mlton")
209 :hook (sml-mode . company-mlton-init))
210
211(use-package company
212 :straight t
213 :demand t
214 :custom
215 (company-format-margin-function #'company-text-icons-margin)
216 (company-text-face-extra-attributes '(:weight bold))
217 (company-text-icons-add-background t)
218 (company-tooltip-flip-when-above nil)
219 (company-tooltip-limit 6)
220 (company-tooltip-minimum 6)
221 (company-tooltip-offset-display 'lines)
222 :config
223 (global-company-mode +1))
224
225(use-package compile
226 :straight '(compile :type built-in)
227 :bind (("C-c k" . compile)))
228
229(use-package copyright
230 :straight '(copyright :type built-in)
231 :hook (before-save . (lambda ()
232 (save-mark-and-excursion
233 (copyright-update)
234 (copyright-fix-years))))
235 :custom
236 (copyright-names-regexp "Eris\\|Ukko\\|Uko\\|Free Software")
237 (copyright-year-ranges t))
238
239(use-package counsel
240 :straight t
241 :demand t
242 :config
243 (counsel-mode +1))
244
245(use-package csharp-ts-mode
246 :after treesit
247 :straight '(csharp-ts-mode :type built-in)
248 :mode "\\.cs\\'")
249
250(use-package css-ts-mode
251 :after treesit
252 :straight '(css-ts-mode :type built-in)
253 :mode "\\.css\\'")
254
255(use-package dart-mode
256 :straight t
257 :mode "\\.dart\\'")
258
259(use-package dashboard
260 :straight t
261 :demand t
262 :hook (after-init . dashboard-setup-startup-hook)
263 :custom
264 (dashboard-center-content nil)
265 (dashboard-startup-banner (expand-file-name "logo.png" user-emacs-directory))
266 (dashboard-items '((projects . 5) (recents . 5) (bookmarks . 5)))
267 (dashboard-projects-backend 'project-el)
268 (dashboard-set-heading-icons t)
269 (dashboard-set-file-icons t)
270 (dashboard-set-init-info t))
271
272(use-package display-fill-column-indicator
273 :straight '(display-fill-column-indicator :type built-in)
274 :demand t
275 :hook (dashboard-mode . (lambda () (display-fill-column-indicator-mode -1)))
276 :config
277 (global-display-fill-column-indicator-mode +1))
278
279(use-package display-line-numbers
280 :straight '(display-line-numbers :type built-in)
281 :demand t
282 :hook (help-mode . (lambda () (display-line-numbers-mode -1)))
283 :config
284 (global-display-line-numbers-mode +1))
285
286(use-package dockerfile-ts-mode
287 :after treesit
288 :straight '(dockerfile-ts-mode :type built-in)
289 :mode "Dockerfile\\'")
290
291(use-package doom-modeline
292 :straight t
293 :demand t
294 :custom
295 (doom-modeline-icon t)
296 (doom-modeline-height 25)
297 :config
298 (doom-modeline-mode +1))
299
300(use-package doom-themes
301 :straight t
302 :demand t
303 :custom
304 (doom-themes-enable-bold t)
305 (doom-themes-enable-italic t)
306 :config
307 (load-theme 'doom-opera t)
308
309 (use-package doom-themes-ext-org
310 :after org
311 :straight doom-themes
312 :demand t
313 :config
314 (doom-themes-org-config))
315
316 (use-package doom-themes-ext-visual-bell
317 :straight doom-themes
318 :demand t
319 :config
320 (doom-themes-visual-bell-config)))
321
322(use-package ebuild-mode
323 :straight t
324 :mode ("\\.ebuild\\'"
325 "\\.eclass\\'"))
326
327(use-package editorconfig
328 :straight t
329 :demand t
330 :config
331 (editorconfig-mode +1))
332
333(use-package eglot
334 :straight '(eglot :type built-in)
335 :hook ((gdscript-mode go-ts-mode) . eglot-ensure)
336 :custom (eglot-ignored-server-capabilities . '(:documentFormattingProvider
337 :documentRangeFormattingProvider
338 :documentOnTypeFormattingProvider)))
339
340(use-package elixir-mode
341 :straight t
342 :mode "\\.exs?\\'"
343 :hook (elixir-mode . (lambda () (add-hook 'before-save-hook #'elixir-format nil t))))
344
345(use-package emojify
346 :straight t
347 :demand t
348 :config
349 (global-emojify-mode +1))
350
351(use-package files
352 :straight '(files :type built-in)
353 :demand t
354 :custom
355 (major-mode-remap-alist '((c-mode . c-ts-mode)
356 (c-or-c++-mode . c-or-c++-ts-mode)
357 (c++-mode . c++-ts-mode)
358 (cmake-mode . cmake-ts-mode)
359 (csharp-mode . csharp-ts-mode)
360 (css-mode . css-ts-mode)
361 (dockerfile-mode . dockerfile-ts-mode)
362 (go-mode . go-ts-mode)
363 (go-mod-mode . go-mod-ts-mode)
364 (html-mode . mhtml-mode)
365 (java-mode . java-ts-mode)
366 (js-mode . js-ts-mode)
367 (json-mode . json-ts-mode)
368 (python-mode . python-ts-mode)
369 (ruby-mode . ruby-ts-mode)
370 (rust-mode . rust-ts-mode)
371 (yaml-mode . yaml-ts-mode)
372 (toml-mode . toml-ts-mode)
373 (tsx-mode . tsx-ts-mode)
374 (typescript-mode . typescript-ts-mode))))
375
376(use-package gcmh
377 :straight t
378 :demand t
379 :custom
380 (gcmh-idle-delay 'auto)
381 (gcmh-auto-idle-delay-factor 10)
382 (gcmh-high-cons-threshold 16777216)
383 :config
384 (gcmh-mode +1))
385
386(use-package gdscript-mode
387 :straight t
388 :mode "\\.gd\\'")
389
390(use-package git-gutter
391 :straight t
392 :demand t
393 :config
394 (global-git-gutter-mode +1))
395
396(use-package go-ts-mode
397 :after treesit
398 :straight '(go-ts-mode :type built-in)
399 :mode "\\.go\\'"
400 :hook (go-ts-mode . (lambda () (add-hook 'before-save-hook #'gofmt-before-save nil t))))
401
402(use-package haskell-mode
403 :straight t
404 :mode "\\.hs\\'")
405
406(use-package hl-line
407 :straight '(hl-line :type built-in)
408 :demand t
409 :config
410 (global-hl-line-mode +1))
411
412(use-package hl-todo
413 :straight t
414 :demand t
415 :config
416 (global-hl-todo-mode +1))
417
418(use-package ibuffer
419 :straight '(ibuffer :type built-in)
420 :demand t
421 :bind (("C-x C-b" . ibuffer)
422 ([remap list-buffers] . ibuffer)))
423
424(use-package ivy
425 :after (counsel swiper)
426 :straight t
427 :demand t
428 :bind (("C-c r" . ivy-resume)
429 ("C-c v" . ivy-push-view)
430 ("C-c V" . ivy-pop-view))
431 :custom
432 (ivy-use-virtual-buffers t)
433 (ivy-count-format "(%d/%d) ")
434 :config
435 (ivy-mode +1))
436
437(use-package java-ts-mode
438 :after treesit
439 :straight '(java-ts-mode :type built-in)
440 :mode "\\.java\\'")
441
442(use-package js
443 :after treesit
444 :straight '(js :type built-in)
445 :mode ("\\.js\\'" . js-ts-mode))
446
447(use-package json-ts-mode
448 :after treesit
449 :straight '(json-ts-mode :type built-in)
450 :mode "\\.json\\'")
451
452(use-package lua-mode
453 :straight t
454 :custom
455 (lua-indent-level 4)
456 :mode "\\.lua\\'")
457
458(use-package magit
459 ;; TODO: Do some proper setup
460 :straight t
461 :demand t)
462
463(use-package make-mode
464 :straight '(make-mode :type built-in)
465 :mode ("Makefile\\'" . makefile-gmake-mode))
466
467(use-package markdown-mode
468 :straight t
469 :mode ("\\.md\\'" . gfm-mode))
470
471(use-package nasm-mode
472 :straight t
473 :mode ("\\.asm\\'"
474 "\\.inc\\'")
475 :hook (nasm-mode . (lambda () (set-tab-width 4))))
476
477(use-package nerd-icons
478 :straight t
479 :commands (nerd-icons-install-fonts))
480
481(use-package nix-mode
482 :straight t
483 :mode "\\.nix\\'")
484
485(use-package nxml-mode
486 :straight '(nxml-mode :type built-in)
487 :mode ("\\.xml\\'" "\\.svg\\'"))
488
489(use-package org
490 :straight '(org :type built-in)
491 :bind (("C-c l" . org-store-link)
492 ("C-c a" . org-agenda))
493 :mode ("\\.org\\'" . org-mode)
494 :init
495 (use-package htmlize
496 :straight t
497 :demand t)
498 :custom
499 (org-log-done t))
500
501(use-package php-mode
502 :straight t
503 :mode "\\.php\\'")
504
505(use-package pico8-mode
506 :straight '(pico8-mode :host github
507 :repo "Kaali/pico8-mode")
508 :mode "\\.p8\\'")
509
510(use-package prog-mode
511 :straight '(prog-mode :type built-in)
512 :demand t
513 :preface
514 (defun prepend-prettify (items)
515 (setq prettify-symbols-alist (append items prettify-symbols-alist))
516 (prettify-symbols-mode -1)
517 (prettify-symbols-mode +1))
518 (defun prettify-prog-mode ()
519 (prepend-prettify '((">=" . ?≥)
520 ("<=" . ?≤))))
521 (defun prettify-cc-modes ()
522 (prepend-prettify '(("->" . ?→))))
523 (defun prettify-lisp-modes ()
524 (prepend-prettify '(("lambda" . ?λ)
525 ("lambda*" . (?λ (cr . Bc) ?⋆)))))
526 :hook (c-mode-common . prettify-cc-modes)
527 :hook (c-ts-base-mode . prettify-cc-modes)
528 :hook (emacs-lisp-mode . prettify-lisp-modes)
529 :hook (lisp-mode . prettify-lisp-modes)
530 :hook (prog-mode . prettify-prog-mode)
531 :hook (scheme-mode . prettify-lisp-modes))
532
533;; TODO: See about porting this to project.el:
534;; (define-key map (kbd "a") #'projectile-find-other-file)
535;; (define-key map (kbd "E") #'projectile-edit-dir-locals)
536;; (define-key map (kbd "g") #'projectile-find-file-dwim)
537;; (define-key map (kbd "i") #'projectile-invalidate-cache)
538;; (define-key map (kbd "I") #'projectile-ibuffer)
539;; (define-key map (kbd "j") #'projectile-find-tag)
540;; (define-key map (kbd "l") #'projectile-find-file-in-directory)
541;; (define-key map (kbd "m") #'projectile-commander)
542;; (define-key map (kbd "o") #'projectile-multi-occur)
543;; (define-key map (kbd "q") #'projectile-switch-open-project)
544;; (define-key map (kbd "R") #'projectile-regenerate-tags)
545
546;; (define-key map (kbd "s r") #'projectile-ripgrep)
547;; (define-key map (kbd "s s") #'projectile-ag)
548
549;; (define-key map (kbd "S") #'projectile-save-project-buffers)
550;; (define-key map (kbd "t") #'projectile-toggle-between-implementation-and-test)
551;; (define-key map (kbd "T") #'projectile-find-test-file)
552;; ;; project lifecycle external commands
553;; ;; TODO: Bundle those under some prefix key
554;; (define-key map (kbd "C") #'projectile-configure-project)
555;; (define-key map (kbd "K") #'projectile-package-project)
556;; (define-key map (kbd "L") #'projectile-install-project)
557;; (define-key map (kbd "P") #'projectile-test-project)
558;; (define-key map (kbd "u") #'projectile-run-project)
559
560;; ;; integration with utilities
561;; (define-key map (kbd "x i") #'projectile-run-ielm)
562;; (define-key map (kbd "x t") #'projectile-run-term)
563;; (define-key map (kbd "x g") #'projectile-run-gdb)
564;; (define-key map (kbd "x v") #'projectile-run-vterm)
565;; (define-key map (kbd "x 4 v") #'projectile-run-vterm-other-window)
566
567;; ;; misc
568;; (define-key map (kbd "z") #'projectile-cache-current-file)
569;; (define-key map (kbd "<left>") #'projectile-previous-project-buffer)
570;; (define-key map (kbd "<right>") #'projectile-next-project-buffer)
571;; (define-key map (kbd "ESC") #'projectile-project-buffers-other-buffer)
572
573(use-package project
574 :straight '(project :type built-in)
575 :demand t
576 :init
577 (cl-defun arkta/project-completing-read (prompt choices &key initial-input action (project (project-current t)))
578 "Present a project tailored PROMPT with CHOICES."
579 (require 'ivy)
580 (let ((prompt (arkta/project-prepend-project-name prompt project)))
581 (ivy-read prompt choices
582 :initial-input initial-input
583 :action action
584 :caller 'arkta/project-completing-read)))
585
586 (defun arkta/project-expand-root (name &optional project)
587 "Expand NAME to project root."
588 (let (project (or project (project-current t)))
589 (expand-file-name name (project-root project))))
590
591 (defun arkta/project-find-references (&optional symbol)
592 "Find all references to SYMBOL in the current project.
593
594A thin wrapper around `xref-references-in-directory'."
595 (interactive)
596 (require 'xref)
597 (let ((project-root (project-root (project-current t)))
598 (symbol (or symbol
599 (read-from-minibuffer "Lookup in project: " (arkta/symbol-at-point)))))
600 (xref-show-xrefs (xref-references-in-directory symbol project-root) nil)))
601
602 (defun arkta/project-magit-status ()
603 (interactive)
604 (magit-status (project-root (project-current t))))
605
606 (defun arkta/project-prepend-project-name (string &optional project)
607 "Prepend the current project's name to STRING."
608 (let ((project (or project (project-current t))))
609 (format "[%s] %s" (project-name project) string)))
610
611 (defun arkta/project-recentf ()
612 "Show a list of recently visited files in a project."
613 (interactive)
614 (let ((project (project-current t)))
615 (find-file (arkta/project-expand-root
616 (arkta/project-completing-read
617 "Recently visited files: "
618 (arkta/project-recentf-files project)
619 :project project)
620 project))))
621
622 (defun arkta/project-recentf-files (&optional project)
623 "Return a list of recently visited files in a project."
624 (require 'recentf)
625 (let* ((project (or project (project-current t)))
626 (project-root (expand-file-name (project-root project))))
627 (mapcar
628 (lambda (f) (file-relative-name f project-root))
629 (cl-remove-if-not
630 (lambda (f) (string-prefix-p project-root (expand-file-name f)))
631 recentf-list))))
632
633 (defun arkta/symbol-at-point ()
634 "Get the symbol at point and strip its properties."
635 (substring-no-properties (or (thing-at-point 'symbol) "")))
636
637 (defvar-keymap arkta/project-prefix-map
638 :parent project-prefix-map
639 "C-b" 'project-list-buffers
640
641 "!" 'project-shell-command
642 "&" 'project-async-shell-command
643
644 "4" 'project-other-window-command
645 "5" 'project-other-frame-command
646
647 "D" 'project-dired
648 "F" 'project-or-external-find-file
649 "V" 'project-vc-dir
650
651 "b" 'project-switch-to-buffer
652 "c" 'project-compile
653 "d" 'project-find-dir
654 "e" 'arkta/project-recentf
655 "f" 'project-find-file
656 "k" 'project-kill-buffers
657 "p" 'project-switch-project
658 "r" 'project-query-replace-regexp
659 "v" 'arkta/project-magit-status
660
661 "M-x" 'project-execute-extended-command
662
663 "s g" 'project-find-regexp
664 "s r" 'project-find-regexp
665 "s x" 'arkta/project-find-references
666
667 "x e" 'project-eshell
668 "x s" 'project-shell)
669 (fset 'arkta/project-prefix-map arkta/project-prefix-map)
670 :bind (("C-c p" . arkta/project-prefix-map)))
671
672(use-package prolog
673 :straight '(prolog :type built-in)
674 :mode ("\\.pl\\'" . prolog-mode))
675
676(use-package python
677 :after treesit
678 :straight '(python :type built-in)
679 :mode ("\\.py\\'" . python-ts-mode))
680
681(use-package rainbow-delimiters
682 :straight t
683 :hook ((emacs-lisp-mode lisp-mode scheme-mode) . rainbow-delimiters-mode))
684
685(use-package rainbow-mode
686 :straight t
687 :hook (prog-mode . (lambda () (rainbow-mode +1))))
688
689(use-package ripgrep
690 :straight t
691 :commands (ripgrep-regexp))
692
693(use-package ruby-ts-mode
694 :after treesit
695 :straight '(ruby-ts-mode :type built-in)
696 :mode "\\.rb\\'")
697
698(use-package rust-ts-mode
699 :after treesit
700 :straight '(rust-ts-mode :type built-in)
701 :mode "\\.rs\\'")
702
703(use-package scala-mode
704 :straight t
705 :mode "\\.scala\\'")
706
707(use-package scheme
708 :straight '(scheme :type built-in)
709 :commands scheme-mode
710 :mode ("\\.scm\\'" . scheme-mode)
711 :config
712 (put 'module 'scheme-indent-function 2))
713
714(use-package simple
715 :straight (simple :type built-in)
716 :hook (text-mode . turn-on-auto-fill)
717 :custom
718 (backward-delete-char-untabify-method nil))
719
720(use-package slime
721 :straight t
722 :commands slime
723 :custom
724 (inferior-lisp-program (executable-find "sbcl")))
725
726(use-package smalltalk-mode
727 :straight t
728 :mode "\\.st\\'")
729
730(use-package sml-mode
731 :straight t
732 :mode "\\.sml\\'")
733
734(use-package solaire-mode
735 :straight t
736 :demand t
737 :config
738 (solaire-global-mode +1))
739
740(use-package swiper
741 :straight t
742 :bind (([remap isearch-forward] . swiper-isearch)
743 ([remap isearch-backward] . swiper-isearch-backward)
744 ("C-s" . swiper-isearch)
745 ("C-r" . swiper-isearch-backward)))
746
747(use-package time
748 :straight '(time :type built-in)
749 :demand t
750 :custom
751 (display-time-default-load-average nil)
752 :config
753 (display-time-mode +1))
754
755(use-package toml-ts-mode
756 :after treesit
757 :straight '(toml-ts-mode :type built-in)
758 :mode "\\.toml\\'")
759
760(use-package treemacs
761 :straight t
762 :commands (treemacs treemacs-select-window)
763 :custom
764 (treemacs-select-when-already-in-treemacs 'next-or-back)
765 :bind (("C-c SPC" . treemacs-select-window)
766 ("C-c C-SPC" . treemacs-select-window)))
767
768(use-package treesit
769 :straight '(treesit :type built-in)
770 :demand t
771 :config
772 (setq treesit-extra-load-path
773 (list (expand-file-name "tree-sitter" local-config-dir)))
774 (setq treesit-language-source-alist
775 '((c "https://github.com/tree-sitter/tree-sitter-c.git")
776 (cmake "https://github.com/uyha/tree-sitter-cmake.git")
777 (cpp "https://github.com/tree-sitter/tree-sitter-cpp.git")
778 (c-sharp "https://github.com/tree-sitter/tree-sitter-c-sharp.git")
779 (css "https://github.com/tree-sitter/tree-sitter-css.git")
780 (dockerfile "https://github.com/camdencheek/tree-sitter-dockerfile.git")
781 (go "https://github.com/tree-sitter/tree-sitter-go.git")
782 (gomod "https://github.com/camdencheek/tree-sitter-go-mod.git")
783 (java "https://github.com/tree-sitter/tree-sitter-java.git")
784 (javascript "https://github.com/tree-sitter/tree-sitter-javascript.git")
785 (json "https://github.com/tree-sitter/tree-sitter-json.git")
786 (python "https://github.com/tree-sitter/tree-sitter-python.git")
787 (ruby "https://github.com/tree-sitter/tree-sitter-ruby.git")
788 (rust "https://github.com/tree-sitter/tree-sitter-rust.git")
789 (toml "https://github.com/ikatyang/tree-sitter-toml.git")
790 (tsx "https://github.com/tree-sitter/tree-sitter-typescript.git" nil "tsx/src")
791 (typescript "https://github.com/tree-sitter/tree-sitter-typescript.git" nil "typescript/src")
792 (yaml "https://github.com/ikatyang/tree-sitter-yaml.git")))
793 (mapc (lambda (spec)
794 (let ((name (car spec)))
795 (unless (treesit-language-available-p name)
796 (treesit-install-language-grammar name))))
797 treesit-language-source-alist))
798
799(use-package typescript-ts-mode
800 :after treesit
801 :straight '(typescript-ts-mode :type built-in)
802 :mode "\\.ts\\'")
803
804(use-package typst-mode
805 :straight t
806 :mode "\\.typ\\'")
807
808(use-package zig-mode
809 :straight t
810 :mode "\\.zig\\'")
811
812(use-package yaml-ts-mode
813 :after treesit
814 :straight '(yaml-ts-mode :type built-in)
815 :mode "\\.ya?ml\\'")
diff --git a/logo.png b/logo.png
new file mode 100644
index 0000000..20cdb36
--- /dev/null
+++ b/logo.png
Binary files differ
diff --git a/shared/custom.el b/shared/custom.el
new file mode 100644
index 0000000..42627c3
--- /dev/null
+++ b/shared/custom.el
@@ -0,0 +1,14 @@
1(custom-set-variables
2 ;; custom-set-variables was added by Custom.
3 ;; If you edit it by hand, you could mess it up, so be careful.
4 ;; Your init file should contain only one such instance.
5 ;; If there is more than one, they won't work right.
6 '(custom-safe-themes
7 '("7964b513f8a2bb14803e717e0ac0123f100fb92160dcf4a467f530868ebaae3e" default)))
8(custom-set-faces
9 ;; custom-set-faces was added by Custom.
10 ;; If you edit it by hand, you could mess it up, so be careful.
11 ;; Your init file should contain only one such instance.
12 ;; If there is more than one, they won't work right.
13 )
14(put 'upcase-region 'disabled nil)