Initial commit

This commit is contained in:
marco 2023-08-06 09:10:05 +02:00
commit d280c413be
42 changed files with 489 additions and 0 deletions

11
.borgconfig Normal file
View File

@ -0,0 +1,11 @@
[submodule "dash"]
no-byte-compile = dash-functional.el
no-makeinfo = dash-template.texi
[submodule "emacsql"]
no-byte-compile = emacsql-pg.el
[submodule "magit"]
no-byte-compile = lisp/magit-libgit.el
[submodule "sqlite3"]
build-step = make
[submodule "libgit"]
build-step = make

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/tree-sitter/
/var/

110
.gitmodules vendored Normal file
View File

@ -0,0 +1,110 @@
[include]
path = .borgconfig
[submodule "annalist"]
path = lib/annalist
url = https://github.com/noctuid/annalist.el
[submodule "auto-compile"]
path = lib/auto-compile
url = https://github.com/emacscollective/auto-compile
[submodule "avy"]
path = lib/avy
url = https://github.com/abo-abo/avy
[submodule "borg"]
path = lib/borg
url = git@github.com:emacscollective/borg.git
[submodule "buttercup"]
path = lib/buttercup
url = https://github.com/jorgenschaefer/emacs-buttercup
[submodule "closql"]
path = lib/closql
url = git@github.com:emacscollective/closql.git
[submodule "compat"]
path = lib/compat
url = https://git.sr.ht/~pkal/compat
[submodule "consult"]
path = lib/consult
url = https://github.com/minad/consult
[submodule "consult-notes"]
path = lib/consult-notes
url = https://github.com/mclear-tools/consult-notes
[submodule "corfu"]
path = lib/corfu
url = https://github.com/minad/corfu
[submodule "dash"]
path = lib/dash
url = https://github.com/magnars/dash.el
[submodule "denote"]
path = lib/denote
url = git@github.com:emacsmirror/denote.git
[submodule "ef-themes"]
path = lib/ef-themes
url = git@github.com:emacsmirror/ef-themes.git
[submodule "emacsql"]
path = lib/emacsql
url = git@github.com:skeeto/emacsql.git
[submodule "embark"]
path = lib/embark
url = https://github.com/oantolin/embark
[submodule "epkg"]
path = lib/epkg
url = git@github.com:emacscollective/epkg.git
[submodule "evil"]
path = lib/evil
url = https://github.com/emacs-evil/evil
[submodule "evil-collection"]
path = lib/evil-collection
url = https://github.com/emacs-evil/evil-collection
[submodule "general"]
path = lib/general
url = https://github.com/noctuid/general.el
[submodule "git-modes"]
path = lib/git-modes
url = https://github.com/magit/git-modes
[submodule "libgit"]
path = lib/libgit
url = https://github.com/magit/libegit2
[submodule "llama"]
path = lib/llama
url = https://git.sr.ht/~tarsius/llama
[submodule "magit"]
path = lib/magit
url = https://github.com/magit/magit
[submodule "marginalia"]
path = lib/marginalia
url = https://github.com/minad/marginalia
[submodule "no-littering"]
path = lib/no-littering
url = https://github.com/emacscollective/no-littering
[submodule "ob-go"]
path = lib/ob-go
url = https://github.com/pope/ob-go
[submodule "orderless"]
path = lib/orderless
url = https://github.com/oantolin/orderless
[submodule "org"]
path = lib/org
url = git@github.com:emacsmirror/org.git
[submodule "projectile"]
path = lib/projectile
url = https://github.com/bbatsov/projectile
[submodule "rainbow-delimiters"]
path = lib/rainbow-delimiters
url = https://github.com/Fanael/rainbow-delimiters
[submodule "s"]
path = lib/s
url = https://github.com/magnars/s.el
[submodule "sqlite3"]
path = lib/sqlite3
url = https://github.com/pekingduck/emacs-sqlite3-api
[submodule "transient"]
path = lib/transient
url = https://github.com/magit/transient
[submodule "vertico"]
path = lib/vertico
url = https://github.com/minad/vertico
[submodule "which-key"]
path = lib/which-key
url = https://github.com/justbur/emacs-which-key
[submodule "with-editor"]
path = lib/with-editor
url = https://github.com/magit/with-editor

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
DRONES_DIR = $(shell git config "borg.drones-directory" || echo "lib")
-include $(DRONES_DIR)/borg/borg.mk
bootstrap-borg:
@git submodule--helper clone --name borg --path $(DRONES_DIR)/borg \
--url git@github.com:emacscollective/borg.git
@cd $(DRONES_DIR)/borg; git symbolic-ref HEAD refs/heads/master
@cd $(DRONES_DIR)/borg; git reset --hard HEAD
scrub-submodules:
@for dir in `ls lib`; do printf "%s --\n" "$$dir"; cd "lib/$$dir"; for dirt in `git ls-files --others --exclude-standard`; do rm -iv "$$dirt"; done; cd ../..; done

