.
This commit is contained in:
parent
4c22c9c414
commit
fdfda0d8aa
6 changed files with 376 additions and 75 deletions
|
@ -13,6 +13,14 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
text = builtins.readFile ./templates;
|
text = builtins.readFile ./templates;
|
||||||
};
|
};
|
||||||
|
home.file.".emacs.d/lib/smartparens-emacs-lisp.el" = {
|
||||||
|
enable = true;
|
||||||
|
text = builtins.readFile ./lib/smartparens-emacs-lisp.el;
|
||||||
|
};
|
||||||
|
home.file.".emacs.d/lib/smartparens-scheme.el" = {
|
||||||
|
enable = true;
|
||||||
|
text = builtins.readFile ./lib/smartparens-scheme.el;
|
||||||
|
};
|
||||||
programs.emacs = {
|
programs.emacs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.emacs29-gtk3;
|
package = pkgs.emacs29-gtk3;
|
||||||
|
|
208
emacs/init.el
208
emacs/init.el
|
@ -28,10 +28,12 @@
|
||||||
(require 'cl-macs)
|
(require 'cl-macs)
|
||||||
|
|
||||||
;;;; Early Variables
|
;;;; Early Variables
|
||||||
(setq custom-file "~/.emacs.d/custom.el")
|
(setq custom-file "~/.config/emacs/custom.el")
|
||||||
(when (file-exists-p custom-file)
|
(when (file-exists-p custom-file)
|
||||||
(load custom-file))
|
(load custom-file))
|
||||||
|
|
||||||
|
(defvar init-dir (file-name-directory (or load-file-name (buffer-file-name))))
|
||||||
|
|
||||||
;;;; Personal Information Setup
|
;;;; Personal Information Setup
|
||||||
(setq user-full-name "Daniel Ziltener"
|
(setq user-full-name "Daniel Ziltener"
|
||||||
user-mail-address "dziltener@lyrion.ch")
|
user-mail-address "dziltener@lyrion.ch")
|
||||||
|
@ -53,12 +55,15 @@
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(eval-print-last-sexp)))
|
(eval-print-last-sexp)))
|
||||||
(load bootstrap-file nil 'nomessage))
|
(load bootstrap-file nil 'nomessage))
|
||||||
;;(setq straight-use-package-by-default t)
|
(setq straight-use-package-by-default t)
|
||||||
|
|
||||||
;;;; Package Management Configuration
|
;;;; Package Management Configuration
|
||||||
;; See: https://github.com/radian-software/el-patch
|
;; See: https://github.com/radian-software/el-patch
|
||||||
(use-package el-patch)
|
(use-package el-patch)
|
||||||
|
|
||||||
|
;;;;; Guix Management
|
||||||
|
(use-package guix)
|
||||||
|
|
||||||
;;;; Helper Functions
|
;;;; Helper Functions
|
||||||
(cl-defun conditional-keybind
|
(cl-defun conditional-keybind
|
||||||
(filter-fn target-fn
|
(filter-fn target-fn
|
||||||
|
@ -92,25 +97,27 @@
|
||||||
(tab-always-indent 'complete)
|
(tab-always-indent 'complete)
|
||||||
(tool-bar-mode nil)
|
(tool-bar-mode nil)
|
||||||
:custom-face
|
:custom-face
|
||||||
(default ((t (:weight bold :height 113 :width normal :family "VictorMono Nerd Font"))))
|
;;(default ((t (:weight bold :height 113 :width normal :family "VictorMono Nerd Font"))))
|
||||||
|
(default ((t (:weight regular :height 105 :width normal :family "MonaspiceXe Nerd Font Mono"))))
|
||||||
:hook
|
:hook
|
||||||
(minibuffer-setup . cursor-intangible-mode)
|
(minibuffer-setup . cursor-intangible-mode)
|
||||||
:config
|
:config
|
||||||
(advice-add 'risky-local-variable-p :override #'ignore)
|
(advice-add 'risky-local-variable-p :override #'ignore)
|
||||||
(global-display-fill-column-indicator-mode t))
|
(global-display-fill-column-indicator-mode t)
|
||||||
|
(pixel-scroll-precision-mode 1))
|
||||||
|
|
||||||
;;;; Org Mode
|
;;;; Org Mode
|
||||||
(use-package org
|
(use-package org
|
||||||
:ensure t
|
:ensure t
|
||||||
|
:custom
|
||||||
|
(org-babel-load-languages '((emacs-lisp . t)
|
||||||
|
(scheme . t)))
|
||||||
:hook
|
:hook
|
||||||
(org-mode . org-indent-mode)
|
(org-mode . org-indent-mode)
|
||||||
(org-src-mode . hack-local-variables)
|
(org-src-mode . hack-local-variables)
|
||||||
(org-mode . auto-fill-mode)
|
(org-mode . visual-line-mode)
|
||||||
:config
|
:config
|
||||||
(setq org-directory "~/org")
|
(setq org-directory "~/org")
|
||||||
(org-babel-do-load-languages
|
|
||||||
'org-babel-load-languages
|
|
||||||
'((scheme . t)))
|
|
||||||
(add-to-list 'org-modules 'collector))
|
(add-to-list 'org-modules 'collector))
|
||||||
|
|
||||||
(use-package org-roam
|
(use-package org-roam
|
||||||
|
@ -118,7 +125,7 @@
|
||||||
:custom
|
:custom
|
||||||
(org-roam-directory "~/org/roam")
|
(org-roam-directory "~/org/roam")
|
||||||
:config
|
:config
|
||||||
(progn (org-roam-db-autosync-mode)))
|
(org-roam-db-autosync-mode))
|
||||||
|
|
||||||
(use-package consult-notes
|
(use-package consult-notes
|
||||||
:config
|
:config
|
||||||
|
@ -162,21 +169,40 @@
|
||||||
;;(load-theme 'catppuccin)
|
;;(load-theme 'catppuccin)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(use-package unicode-fonts
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(unicode-fonts-setup))
|
||||||
|
|
||||||
|
(use-package ligature
|
||||||
|
:config
|
||||||
|
(ligature-set-ligatures
|
||||||
|
't
|
||||||
|
'( ;; SS01
|
||||||
|
"==" "===" "=/=" "!=" "!==" "/=" "/==" "~~" "=~" "!~"
|
||||||
|
;; SS02
|
||||||
|
">=" "<="
|
||||||
|
;; SS03
|
||||||
|
"->" "<-" "=>" "<!--" "-->" "<~" "<~~" "~>" "~~>" "<~>"
|
||||||
|
;; SS04
|
||||||
|
"</" "/>" "</>" "/\\" "\\/"
|
||||||
|
;; SS05
|
||||||
|
"|>" "<|"
|
||||||
|
;; SS06
|
||||||
|
"##" "###"
|
||||||
|
;; SS07
|
||||||
|
"***" "/*" "*/" "/*/" "(*" "*)" "(*)"
|
||||||
|
;; SS08
|
||||||
|
".=" ".-" "..<"
|
||||||
|
;; CALT
|
||||||
|
"//" "///" "&&" "!!" "??" "?." "?:" "||" "::" ":::" ";;" ".." "..." "=!=" "#=" ":=" "=:" "=:="
|
||||||
|
":>" ">:" "<:" ":<" "..=" "..-"
|
||||||
|
))
|
||||||
|
(global-ligature-mode t))
|
||||||
|
|
||||||
(set-frame-parameter nil 'alpha-background 80)
|
(set-frame-parameter nil 'alpha-background 80)
|
||||||
(add-to-list 'default-frame-alist '(alpha-background . 80))
|
(add-to-list 'default-frame-alist '(alpha-background . 80))
|
||||||
|
|
||||||
;; (use-package powerline
|
|
||||||
;; :init
|
|
||||||
;; (require 'powerline)
|
|
||||||
;; :config
|
|
||||||
;; (powerline-default-theme))
|
|
||||||
|
|
||||||
;; (use-package airline-themes
|
|
||||||
;; :after powerline
|
|
||||||
;; :init (require 'airline-themes)
|
|
||||||
;; :config
|
|
||||||
;; (load-theme 'airline-badwolf t))
|
|
||||||
|
|
||||||
(use-package lambda-line
|
(use-package lambda-line
|
||||||
:straight (:type git :host github :repo "lambda-emacs/lambda-line")
|
:straight (:type git :host github :repo "lambda-emacs/lambda-line")
|
||||||
:custom
|
:custom
|
||||||
|
@ -223,6 +249,15 @@
|
||||||
;; load preferred theme
|
;; load preferred theme
|
||||||
(load-theme 'lambda-dark))
|
(load-theme 'lambda-dark))
|
||||||
|
|
||||||
|
(use-package visual-fill-column
|
||||||
|
:custom
|
||||||
|
(visual-fill-column-center-text t)
|
||||||
|
(visual-fill-column-enable-sensible-window-split t)
|
||||||
|
:hook visual-line-mode)
|
||||||
|
|
||||||
|
(use-package adaptive-wrap
|
||||||
|
:hook visual-fill-column)
|
||||||
|
|
||||||
;;;; Security
|
;;;; Security
|
||||||
(use-package keychain-environment
|
(use-package keychain-environment
|
||||||
:init
|
:init
|
||||||
|
@ -278,7 +313,15 @@
|
||||||
completion-category-defaults nil
|
completion-category-defaults nil
|
||||||
completion-category-overrides '((file (styles basic partial-completion)))))
|
completion-category-overrides '((file (styles basic partial-completion)))))
|
||||||
|
|
||||||
|
(use-package embark-consult
|
||||||
|
:after (embark consult)
|
||||||
|
:hook
|
||||||
|
(embark-collect-mode . consult-preview-at-point-mode))
|
||||||
|
|
||||||
(use-package consult
|
(use-package consult
|
||||||
|
:config
|
||||||
|
(require 'consult-flymake)
|
||||||
|
(require 'consult-xref)
|
||||||
:bind
|
:bind
|
||||||
(:map evil-normal-state-map
|
(:map evil-normal-state-map
|
||||||
("<leader><SPC>" . 'consult-find)
|
("<leader><SPC>" . 'consult-find)
|
||||||
|
@ -294,11 +337,6 @@
|
||||||
("C-<SPC>" . 'embark-act)
|
("C-<SPC>" . 'embark-act)
|
||||||
("C-M-<return>" . 'embark-bindings))
|
("C-M-<return>" . 'embark-bindings))
|
||||||
|
|
||||||
(use-package embark-consult
|
|
||||||
:after (embark consult)
|
|
||||||
:hook
|
|
||||||
(embark-collect-mode . consult-preview-at-point-mode))
|
|
||||||
|
|
||||||
(use-package wgrep
|
(use-package wgrep
|
||||||
:config
|
:config
|
||||||
(setq wgrep-auto-save-buffer t))
|
(setq wgrep-auto-save-buffer t))
|
||||||
|
@ -332,8 +370,22 @@
|
||||||
|
|
||||||
;;;;; Code Completion
|
;;;;; Code Completion
|
||||||
(use-package cape
|
(use-package cape
|
||||||
|
:preface
|
||||||
|
(defun my/capf ()
|
||||||
|
(setq completion-at-point-functions
|
||||||
|
(list (cape-capf-super
|
||||||
|
#'tempel-complete
|
||||||
|
#'cape-dabbrev
|
||||||
|
#'cape-file
|
||||||
|
#'cape-dict
|
||||||
|
#'cape-line
|
||||||
|
#'cape-emoji
|
||||||
|
#'cape-keyword))))
|
||||||
:config
|
:config
|
||||||
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster))
|
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
|
||||||
|
:hook
|
||||||
|
(org-mode . my/capf)
|
||||||
|
(prog-mode . my/capf))
|
||||||
|
|
||||||
(defun my/corfu-combined-sort (candidates)
|
(defun my/corfu-combined-sort (candidates)
|
||||||
"Sort CANDIDATES using both display-sort-function and corfu-sort-function."
|
"Sort CANDIDATES using both display-sort-function and corfu-sort-function."
|
||||||
|
@ -354,25 +406,16 @@
|
||||||
(corfu-scroll-margin 5)
|
(corfu-scroll-margin 5)
|
||||||
(corfu-quit-no-match 'separator)
|
(corfu-quit-no-match 'separator)
|
||||||
(evil-collection-corfu-key-themes '(tab-n-go))
|
(evil-collection-corfu-key-themes '(tab-n-go))
|
||||||
|
(corfu-popupinfo-delay '(0.1 . 0.5))
|
||||||
:config
|
:config
|
||||||
(setq corfu-sort-override-function #'my/corfu-combined-sort)
|
(setq corfu-sort-override-function #'my/corfu-combined-sort)
|
||||||
|
(add-to-list 'savehist-additional-variables 'corfu-history)
|
||||||
:commands
|
:commands
|
||||||
global-corfu-mode
|
global-corfu-mode
|
||||||
:init
|
:init
|
||||||
(global-corfu-mode))
|
(global-corfu-mode)
|
||||||
|
(corfu-popupinfo-mode 1)
|
||||||
(use-package corfu-history
|
(corfu-history-mode 1))
|
||||||
:config
|
|
||||||
(add-to-list 'savehist-additional-variables 'corfu-history)
|
|
||||||
:hook
|
|
||||||
global-corfu-mode)
|
|
||||||
|
|
||||||
(use-package corfu-popupinfo
|
|
||||||
:after corfu
|
|
||||||
:custom
|
|
||||||
(corfu-popupinfo-delay '(0.1 . 0.5))
|
|
||||||
:hook
|
|
||||||
global-corfu-mode)
|
|
||||||
|
|
||||||
(use-package nerd-icons-corfu
|
(use-package nerd-icons-corfu
|
||||||
:after corfu
|
:after corfu
|
||||||
|
@ -453,6 +496,8 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
clojure-ts-mode
|
clojure-ts-mode
|
||||||
emacs-lisp-mode
|
emacs-lisp-mode
|
||||||
scheme-mode
|
scheme-mode
|
||||||
|
:custom
|
||||||
|
(sp-undo-pairs-separately t)
|
||||||
:config
|
:config
|
||||||
(add-to-list 'sp-clojure-modes 'clojure-ts-mode)
|
(add-to-list 'sp-clojure-modes 'clojure-ts-mode)
|
||||||
(add-to-list 'sp-clojure-modes 'clojurec-ts-mode)
|
(add-to-list 'sp-clojure-modes 'clojurec-ts-mode)
|
||||||
|
@ -460,6 +505,11 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
(add-to-list 'sp-lisp-modes 'clojure-ts-mode)
|
(add-to-list 'sp-lisp-modes 'clojure-ts-mode)
|
||||||
(add-to-list 'sp-lisp-modes 'clojurec-ts-mode)
|
(add-to-list 'sp-lisp-modes 'clojurec-ts-mode)
|
||||||
(add-to-list 'sp-lisp-modes 'clojurescript-ts-mode)
|
(add-to-list 'sp-lisp-modes 'clojurescript-ts-mode)
|
||||||
|
(load-file (concat init-dir "lib/smartparens-emacs-lisp.el"))
|
||||||
|
(load-file (concat init-dir "lib/smartparens-scheme.el"))
|
||||||
|
(require 'smartparens-clojure)
|
||||||
|
(require 'smartparens-emacs-lisp)
|
||||||
|
(require 'smartparens-scheme)
|
||||||
(evil-define-key 'insert smartparens-mode-map
|
(evil-define-key 'insert smartparens-mode-map
|
||||||
(kbd "r") (conditional-keybind #'looking-at-opening-paren
|
(kbd "r") (conditional-keybind #'looking-at-opening-paren
|
||||||
#'sp-raise-sexp)
|
#'sp-raise-sexp)
|
||||||
|
@ -469,6 +519,8 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
#'cc/move-sexp-forward)
|
#'cc/move-sexp-forward)
|
||||||
(kbd "c") (conditional-keybind #'looking-at-opening-paren
|
(kbd "c") (conditional-keybind #'looking-at-opening-paren
|
||||||
#'sp-clone-sexp)
|
#'sp-clone-sexp)
|
||||||
|
(kbd "m") (conditional-keybind #'looking-at-opening-paren
|
||||||
|
#'sp-mark-sexp)
|
||||||
(kbd "DEL") (conditional-keybind #'being-past-closing-paren
|
(kbd "DEL") (conditional-keybind #'being-past-closing-paren
|
||||||
#'sp-backward-delete-sexp
|
#'sp-backward-delete-sexp
|
||||||
#'evil-delete-backward-char-and-join)
|
#'evil-delete-backward-char-and-join)
|
||||||
|
@ -507,19 +559,19 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
(use-package flymake
|
(use-package flymake
|
||||||
:delight '(:eval (cons " " (flymake--mode-line-counters))))
|
:delight '(:eval (cons " " (flymake--mode-line-counters))))
|
||||||
|
|
||||||
(use-package consult-flymake
|
(use-package eglot
|
||||||
:after (consult flymake))
|
:preface
|
||||||
|
|
||||||
(defun my/eglot-capf ()
|
(defun my/eglot-capf ()
|
||||||
(setq-local completion-at-point-functions
|
(setq completion-at-point-functions
|
||||||
(list (cape-super-capf
|
(list (cape-capf-super
|
||||||
#'eglot-completion-at-point
|
#'eglot-completion-at-point
|
||||||
#'tempel-complete
|
#'tempel-complete
|
||||||
#'cape-dabbrev
|
#'cape-dabbrev
|
||||||
#'cape-file
|
#'cape-file
|
||||||
#'cape-dict))))
|
#'cape-dict
|
||||||
|
#'cape-line
|
||||||
(use-package eglot
|
#'cape-emoji
|
||||||
|
#'cape-keyword))))
|
||||||
:custom
|
:custom
|
||||||
(eglot-connect-timeout 90)
|
(eglot-connect-timeout 90)
|
||||||
(eglot-autoshutdown t)
|
(eglot-autoshutdown t)
|
||||||
|
@ -558,7 +610,7 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
(call-interactively #'eglot-format-buffer))
|
(call-interactively #'eglot-format-buffer))
|
||||||
nil 'local)))
|
nil 'local)))
|
||||||
(eglot-managed-mode . eglot-inlay-hints-mode)
|
(eglot-managed-mode . eglot-inlay-hints-mode)
|
||||||
(eglot-managed-mode . #'my/eglot-capf))
|
(eglot-managed-mode . my/eglot-capf))
|
||||||
|
|
||||||
(use-package consult-eglot
|
(use-package consult-eglot
|
||||||
:after (consult eglot))
|
:after (consult eglot))
|
||||||
|
@ -605,13 +657,41 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
(evil-define-key 'normal 'cider-mode-map
|
(evil-define-key 'normal 'cider-mode-map
|
||||||
(kbd "<localleader>ce") #'cider-eval-sexp-at-point))
|
(kbd "<localleader>ce") #'cider-eval-sexp-at-point))
|
||||||
|
|
||||||
;;;;; Chicken Scheme
|
;;;;; Scheme
|
||||||
|
|
||||||
|
(use-package geiser
|
||||||
|
:preface
|
||||||
|
(defun my/geiser-capf ()
|
||||||
|
(setq completion-at-point-functions
|
||||||
|
(append geiser-capf--capfs
|
||||||
|
(list (cape-capf-super
|
||||||
|
#'tempel-complete
|
||||||
|
#'cape-dabbrev
|
||||||
|
#'cape-file
|
||||||
|
#'cape-dict
|
||||||
|
#'cape-line
|
||||||
|
#'cape-emoji
|
||||||
|
#'cape-keyword)))))
|
||||||
|
:custom
|
||||||
|
(geiser-chicken-match-limit 200)
|
||||||
|
:config
|
||||||
|
(defalias 'run-geiser 'geiser)
|
||||||
|
:hook
|
||||||
|
(geiser-mode . my/geiser-capf))
|
||||||
|
|
||||||
|
(use-package paren-face
|
||||||
|
:hook
|
||||||
|
scheme-mode
|
||||||
|
emacs-lisp-mode)
|
||||||
|
|
||||||
|
(use-package highlight-parentheses
|
||||||
|
:hook prog-mode)
|
||||||
|
|
||||||
|
;;;;;; Chicken Scheme
|
||||||
(use-package scheme
|
(use-package scheme
|
||||||
:config
|
:config
|
||||||
(eval-after-load 'eglot
|
(setq prettify-symbols-alist
|
||||||
'(add-to-list 'eglot-server-programs
|
'(("lambda" . "λ")))
|
||||||
'(scheme-mode
|
|
||||||
. ("env" "CHICKEN_DOC_REPOSITORY=/home/zilti/.local/share/chicken-doc" "chicken-lsp-server"))))
|
|
||||||
:hook
|
:hook
|
||||||
(scheme-mode . eglot-ensure))
|
(scheme-mode . eglot-ensure))
|
||||||
|
|
||||||
|
@ -620,11 +700,9 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
#'flymake-chicken-backend nil t)
|
#'flymake-chicken-backend nil t)
|
||||||
(flymake-mode))
|
(flymake-mode))
|
||||||
|
|
||||||
(use-package geiser
|
(use-package geiser-chicken)
|
||||||
:custom
|
|
||||||
(geiser-chicken-match-limit 200)
|
;;;;;; Guile
|
||||||
:config
|
|
||||||
(defalias 'run-geiser 'geiser))
|
|
||||||
|
|
||||||
(use-package geiser-guile
|
(use-package geiser-guile
|
||||||
:config
|
:config
|
||||||
|
@ -648,11 +726,6 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
(zig-mode . eglot-ensure)
|
(zig-mode . eglot-ensure)
|
||||||
:mode ("\\.zig\\'" . zig-mode))
|
:mode ("\\.zig\\'" . zig-mode))
|
||||||
|
|
||||||
(use-package nix-mode
|
|
||||||
:hook
|
|
||||||
(nix-mode . eglot-ensure)
|
|
||||||
:mode ("\\.nix\\'" . nix-mode))
|
|
||||||
|
|
||||||
;; (use-package lsp-tailwindcss
|
;; (use-package lsp-tailwindcss
|
||||||
;; :init
|
;; :init
|
||||||
;; (setq lsp-tailwindcss-add-on-mode t
|
;; (setq lsp-tailwindcss-add-on-mode t
|
||||||
|
@ -723,5 +796,10 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
:encryption tls
|
:encryption tls
|
||||||
:channels ()))))
|
:channels ()))))
|
||||||
|
|
||||||
|
;;;; Wrapping Up
|
||||||
|
(use-package envrc
|
||||||
|
:config
|
||||||
|
(envrc-global-mode))
|
||||||
|
|
||||||
(provide 'init)
|
(provide 'init)
|
||||||
;;; init.el ends here
|
;;; init.el ends here
|
||||||
|
|
60
emacs/lib/smartparens-emacs-lisp.el
Normal file
60
emacs/lib/smartparens-emacs-lisp.el
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
;;; smartparens-clojure.el --- Additional configuration for Emacs Lisp mode. -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2023 Daniel Ziltener
|
||||||
|
|
||||||
|
;; Author: Daniel Ziltener <dziltener@lyrion.ch>
|
||||||
|
;; Created: 13 December 2023
|
||||||
|
;; Keywords: abbrev convenience editing
|
||||||
|
;; URL: https://github.com/Fuco1/smartparens
|
||||||
|
;;
|
||||||
|
;; This file is not part of GNU Emacs.
|
||||||
|
;;
|
||||||
|
;;; License:
|
||||||
|
;;
|
||||||
|
;; This file is part of Smartparens.
|
||||||
|
;;
|
||||||
|
;; Smartparens is free software; you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation, either version 3 of the License, or
|
||||||
|
;; (at your option) any later version.
|
||||||
|
;;
|
||||||
|
;; Smartparens is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
;;
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with Smartparens. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
;;
|
||||||
|
;;; Commentary:
|
||||||
|
;;
|
||||||
|
;; This file provides some additional configuration for Emacs Lisp mode. To use
|
||||||
|
;; it, simply add:
|
||||||
|
;;
|
||||||
|
;; (require 'smartparens-emacs-lisp)
|
||||||
|
;;
|
||||||
|
;; into your configuration. You can use this in conjunction with the
|
||||||
|
;; default config or your own configuration.
|
||||||
|
;;
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'smartparens)
|
||||||
|
|
||||||
|
(defvar sp-emacs-lisp-prefix "\\(?:[@`'#,_]+\\)"
|
||||||
|
"Prefix used in `sp-sexp-prefix' for emacs lisp mode.")
|
||||||
|
|
||||||
|
(defvar sp-emacs-lisp-modes '(emacs-lisp-mode lisp-data-mode)
|
||||||
|
"List of Emacs Lisp-related modes.")
|
||||||
|
|
||||||
|
(dolist (mode sp-emacs-lisp-modes)
|
||||||
|
(add-to-list 'sp-sexp-prefix `(,mode regexp ,sp-emacs-lisp-prefix)))
|
||||||
|
|
||||||
|
;; Match "`" with "`" in strings and comments
|
||||||
|
(sp-with-modes sp-emacs-lisp-modes
|
||||||
|
(sp-local-pair "`" "`"
|
||||||
|
:when '(sp-in-string-p
|
||||||
|
sp-in-comment-p)
|
||||||
|
:unless '(sp-lisp-invalid-hyperlink-p)))
|
||||||
|
|
||||||
|
(provide 'smartparens-emacs-lisp)
|
||||||
|
;;; smartparens-emacs-lisp.el ends here
|
60
emacs/lib/smartparens-scheme.el
Normal file
60
emacs/lib/smartparens-scheme.el
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
;;; smartparens-clojure.el --- Additional configuration for Emacs Lisp mode. -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2023 Daniel Ziltener
|
||||||
|
|
||||||
|
;; Author: Daniel Ziltener <dziltener@lyrion.ch>
|
||||||
|
;; Created: 13 December 2023
|
||||||
|
;; Keywords: abbrev convenience editing
|
||||||
|
;; URL: https://github.com/Fuco1/smartparens
|
||||||
|
;;
|
||||||
|
;; This file is not part of GNU Emacs.
|
||||||
|
;;
|
||||||
|
;;; License:
|
||||||
|
;;
|
||||||
|
;; This file is part of Smartparens.
|
||||||
|
;;
|
||||||
|
;; Smartparens is free software; you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation, either version 3 of the License, or
|
||||||
|
;; (at your option) any later version.
|
||||||
|
;;
|
||||||
|
;; Smartparens is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
;;
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with Smartparens. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
;;
|
||||||
|
;;; Commentary:
|
||||||
|
;;
|
||||||
|
;; This file provides some additional configuration for Emacs Lisp mode. To use
|
||||||
|
;; it, simply add:
|
||||||
|
;;
|
||||||
|
;; (require 'smartparens-scheme)
|
||||||
|
;;
|
||||||
|
;; into your configuration. You can use this in conjunction with the
|
||||||
|
;; default config or your own configuration.
|
||||||
|
;;
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'smartparens)
|
||||||
|
|
||||||
|
(defvar sp-scheme-prefix "\\(?:[@`'#,_]+\\)"
|
||||||
|
"Prefix used in `sp-sexp-prefix' for emacs lisp mode.")
|
||||||
|
|
||||||
|
(defvar sp-scheme-modes '(scheme-mode geiser-mode)
|
||||||
|
"List of Scheme-related modes.")
|
||||||
|
|
||||||
|
(dolist (mode sp-scheme-modes)
|
||||||
|
(add-to-list 'sp-sexp-prefix `(,mode regexp ,sp-scheme-prefix)))
|
||||||
|
|
||||||
|
;; Match "`" with "`" in strings and comments
|
||||||
|
(sp-with-modes sp-scheme-modes
|
||||||
|
(sp-local-pair "`" "`"
|
||||||
|
:when '(sp-in-string-p
|
||||||
|
sp-in-comment-p)
|
||||||
|
:unless '(sp-lisp-invalid-hyperlink-p)))
|
||||||
|
|
||||||
|
(provide 'smartparens-scheme)
|
||||||
|
;;; smartparens-scheme.el ends here
|
|
@ -13,6 +13,101 @@ prog-mode
|
||||||
(bug (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "BUG ")
|
(bug (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "BUG ")
|
||||||
(hack (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "HACK ")
|
(hack (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "HACK ")
|
||||||
|
|
||||||
|
scheme-mode
|
||||||
|
|
||||||
|
(crate-dependency
|
||||||
|
"(\"rust-" crate-name "\" ,rust-" (s crate-name) "-" p ")")
|
||||||
|
|
||||||
|
(define-guix-crate
|
||||||
|
"(define-public rust-" (s egg-name) "-" (s maj-version)
|
||||||
|
n> "(package"
|
||||||
|
n> "(name \"rust-" egg-name "\")"
|
||||||
|
n> "(version \"" maj-version "." (s egg-version) "\")"
|
||||||
|
n> "(source"
|
||||||
|
n> "(origin"
|
||||||
|
n> "(method url-fetch)"
|
||||||
|
n> "(uri (crate-uri \"" egg-name "\" version))"
|
||||||
|
n> "(sha256"
|
||||||
|
n> "(base32"
|
||||||
|
n> "\"0z05x7f154n9bgmainrsmncf5i6dil43r9ymr3rdgwbg4wnxmz4s\"))))"
|
||||||
|
n> "(build-system cargo-build-system)"
|
||||||
|
n> "(arguments"
|
||||||
|
n> "`(#:cargo-inputs"
|
||||||
|
n> "(" p ")"
|
||||||
|
n> "#:cargo-development-inputs"
|
||||||
|
n> "(" p ")"
|
||||||
|
n> "#:cargo-build-inputs"
|
||||||
|
n> "(" p ")))"
|
||||||
|
n> "(synopsis \"" (s synopsis) "\")"
|
||||||
|
n> "(home-page \"https://crates.io/crates/" egg-name "\")"
|
||||||
|
n> "(description \"" synopsis ".\")"
|
||||||
|
n> "(license license:" (s license) ")))")
|
||||||
|
|
||||||
|
(define-guix-egg
|
||||||
|
"(define-public chicken-" (s egg-name)
|
||||||
|
n> "(package"
|
||||||
|
n> "(name \"chicken-" egg-name "\")"
|
||||||
|
n> "(version \"" (s egg-version) "\")"
|
||||||
|
n> "(source"
|
||||||
|
n> "(origin"
|
||||||
|
n> "(method url-fetch)"
|
||||||
|
n> "(uri (egg-uri \"" egg-name "\" version))"
|
||||||
|
n> "(sha256"
|
||||||
|
n> "(base32"
|
||||||
|
n> "\"0z05x7f154n9bgmainrsmncf5i6dil43r9ymr3rdgwbg4wnxmz4s\"))))"
|
||||||
|
n> "(propagated-inputs"
|
||||||
|
n> "(list " (s inputs) "))"
|
||||||
|
n> "(native-inputs"
|
||||||
|
n> "(list " (s native-inputs) "))"
|
||||||
|
n> "(build-system chicken-build-system)"
|
||||||
|
n> "(arguments '(#:egg-name \"" egg-name "\"))"
|
||||||
|
n> "(synopsis \"" (s synopsis) "\")"
|
||||||
|
n> "(home-page \"https://wiki.call-cc.org/eggref/5/" egg-name "\")"
|
||||||
|
n> "(description \"" synopsis "\")"
|
||||||
|
n> "(license license:" (s license) ")))")
|
||||||
|
|
||||||
|
org-mode
|
||||||
|
|
||||||
|
(src
|
||||||
|
"#+begin_src " p
|
||||||
|
n p n
|
||||||
|
"#+end_src")
|
||||||
|
|
||||||
|
(advent-of-code-day
|
||||||
|
"* Day " (s day) ": " p
|
||||||
|
n> n> "Get the puzzle solution as [[./day" day ".scm][tangled .scm file]]."
|
||||||
|
n> n> "** Part One"
|
||||||
|
n> n> "#+NAME: day" day "-imports"
|
||||||
|
n> "#+begin_src scheme :exports none :noweb yes :tangle day" day ".scm"
|
||||||
|
n>
|
||||||
|
n> "#+end_src"
|
||||||
|
n> n> "#+NAME: day" day "-input-scm"
|
||||||
|
n> "#+begin_src scheme :exports none :noweb yes :tangle day" day ".scm"
|
||||||
|
n> "(define input \""
|
||||||
|
n> "<<day" day "-input>>\")"
|
||||||
|
n> "#+end_src"
|
||||||
|
n> n> "*** Quest"
|
||||||
|
n> n> "*** Puzzle Solution"
|
||||||
|
n> n> "**** Calculation"
|
||||||
|
n> n> "#+NAME: day" day "-part1-calc-fn"
|
||||||
|
n> "#+begin_src scheme :tangle day" day ".scm :noweb strip-tangle"
|
||||||
|
n> ""
|
||||||
|
n> "#+end_src"
|
||||||
|
n> n> "#+CALL: day" day "-part1-calc-fn[:var input=day" day "-input[] :epilogue \"(calc-part-1)\"]()"
|
||||||
|
n> n> "** Part Two"
|
||||||
|
n> n> "*** Quest"
|
||||||
|
n> n> "*** Puzzle Solution"
|
||||||
|
n> n> "**** Calculation"
|
||||||
|
n> n> "#+NAME: day" day "-part2-calc-fn"
|
||||||
|
n> "#+begin_src scheme :tangle day" day ".scm :noweb strip-tangle"
|
||||||
|
n> ""
|
||||||
|
n> "#+end_src"
|
||||||
|
n>n> "#+CALL: day" day "-part2-calc-fn[:var input=day" day "-input[] :epilogue \"(calc-part-2)\"]()"
|
||||||
|
n> n> "** Puzzle Input"
|
||||||
|
n> n> "#+NAME: day" day "-input"
|
||||||
|
n> "#+begin_src fundamental"
|
||||||
|
n> "#+end_src")
|
||||||
|
|
||||||
;; Local Variables:
|
;; Local Variables:
|
||||||
;; mode: lisp-data
|
;; mode: lisp-data
|
||||||
;; outline-regexp: "[a-z]"
|
;; outline-regexp: "[a-z]"
|
||||||
|
|
12
flake.lock
12
flake.lock
|
@ -27,11 +27,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1700814205,
|
"lastModified": 1702195709,
|
||||||
"narHash": "sha256-lWqDPKHRbQfi+zNIivf031BUeyciVOtwCwTjyrhDB5g=",
|
"narHash": "sha256-+zRjWkm5rKqQ57PuLZ3JF3xi3vPMiOJzItb1m/43Cq4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "aeb2232d7a32530d3448318790534d196bf9427a",
|
"rev": "6761b8188b860f374b457eddfdb05c82eef9752f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -138,11 +138,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701539137,
|
"lastModified": 1702233072,
|
||||||
"narHash": "sha256-nVO/5QYpf1GwjvtpXhyxx5M3U/WN0MwBro4Lsk+9mL0=",
|
"narHash": "sha256-H5G2wgbim2Ku6G6w+NSaQaauv6B6DlPhY9fMvArKqRo=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "933d7dc155096e7575d207be6fb7792bc9f34f6d",
|
"rev": "781e2a9797ecf0f146e81425c822dca69fe4a348",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
Loading…
Reference in a new issue