16
early-init.el Normal file
View File

@ -0,0 +1,16 @@
;;; -*- lexical-binding: t -*-
(setq load-prefer-newer t)
(let ((dir (file-name-directory (or load-file-name buffer-file-name))))
(add-to-list 'load-path (expand-file-name "lib/compat" dir))
(add-to-list 'load-path (expand-file-name "lib/packed" dir))
(add-to-list 'load-path (expand-file-name "lib/auto-compile" dir)))
(require 'auto-compile)
(auto-compile-on-load-mode)
(auto-compile-on-save-mode)
(setq package-enable-at-startup nil)
(with-eval-after-load 'package
(add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t)
(add-to-list 'package-archives (cons "org" "https://orgmode.org/elpa/") t))

301
init.el Normal file
View File

@ -0,0 +1,301 @@
;; -*- lexical-binding: t -*-
(progn
(setq inhibit-startup-buffer-menu t)
(setq inhibit-startup-screen t)
(setq initial-buffer-choice t)
(setq initial-scratch-message "")
(scroll-bar-mode 0)
(tool-bar-mode 0)
(menu-bar-mode 0)
(setq ns-use-proxy-icon nil)
(setq frame-title-format nil)
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(setq isearch-allow-scroll t)
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq show-trailing-whitespace t)
(setq backup-by-copying t)
(set-default-coding-systems 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(defalias 'go-mode 'go-ts-mode)
(defalias 'gomod-mode 'go-mod-ts-mode)
(defvar modus-themes-italic-constructs t)
(defvar modus-themes-bold-constructs nil)
(defvar modus-themes-mode-line '(borderless accented))
(defvar modus-themes-region '(bg-only no-extend))
(load-theme 'modus-vivendi t)
(global-display-line-numbers-mode))
(eval-and-compile
(add-to-list 'load-path (expand-file-name "lib/borg/" user-emacs-directory))
(require 'borg)
(borg-initialize))
(use-package auto-compile
:config
(setq auto-compile-display-buffer nil)
(setq auto-compile-mode-line-counter t)
(setq auto-compile-source-recreate-deletes-dest t)
(setq auto-compile-toggle-deletes-nonlib-dest t))
(use-package epkg
:defer t
:init
(setq epkg-repository (expand-file-name "var/epkgs/" user-emacs-directory)))
(use-package dash
:config (global-dash-fontify-mode))
(use-package server
:commands (server-running-p)
:config (or (server-running-p) (server-mode)))
(use-package magit
:defer t
:commands (magit-add-section-hook)
:config
(magit-add-section-hook 'magit-status-sections-hook
'magit-insert-modules
'magit-insert-stashes
'append))
(use-package evil
:hook (after-init . evil-mode)
:init
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(evil-mode t)
:config
(evil-set-initial-state 'shell-mode 'normal)
(evil-set-initial-state 'doc-view-mode 'normal)
(evil-set-initial-state 'package-menu-mode 'normal)
(evil-set-initial-state 'biblio-selection-mode 'motion)
(evil-global-set-key 'motion "gs" 'tab-bar-switch-to-tab)
(setq doc-view-continuous t))
(use-package evil-collection
:after evil
:init
(evil-collection-init))
(use-package org
:config
(setq org-confirm-babel-evaluate nil)
(setq org-export-use-babel nil)
(add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(plantuml . t)
(C . t)
(java . t)
(shell . t)
(sql . t)
(go . t)
(python . t))))
(use-package vertico
:init
(vertico-mode))
(use-package orderless
:init
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((eglot (styles orderless)) (file (styles partial-completion)))))
(use-package consult
:config
(defun find-fd (&optional dir initial)
(interactive "P")
(let ((consult-find-args "fzf -e"))
(consult-find dir initial)))
(autoload 'projectile-project-root "projectile")
(setq consult-project-root-function #'projectile-project-root))
(use-package embark)
(use-package embark-consult
:hook
(embark-collect-mode . consult-preview-at-point-mode))
(use-package marginalia
:custom
(marginalia-align 'right)
:init
(marginalia-mode))
(use-package which-key
:init (which-key-mode t))
(use-package general
:after which-key
:config
(general-override-mode t)
(general-auto-unbind-keys)
(general-define-key
:keymaps 'key-translation-map
"ESC" (kbd "C-g"))
(general-def
"C-x x" 'eval-defun)
(general-create-definer tyrant-def
:states '(normal visual insert motion emacs)
:prefix "SPC"
:non-normal-prefix "C-SPC")
(tyrant-def
"" nil
"SPC" (general-simulate-key "M-x")
"c" (general-simulate-key "C-c")
"h" (general-simulate-key "C-h")
"u" (general-simulate-key "C-u")
"x" (general-simulate-key "C-x")
"w" (general-simulate-key "C-w")
":" 'shell-command
"git" 'magit
"rg" 'consult-ripgrep
"fzf" 'consult-find
"em" '(:ignore t :which-key "emacs")
"emr" (lambda ()
(interactive)
(load-file user-init-file))
"emd" (lambda ()
(interactive)
(find-file user-init-file))
"t" '(:ignore t :which-key "themes")
"ts" 'consult-theme
"b" '(:ignore t :which-key "buffers")
"bl" 'switch-to-buffer
"bd" 'kill-this-buffer
"f" '(:ignore t :which-key "files")
"ff" 'find-file
"fr" 'rename-file-and-buffer
"p" '(:ignore t :which-key "projects")
"pf" 'projectile-find-file
"psp" 'projectile-switch-project
"psb" 'projectile-switch-buffer
"o" '(:ignore t :which-key "org")
"oi" 'org-insert-structure-template
"odu" 'org-update-all-dblocks
"n" '(:ignore t :which-key "notes/navigation")
"nl" 'consult-notes
"nxr" 'xref-find-references
"nxd" 'xref-find-definitions
))
(use-package corfu
:init
(global-corfu-mode))
(use-package projectile
:init
(projectile-mode t)
:config
(setq projectile-require-project-root nil)
(setq projectile-find-dir-includes-top-level t)
(setq projectile-project-search-path '(
"~/work/ost/"
"~/work/private"
)))
(use-package denote
:config
(setq denote-directory (expand-file-name "~/denote"))
(defun x/denote-journal ()
(interactive)
(let* ((today (format-time-string "%A %e %B %Y"))
(string (denote-sluggify today))
(files (denote-directory-files-matching-regexp string)))
(cond
((> (length files) 1)
(find-file (completing-read "Select file: " files nil :require-match)))
(files
(find-file (car files)))
(t
(denote
today
'("journal"))))))
(defun x/denote-append-region-to-note (beg end)
(interactive "r")
(if-let (((region-active-p))
(text (buffer-substring-no-properties beg end)))
(progn
(consult-notes)
(goto-char (point-max))
(insert text))
(user-error "No region is available")))
)
(use-package consult-notes
:config
(consult-notes-denote-mode))
(use-package rainbow-delimiters
:config
(set-face-foreground 'rainbow-delimiters-depth-1-face "#c66")
(set-face-foreground 'rainbow-delimiters-depth-2-face "#6c6")
(set-face-foreground 'rainbow-delimiters-depth-3-face "#69f")
(set-face-foreground 'rainbow-delimiters-depth-4-face "#cc6")
(set-face-foreground 'rainbow-delimiters-depth-5-face "#6cc")
(set-face-foreground 'rainbow-delimiters-depth-6-face "#c6c")
(set-face-foreground 'rainbow-delimiters-depth-7-face "#ccc")
(set-face-foreground 'rainbow-delimiters-depth-8-face "#999")
(set-face-foreground 'rainbow-delimiters-depth-9-face "#666"))
(use-package lisp-mode
:config
(add-hook 'lisp-mode-hook 'rainbow-delimiters-mode)
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode))
(use-package no-littering)
(use-package custom
:no-require t
:config
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(when (file-exists-p custom-file)
(load custom-file)))
;; http://steve.yegge.googlepages.com/my-dot-emacs-file
(defun rename-file-and-buffer (new-name)
"Renames both current buffer and file it's visiting to NEW-NAME."
(interactive "New name: ")
(let ((name (buffer-name))
(filename (buffer-file-name)))
(if (not filename)
(message "Buffer '%s' is not visiting a file!" name)
(if (get-buffer new-name)
(message "A buffer named '%s' already exists!" new-name)
(progn
(rename-file name new-name t)
(rename-buffer new-name)
(set-visited-file-name new-name)
(set-buffer-modified-p nil))))))

1
lib/annalist Submodule

@ -0,0 +1 @@
Subproject commit 134fa3f0fb91a636a1c005c483516d4b64905a6d

1
lib/auto-compile Submodule

@ -0,0 +1 @@
Subproject commit 6ed8e29d23c6c91f8c98f18ff745d2475d6f6a38

1
lib/avy Submodule

@ -0,0 +1 @@
Subproject commit be612110cb116a38b8603df367942e2bb3d9bdbe

1
lib/borg Submodule

@ -0,0 +1 @@
Subproject commit dcdd702dae7cdfc3bfb9076d737490870647870d

1
lib/buttercup Submodule

@ -0,0 +1 @@
Subproject commit 30c703d215b075aaede936a2c424f65b5f7b6391

1
lib/closql Submodule

@ -0,0 +1 @@
Subproject commit 85ac7b8a894a4e259439d79eb6bd6f5129770905

1
lib/compat Submodule

@ -0,0 +1 @@
Subproject commit 39680022511b4945cee0b4c4a49a84caaff6e60d

1
lib/consult Submodule

@ -0,0 +1 @@
Subproject commit fe49dedd71802ff97be7b89f1ec4bd61b98c2b13

1
lib/consult-notes Submodule

@ -0,0 +1 @@
Subproject commit c48b563f855f60bfaa8360c23529e8cac3dc6c7d

1
lib/corfu Submodule

@ -0,0 +1 @@
Subproject commit 3ba98519998e67b493e454fc0c3971c206b11bf9

1
lib/dash Submodule

@ -0,0 +1 @@
Subproject commit f46268c75cb7c18361d3cee942cd4dc14a03aef4

1
lib/denote Submodule

@ -0,0 +1 @@
Subproject commit 7702d37efdb9d01d62dab359780779c84d23e81e

1
lib/ef-themes Submodule

@ -0,0 +1 @@
Subproject commit ca3645c4985e1f57829699bac755c860f2c863ed

1
lib/emacsql Submodule

@ -0,0 +1 @@
Subproject commit 64012261f65fcdd7ea137d1973ef051af1dced42

1
lib/embark Submodule

@ -0,0 +1 @@
Subproject commit 9a44418c349e41020cdc5ad1bd21e8c77a429062

1
lib/epkg Submodule

@ -0,0 +1 @@
Subproject commit 5acd45411b012b15ec1a042418c9024b091c3ad7

1
lib/evil Submodule

@ -0,0 +1 @@
Subproject commit 669dc20279533fe2ecaf76b8a02422205b8629f2

1
lib/evil-collection Submodule

@ -0,0 +1 @@
Subproject commit 286d69de179cf70c00963a998a4beb826b51414a

1
lib/general Submodule

@ -0,0 +1 @@
Subproject commit 833dea2c4a60e06fcd552b653dfc8960935c9fb4

1
lib/git-modes Submodule

@ -0,0 +1 @@
Subproject commit 44d536ba637235c9dd203410281397417a3e60b6

1
lib/libgit Submodule

@ -0,0 +1 @@
Subproject commit ab1a53a6a0120872e42582fc980e779d47de6d0e

1
lib/llama Submodule

@ -0,0 +1 @@
Subproject commit 5c454f1a83c698668942603e595cec36a5211768

1
lib/magit Submodule

@ -0,0 +1 @@
Subproject commit decd5f40dd514ef559cdbba23c51e2208c25d9ef

1
lib/marginalia Submodule

@ -0,0 +1 @@
Subproject commit 866e50aee4f066b0903752c69b33e9b7cab93f97

1
lib/no-littering Submodule

@ -0,0 +1 @@
Subproject commit fcfd51fbdf08469e6d1b59bc4bd2d75aa708c791

1
lib/ob-go Submodule

@ -0,0 +1 @@
Subproject commit 2067ed55f4c1d33a43cb3f6948609d240a8915f5

1
lib/orderless Submodule

@ -0,0 +1 @@
Subproject commit e6784026717a8a6a7dcd0bf31fd3414f148c542e

1
lib/org Submodule

@ -0,0 +1 @@
Subproject commit 34082ff184b1ceb5ff57e9daf91a774c038dfc7a

1
lib/projectile Submodule

@ -0,0 +1 @@
Subproject commit 971cd5c4f25ff1f84ab7e8337ffc7f89f67a1b52

@ -0,0 +1 @@
Subproject commit a32b39bdfe6c61c322c37226d66e1b6d4f107ed0

1
lib/s Submodule

@ -0,0 +1 @@
Subproject commit dda84d38fffdaf0c9b12837b504b402af910d01d

1
lib/sqlite3 Submodule

@ -0,0 +1 @@
Subproject commit b513b71012f61895f771fc6948d6511ea8ded0a6

1
lib/transient Submodule

@ -0,0 +1 @@
Subproject commit 323d6b6c84e6ae55e578efa1efb6bb4d42a69cac

1
lib/vertico Submodule

@ -0,0 +1 @@
Subproject commit d1dd2f74dbcb0817c70e7211fc438b70648a3ee1

1
lib/which-key Submodule

@ -0,0 +1 @@
Subproject commit df6b0cb8449812e7fb200bc852107fa7eb708496

1
lib/with-editor Submodule

@ -0,0 +1 @@
Subproject commit a4853781835346aabf083d2d9cb87f656d01ccac