Compare commits

...

13 Commits

Author SHA1 Message Date
Akko
62dd664426 idk 2024-07-22 12:52:31 +02:00
Akko
7a78a1645a stuff 2024-03-09 19:10:57 +01:00
Akko
e95c531179 merge 2023-12-12 15:00:03 +01:00
Akko
309dccb4ea whatever 2023-12-12 14:57:07 +01:00
Akko
e1d7177d23 Changes 2023-12-12 14:54:41 +01:00
Akko
916e376500 changes 2023-11-15 10:49:16 +01:00
Akko
b448fa15b7 gtd workflow improvements 2023-08-11 00:57:21 +02:00
Akko
59a4ef9c5e unfuck 2023-08-09 14:52:44 +02:00
Akko
9fb96c18aa Merge branch 'master' of http://git.nakadashi.lol/akko/doom-config 2023-08-09 14:51:01 +02:00
Akko
c22a39f751 Idunnolol 2023-08-09 14:50:07 +02:00
Akko
8a347a9b20 Merge remote-tracking branch 'refs/remotes/origin/master' 2023-08-09 14:45:42 +02:00
Akko
86b790a6d6 new stufe 2023-08-09 14:37:37 +02:00
Akko
3d720532d3 initial commit 2023-03-16 17:46:13 +01:00
14 changed files with 1038 additions and 127 deletions

271
backup/config.el Normal file
View File

@@ -0,0 +1,271 @@
;;; .doom.d/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here
(setq user-full-name "KahrKunne"
user-mail-address "kahr.kunne@gmail.com"
backup-directory-alist '(("~/.emacs.d/backups"))
delete-old-versions nil
version-control t
vc-make-backup-files nil
auto-save-file-name-transforms '((".*" "~/.emacs.d/auto-save-list" t))
savehist-file "~/.emacs.d/savehist"
require-final-newline t
global-auto-revert-mode t
global-auto-revert-non-file-buffers t
auto-revert-verbose nil
custom-safe-themes t)
(add-hook 'term-mode-hook 'toggle-truncate-lines)
(fset 'yes-or-no-p 'y-or-n-p)
(defadvice projectile-project-root (around ignore-remote first activate)
(unless (file-remote-p default-directory) ad-do-it))
(setq web-mode-script-padding 0
js-indent-level 2
js2-strict-missing-semi-warning nil)
(setq avy-all-windows nil)
(setq avy-timeout-seconds 0.2)
(setq avy-keys '(?a ?s ?d ?f ?k ?l ?; ?g ?h
?q ?w ?e ?r ?t ?y ?i ?p
?A ?S ?D ?F ?J ?K ?L))
(define-key evil-normal-state-map (kbd "C-.") #'avy-goto-char-timer)
(setq aw-keys '(?a ?s ?d ?f ?k ?l ?; ?g ?h
?q ?w ?e ?r ?t ?y ?i ?p
?A ?S ?D ?F ?J ?K ?L))
(define-key evil-normal-state-map (kbd ";") 'evil-ex)
(define-key evil-normal-state-map (kbd "g a") 'paste-above)
(define-key evil-normal-state-map (kbd "g p") 'paste-below)
(setq ivy-height 10
ivy-count-format "(%d/%d) "
ivy-use-virtual-buffers t
ivy-re-builders-alist '((t . ivy--regex-ignore-order))
ivy-initial-inputs-alist '((org-refile . "")
(org-capture-refile . "")
(counsel-M-x . "")
(counsel-describe-function . "")
(counsel-describe-variable . "")
(man . "")
(woman . "")))
(defun my-web-mode-hook ()
(setq web-mode-markup-indent-offset 2)
(setq web-mode-code-indent-offset 2)
(setq web-mode-css-indent-offset 2))
(add-hook 'web-mode-hook 'my-web-mode-hook)
(require 'key-chord)
(key-chord-mode t)
(key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
(set-frame-font "Mononoki 22" nil t)
(global-set-key (kbd "C-s") #'swiper)
(which-key-mode 1)
(setq which-key-idle-delay 0.25)
(setq treemacs--width-is-locked nil)
;(centaur-tabs-mode 0)
;(setq centaur-tabs-style "bar")
;(setq centaur-tabs-modified-marker "*")
;(setq centaur-tabs-set-bar 'left)
;
;(centaur-tabs-change-fonts "Mononoki" 120)
;(centaur-tabs-group-by-projectile-project)
(setq doom-theme 'doom-old-hope)
(display-time-mode 1)
(global-set-key (kbd "C-x C-f") #'counsel-find-file)
(map! :leader
"." #'counsel-find-file)
(after! evil (evil-escape-mode nil))
(setq ivy-read-action-function #'ivy-hydra-read-action)
(defun my:is-end-of-line ()
"Compare point with end of line."
(let* ((pos (current-column))
(end-pos (save-excursion
(evil-end-of-line)
(current-column))))
(eq pos end-pos)))
(defun my:compare-with-end-of-word ()
"Compare point with end of word."
(let* ((pos (current-column))
(end-pos (save-excursion
(evil-backward-word-begin)
(evil-forward-word-end)
(current-column))))
(- pos end-pos)))
(defun my:point-is-space ()
"Check if point is whitespace."
(char-equal ?\s (char-after)))
(defun my:insert-after (func)
"Run FUNC after the end of word, ignoring whitespace."
(interactive)
(let ((relative-loc (my:compare-with-end-of-word)))
(cond ((my:is-end-of-line)
(end-of-line)
(call-interactively func))
((eq 0 relative-loc)
(evil-forward-char)
(call-interactively func))
((and (> 0 relative-loc) (not (my:point-is-space)))
(evil-forward-word-end)
(if (my:is-end-of-line)
(end-of-line)
(evil-forward-char))
(call-interactively func))
(t
(call-interactively func)))))
(setq mouse-autoselect-window t
focus-follows-mouse t)
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
(setq lsp-enable-links nil)
(require 'ox-publish)
(defun blog/get-util (x)
(with-temp-buffer
(insert-file-contents (concat "~/Blog/util/"
x))
(buffer-string)))
(setq org-html-metadata-timestamp-format "%Y-%m-%d")
;; Get project settings
(defun akko/blog-spec ()
"Return project settings for use with `org-publish-project-alist'."
(let* ((html-head (blog/get-util "head.html"))
(html-preamble (blog/get-util "preamble.html"))
(html-postamble (blog/get-util "postamble.html")))
`(
("pages"
:base-directory "~/Blog/org"
:base-extension "org"
:recursive t
:publishing-directory "~/Blog/html"
:publishing-function org-html-publish-to-html
:html-doctype "html5"
:html-html5-fancy t
:html-viewport ((width "100%")
(initial-scale "0.7")
(minimum-scale "")
(maximum-scale "")
(user-scalable ""))
:language "en"
:section-numbers nil
:with-toc nil
:with-date t
:with-title nil
:with-author nil
:auto-sitemap t
:sitemap-sort-files anti-chronologically
:sitemap-format-entry
(lambda (entry style project)
(cond ((not (directory-name-p entry))
(format
"[[file:%s][%s]]\n"
entry
(org-publish-find-title entry project)))
((eq style 'tree)
(capitalize (file-name-nondirectory (directory-file-name entry))))
(t entry)))
:headline-levels 4
:html-head ,html-head
:html-preamble ,html-preamble
:html-postamble (lambda (p)
(let* ((timestamp-format (plist-get p :html-metadata-timestamp-format))
(date (org-export-data (org-export-get-date p timestamp-format)
p))
(file (plist-get p :input-file))
(modified (format-time-string
timestamp-format
(and file (file-attribute-modification-time
(file-attributes file))))))
(concat
"<div id='footer'>"
(when (not (string-blank-p (format "%s" date)))
(format "<div id='publish-date'>Published: %s</div>" date))
(format "<div id='modified-date'>Last modified: %s</div>" modified)
,html-postamble
"</div>"))))
("static"
:base-directory "~/Blog/static"
:base-extension "css\\|txt\\|jpg\\|gif\\|png\\|ttf"
:recursive t
:publishing-directory "~/Blog/html/static"
:publishing-function org-publish-attachment)
("blog" :components ("pages" "static")))))
(setq org-publish-project-alist (akko/blog-spec))
(defun akko/publish-blog ()
(interactive)
(setq org-publish-project-alist (akko/blog-spec))
(org-publish-all))
(defun akko/force-publish-blog ()
(interactive)
(setq org-publish-project-alist (akko/blog-spec))
(org-publish-remove-all-timestamps)
(org-publish-all))
(map! :leader
(:prefix ("a" . "akko")
:desc "Publish Blog"
"b" #'akko/publish-blog
"f" #'akko/force-publish-blog))
(setq org-html-htmlize-output-type 'css)
(setq org-html-htmlize-font-prefix "org-")
(set-file-template! "/Blog/org/posts/.+\\.org"
:trigger "__blog")
(defun akko/org-current-time-string ()
(with-temp-buffer
(org-mode)
(org-time-stamp '(16))
(buffer-substring (point-min) (point-max))))
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-tsx-mode))
(setq auto-mode-alist
(append '(("\\.tsx\\'" . typescript-tsx-mode))
auto-mode-alist))
; XXX this will make doom create new files with ipython shebang - bad!
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "-i --simple-prompt")
(setq python-shell-completion-native-disabled-interpreters '("ipython"))

25
backup/custom.el Normal file
View File

@@ -0,0 +1,25 @@
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-agenda-files '("~/org/tasks.org" "~/todo.org"))
'(package-selected-packages
'(polymode fish-mode solidity-mode yaml-mode bison-mode graphql-mode arduino-mode gdscript-mode speed-type ivy-posframe lsp-haskell treemacs key-chord))
'(warning-suppress-log-types
'((lsp-completion-mode-hook)
(lsp-completion-mode-hook)
(lsp-on-idle-hook)
(lsp-on-idle-hook)))
'(warning-suppress-types
'((lsp-completion-mode-hook)
(lsp-on-idle-hook)
(lsp-on-idle-hook))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)

186
backup/init.el Normal file
View File

@@ -0,0 +1,186 @@
;;; init.el -*- lexical-binding: t; -*-
;; Copy this file to ~/.doom.d/init.el or ~/.config/doom/init.el ('doom install'
;; will do this for you). The `doom!' block below controls what modules are
;; enabled and in what order they will be loaded. Remember to run 'doom refresh'
;; after modifying it.
;;
;; More information about these modules (and what flags they support) can be
;; found in modules/README.org.
(doom! :input
;;chinese
;;japanese
:completion
company ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
(ivy ; a search engine for love and life
+prescient
+icons)
:checkers
syntax
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
;;fill-column ; a `fill-column' indicator
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink the current line after jumping
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup ; tame sudden yet inevitable temporary windows
+all ; catch all popups that start with an asterix
+defaults) ; default popup rules
;;pretty-code ; replace bits of code with pretty symbols
; tabs ; an tab bar for Emacs
treemacs ; a project drawer, like neotree but cooler
unicode ; extended unicode support for various languages
vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into pFalseython, sort of
rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
;;word-wrap ; soft wrapping with language-aware indent
:emacs
(dired ; making dired pretty [functional]
+icons)
electric ; smarter, keyword-based electric-indent
undo
(ibuffer ; interactive buffer management
+icons)
vc ; version-control and Emacs, sitting in a tree
:term
eshell ; a consistent, cross-platform shell (WIP)
;;shell ; a terminal REPL for Emacs
;;term ; terminals in Emacs
vterm ; another terminals in Emacs
:tools
lookup
;;ansible
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker
editorconfig ; let someone else argue about tabs vs spaces
ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
flycheck ; tasing you for every semicolon you forget
;;flyspell ; tasing you for misspelling mispelling
;;gist ; interacting with github gists
(lookup ; helps you navigate your code and documentation
+docsets
+dictionary
+offline) ; ...or in Dash docsets locally
(lsp
+eglot)
;;macos ; MacOS-specific commands
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;upload ; map local to remote projects via ssh/ftp
;;wakatime
:lang
;;agda ; types of types of types of types...
;;assembly ; assembly for fun or debugging
cc ; C/C++/Obj-C madness
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
data ; config/data formats
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;faust ; dsp, but you get to keep your soul
;;fsharp ; ML stands for Microsoft's Language
;;go ; the hipster dialect
(haskell +lsp) ; a language that's lazier than I am
hy ; readability of scheme w/ speed of python
;;idris ;
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
(javascript +lsp) ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean
;;ledger ; an accounting system in Emacs
lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org ; organize your plain life in plain text
;;+journal
+dragndrop ; drag & drop files/images into org buffers
;;+hugo ; use Emacs for hugo blogging
+ipython ; ipython/jupyter support for babel
+pandoc ; export-with-pandoc support
;;+pomodoro ; be fruitful with the tomato technique
+present) ; using org-mode for presentations
;;perl ; write code no one else can comprehend
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
(python ; beautiful is better than ugly
+lsp)
qt ; the 'cutest' gui framework ever
racket ; a DSL for DSLs
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
scheme ; a fully conniving family of lisps
(sh +fish +lsp) ; she sells {ba,z,fi}sh shells on the C xor
solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
web ; the tubes
:email
;;(mu4e +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
;;write ; emacs for writers (fiction, notes, papers, etc.)
:config
;;literate
(default +bindings +smartparens)
)

12
backup/packages.el Normal file
View File

@@ -0,0 +1,12 @@
;; -*- no-byte-compile: t; -*-
;;; .doom.d/packages.el
;;; Examples:
;; (package! some-package)
;; (package! another-package :recipe (:host github :repo "username/repo"))
;; (package! builtin-package :disable t)
(package! key-chord)
(package! which-key)
(package! org-mode :recipe (:repo "https://code.orgmode.org/bzg/org-mode.git"))
(add-to-list 'load-path "./elfiles")

197
config.el
View File

@@ -1,7 +1,3 @@
;;; .doom.d/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here
(setq backup-directory-alist '(("~/.emacs.d/backups"))
delete-old-versions nil
version-control t
@@ -12,32 +8,41 @@
global-auto-revert-mode t
global-auto-revert-non-file-buffers t
auto-revert-verbose nil
custom-safe-themes t)
custom-safe-themes t
mouse-autoselect-window t
focus-follows-mouse t
boymind-user "akko")
(add-hook 'term-mode-hook 'toggle-truncate-lines)
(fset 'yes-or-no-p 'y-or-n-p)
(defadvice projectile-project-root (around ignore-remote first activate)
(unless (file-remote-p default-directory) ad-do-it))
(if (string= (system-name) "illya")
(set-frame-font "Monoflow 12" nil t)
(set-frame-font "Monoflow Medium 20" nil t))
(set-frame-font "Mononoki Medium 12")
(setq web-mode-script-padding 0
js-indent-level 2
js2-strict-missing-semi-warning nil)
(setq doom-theme 'doom-ayu-mirage)
(setq avy-all-windows nil)
(setq avy-timeout-seconds 0.2)
(setq avy-keys '(?a ?s ?d ?f ?k ?l ?; ?g ?h
?q ?w ?e ?r ?t ?y ?i ?p
?A ?S ?D ?F ?J ?K ?L))
(define-key evil-normal-state-map (kbd "C-.") #'avy-goto-char-timer)
(setq aw-keys '(?a ?s ?d ?f ?k ?l ?; ?g ?h
?q ?w ?e ?r ?t ?y ?i ?p
?A ?S ?D ?F ?J ?K ?L))
(display-time-mode 1)
(define-key evil-normal-state-map (kbd ";") 'evil-ex)
(define-key evil-normal-state-map (kbd "g a") 'paste-above)
(define-key evil-normal-state-map (kbd "g p") 'paste-below)
(global-set-key (kbd "C-x C-f") #'counsel-find-file)
(map! :leader
"." #'counsel-find-file)
; TODO fix
(map! :after counsel "C-s" #'swiper)
(after! evil-escape
(setq evil-escape-key-sequence "jj")
(setq-default evil-escape-delay 0.2))
(which-key-mode 1)
(setq which-key-idle-delay 0.25)
(defun doom/find-file-in-private-config () (interactive) (counsel-find-file doom-user-dir))
(setq ivy-height 10
ivy-count-format "(%d/%d) "
@@ -49,91 +54,65 @@
(counsel-describe-function . "")
(counsel-describe-variable . "")
(man . "")
(woman . "")))
(woman . ""))
ivy-read-action-function #'ivy-hydra-read-action)
(defun my-web-mode-hook ()
(setq web-mode-markup-indent-offset 2)
(setq web-mode-code-indent-offset 2)
(setq web-mode-css-indent-offset 2))
(add-hook 'web-mode-hook 'my-web-mode-hook)
(setq yas-triggers-in-field t)
(require 'key-chord)
(key-chord-mode t)
(key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
(setq avy-all-windows nil
avy-timeout-seconds 0.2
avy-keys '(?a ?s ?d ?f ?k ?l ?; ?g ?h
?q ?w ?e ?r ?t ?y ?i ?p
?A ?S ?D ?F ?J ?K ?L))
(define-key evil-normal-state-map (kbd "C-.") #'avy-goto-char-timer)
(setq aw-keys '(?a ?s ?d ?f ?k ?l ?; ?g ?h
?q ?w ?e ?r ?t ?y ?i ?p
?A ?S ?D ?F ?J ?K ?L))
(if (string= (system-name) "illya")
(set-frame-font "Mononoki 12" nil t)
(set-frame-front "Mononoki 22" nil t))
(defadvice projectile-project-root (around ignore-remote first activate)
(unless (file-remote-p default-directory) ad-do-it))
(global-set-key (kbd "C-s") #'swiper)
(setq aw-scope 'global)
(which-key-mode 1)
(setq which-key-idle-delay 0.25)
(setq web-mode-script-padding 0
js-indent-level 2
js2-strict-missing-semi-warning nil
web-mode-markup-indent-offset 2
web-mode-code-indent-offset 2
web-mode-css-indent-offset 2)
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "-i --simple-prompt")
(setq python-shell-completion-native-disabled-interpreters '("ipython"))
(setq org-roam-directory (file-truename "/mnt/tenma/srv/boymind"))
; this seems to be broken right now
;(use-package! org-roam
; :config
; (setq org-roam-database-connector 'sqlite3))
(condition-case nil
(org-roam-db-autosync-mode)
(file-error (progn
(setq boymind/tenma-mounted nil)
(warn "Boymind mount failed.")))
(:success (setq boymind/tenma-mounted t)))
(when boymind/tenma-mounted
(org-babel-load-file (car (org-roam-id-find "d38fc8c3-651a-42e8-9ab7-33400f62a5b4")))
(boymind/setup "akko"))
(setq org-startup-folded t)
(add-hook 'term-mode-hook 'toggle-truncate-lines)
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-tsx-mode))
(setq treemacs--width-is-locked nil)
(setq doom-theme 'doom-old-hope)
(display-time-mode 1)
(global-set-key (kbd "C-x C-f") #'counsel-find-file)
(map! :leader
"." #'counsel-find-file)
(after! evil (evil-escape-mode nil))
(setq ivy-read-action-function #'ivy-hydra-read-action)
(defun my:is-end-of-line ()
"Compare point with end of line."
(let* ((pos (current-column))
(end-pos (save-excursion
(evil-end-of-line)
(current-column))))
(eq pos end-pos)))
(defun my:compare-with-end-of-word ()
"Compare point with end of word."
(let* ((pos (current-column))
(end-pos (save-excursion
(evil-backward-word-begin)
(evil-forward-word-end)
(current-column))))
(- pos end-pos)))
(defun my:point-is-space ()
"Check if point is whitespace."
(char-equal ?\s (char-after)))
(defun my:insert-after (func)
"Run FUNC after the end of word, ignoring whitespace."
(interactive)
(let ((relative-loc (my:compare-with-end-of-word)))
(cond ((my:is-end-of-line)
(end-of-line)
(call-interactively func))
((eq 0 relative-loc)
(evil-forward-char)
(call-interactively func))
((and (> 0 relative-loc) (not (my:point-is-space)))
(evil-forward-word-end)
(if (my:is-end-of-line)
(end-of-line)
(evil-forward-char))
(call-interactively func))
(t
(call-interactively func)))))
(setq mouse-autoselect-window t
focus-follows-mouse t)
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
(setq lsp-enable-links nil)
(require 'ox-publish)
(defun blog/get-util (x)
@@ -187,7 +166,7 @@
entry
(org-publish-find-title entry project)))
((eq style 'tree)
(capitalize (file-name-nondirectory (directory-file-name entry))))
(capitalize (file-name-nondirectory (directory-file-name entry))))
(t entry)))
:headline-levels 4
@@ -213,14 +192,14 @@
("static"
:base-directory "~/Blog/static"
:base-extension "css\\|txt\\|jpg\\|gif\\|png\\|ttf"
:base-extension "css\\|txt\\|jpg\\|gif\\|png\\|ttf\\|js"
:recursive t
:publishing-directory "~/Blog/html/static"
:publishing-function org-publish-attachment)
("blog" :components ("pages" "static")))))
(setq org-publish-project-alist (akko/blog-spec))
(setq org-publish-project-alist (akko/blog-spec))
(defun akko/publish-blog ()
(interactive)
@@ -234,9 +213,11 @@
(org-publish-all))
(map! :leader
(:prefix ("a" . "akko")
(:prefix-map
("a" . "akko")
:desc "Publish Blog"
"b" #'akko/publish-blog
:desc "Force Publish Blog"
"f" #'akko/force-publish-blog))
(setq org-html-htmlize-output-type 'css)
@@ -246,17 +227,11 @@
:trigger "__blog")
(defun akko/org-current-time-string ()
(with-temp-buffer
(org-mode)
(org-time-stamp '(16))
(buffer-substring (point-min) (point-max))))
(with-temp-buffer
(org-mode)
(org-time-stamp '(16))
(buffer-substring (point-min) (point-max))))
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-tsx-mode))
(setq auto-mode-alist
(append '(("\\.tsx\\'" . typescript-tsx-mode))
auto-mode-alist))
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "-i --simple-prompt")
(setq python-shell-completion-native-disabled-interpreters '("ipython"))
(setq shell-file-name (executable-find "bash"))
(setq-default vterm-shell (executable-find "fish"))
(setq-default explicit-shell-file-name (executable-find "fish"))

302
config.org Normal file
View File

@@ -0,0 +1,302 @@
#+title: Config
* General Settings
Honestly I barely remember what some of this stuff is supposed to do, this is the most ancient part of the config
#+BEGIN_SRC emacs-lisp
(setq backup-directory-alist '(("~/.emacs.d/backups"))
delete-old-versions nil
version-control t
vc-make-backup-files nil
auto-save-file-name-transforms '((".*" "~/.emacs.d/auto-save-list" t))
savehist-file "~/.emacs.d/savehist"
require-final-newline t
global-auto-revert-mode t
global-auto-revert-non-file-buffers t
auto-revert-verbose nil
custom-safe-themes t
mouse-autoselect-window t
focus-follows-mouse t
boymind-user "akko")
(fset 'yes-or-no-p 'y-or-n-p)
#+END_SRC
* Appearance
** Font
#+BEGIN_SRC emacs-lisp
(if (string= (system-name) "illya")
(set-frame-font "Monoflow 12" nil t)
(set-frame-font "Monoflow Medium 20" nil t))
(set-frame-font "Mononoki Medium 12")
#+END_SRC
** Theme
#+BEGIN_SRC emacs-lisp
(setq doom-theme 'doom-ayu-mirage)
#+END_SRC
** Other
#+BEGIN_SRC emacs-lisp
(display-time-mode 1)
#+END_SRC
* Keybindings
** General
#+BEGIN_SRC emacs-lisp
(define-key evil-normal-state-map (kbd ";") 'evil-ex)
(define-key evil-normal-state-map (kbd "g a") 'paste-above)
(define-key evil-normal-state-map (kbd "g p") 'paste-below)
(global-set-key (kbd "C-x C-f") #'counsel-find-file)
(map! :leader
"." #'counsel-find-file)
; TODO fix
(map! :after counsel "C-s" #'swiper)
(after! evil-escape
(setq evil-escape-key-sequence "jj")
(setq-default evil-escape-delay 0.2))
(which-key-mode 1)
(setq which-key-idle-delay 0.25)
(defun doom/find-file-in-private-config () (interactive) (counsel-find-file doom-user-dir))
#+END_SRC
* Completion
** Ivy
#+BEGIN_SRC emacs-lisp
(setq ivy-height 10
ivy-count-format "(%d/%d) "
ivy-use-virtual-buffers t
ivy-re-builders-alist '((t . ivy--regex-ignore-order))
ivy-initial-inputs-alist '((org-refile . "")
(org-capture-refile . "")
(counsel-M-x . "")
(counsel-describe-function . "")
(counsel-describe-variable . "")
(man . "")
(woman . ""))
ivy-read-action-function #'ivy-hydra-read-action)
#+END_SRC
** Yasnippet
#+BEGIN_SRC emacs-lisp
(setq yas-triggers-in-field t)
#+END_SRC
* Navigation
** Avy
#+BEGIN_SRC emacs-lisp
(setq avy-all-windows nil
avy-timeout-seconds 0.2
avy-keys '(?a ?s ?d ?f ?k ?l ?; ?g ?h
?q ?w ?e ?r ?t ?y ?i ?p
?A ?S ?D ?F ?J ?K ?L))
(define-key evil-normal-state-map (kbd "C-.") #'avy-goto-char-timer)
(setq aw-keys '(?a ?s ?d ?f ?k ?l ?; ?g ?h
?q ?w ?e ?r ?t ?y ?i ?p
?A ?S ?D ?F ?J ?K ?L))
#+END_SRC
** Projectile
*** TODO I forgot what this is supposed to do
#+BEGIN_SRC emacs-lisp
(defadvice projectile-project-root (around ignore-remote first activate)
(unless (file-remote-p default-directory) ad-do-it))
#+END_SRC
** Ace-window
Make ace-window work across frames
#+BEGIN_SRC emacs-lisp
(setq aw-scope 'global)
#+END_SRC
* Major modes
** web-mode
#+BEGIN_SRC emacs-lisp
(setq web-mode-script-padding 0
js-indent-level 2
js2-strict-missing-semi-warning nil
web-mode-markup-indent-offset 2
web-mode-code-indent-offset 2
web-mode-css-indent-offset 2)
#+END_SRC
** Python
#+BEGIN_SRC emacs-lisp
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "-i --simple-prompt")
(setq python-shell-completion-native-disabled-interpreters '("ipython"))
#+END_SRC
** Org
*** Roam
#+BEGIN_SRC emacs-lisp
(setq org-roam-directory (file-truename "/mnt/tenma/srv/boymind"))
; this seems to be broken right now
;(use-package! org-roam
; :config
; (setq org-roam-database-connector 'sqlite3))
(condition-case nil
(org-roam-db-autosync-mode)
(file-error (progn
(setq boymind/tenma-mounted nil)
(warn "Boymind mount failed.")))
(:success (setq boymind/tenma-mounted t)))
#+END_SRC
*** Boymind
#+BEGIN_SRC emacs-lisp
(when boymind/tenma-mounted
(org-babel-load-file (car (org-roam-id-find "d38fc8c3-651a-42e8-9ab7-33400f62a5b4")))
(boymind/setup "akko"))
#+END_SRC
*** General
#+BEGIN_SRC emacs-lisp
(setq org-startup-folded t)
#+END_SRC
** term-mode
#+BEGIN_SRC emacs-lisp
(add-hook 'term-mode-hook 'toggle-truncate-lines)
#+END_SRC
** typescript-mode
#+BEGIN_SRC emacs-lisp
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-tsx-mode))
#+END_SRC
* Minor modes
** treemacs
#+BEGIN_SRC emacs-lisp
(setq treemacs--width-is-locked nil)
#+END_SRC
** lsp
#+BEGIN_SRC emacs-lisp
(setq lsp-enable-links nil)
#+END_SRC
* Blog
#+BEGIN_SRC emacs-lisp
(require 'ox-publish)
(defun blog/get-util (x)
(with-temp-buffer
(insert-file-contents (concat "~/Blog/util/"
x))
(buffer-string)))
(setq org-html-metadata-timestamp-format "%Y-%m-%d")
;; Get project settings
(defun akko/blog-spec ()
"Return project settings for use with `org-publish-project-alist'."
(let* ((html-head (blog/get-util "head.html"))
(html-preamble (blog/get-util "preamble.html"))
(html-postamble (blog/get-util "postamble.html")))
`(
("pages"
:base-directory "~/Blog/org"
:base-extension "org"
:recursive t
:publishing-directory "~/Blog/html"
:publishing-function org-html-publish-to-html
:html-doctype "html5"
:html-html5-fancy t
:html-viewport ((width "100%")
(initial-scale "0.7")
(minimum-scale "")
(maximum-scale "")
(user-scalable ""))
:language "en"
:section-numbers nil
:with-toc nil
:with-date t
:with-title nil
:with-author nil
:auto-sitemap t
:sitemap-sort-files anti-chronologically
:sitemap-format-entry
(lambda (entry style project)
(cond ((not (directory-name-p entry))
(format
"[[file:%s][%s]]\n"
entry
(org-publish-find-title entry project)))
((eq style 'tree)
(capitalize (file-name-nondirectory (directory-file-name entry))))
(t entry)))
:headline-levels 4
:html-head ,html-head
:html-preamble ,html-preamble
:html-postamble (lambda (p)
(let* ((timestamp-format (plist-get p :html-metadata-timestamp-format))
(date (org-export-data (org-export-get-date p timestamp-format)
p))
(file (plist-get p :input-file))
(modified (format-time-string
timestamp-format
(and file (file-attribute-modification-time
(file-attributes file))))))
(concat
"<div id='footer'>"
(when (not (string-blank-p (format "%s" date)))
(format "<div id='publish-date'>Published: %s</div>" date))
(format "<div id='modified-date'>Last modified: %s</div>" modified)
,html-postamble
"</div>"))))
("static"
:base-directory "~/Blog/static"
:base-extension "css\\|txt\\|jpg\\|gif\\|png\\|ttf\\|js"
:recursive t
:publishing-directory "~/Blog/html/static"
:publishing-function org-publish-attachment)
("blog" :components ("pages" "static")))))
(setq org-publish-project-alist (akko/blog-spec))
(defun akko/publish-blog ()
(interactive)
(setq org-publish-project-alist (akko/blog-spec))
(org-publish-all))
(defun akko/force-publish-blog ()
(interactive)
(setq org-publish-project-alist (akko/blog-spec))
(org-publish-remove-all-timestamps)
(org-publish-all))
(map! :leader
(:prefix-map
("a" . "akko")
:desc "Publish Blog"
"b" #'akko/publish-blog
:desc "Force Publish Blog"
"f" #'akko/force-publish-blog))
(setq org-html-htmlize-output-type 'css)
(setq org-html-htmlize-font-prefix "org-")
(set-file-template! "/Blog/org/posts/.+\\.org"
:trigger "__blog")
(defun akko/org-current-time-string ()
(with-temp-buffer
(org-mode)
(org-time-stamp '(16))
(buffer-substring (point-min) (point-max))))
#+END_SRC
* Fixes
** Emacs doesn't play well with fish shell
#+BEGIN_SRC emacs-lisp
(setq shell-file-name (executable-find "bash"))
(setq-default vterm-shell (executable-find "fish"))
(setq-default explicit-shell-file-name (executable-find "fish"))
#+END_SRC

View File

@@ -3,9 +3,45 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-agenda-files '("~/org/tasks.org" "~/todo.org"))
'(elcord-editor-icon "emacs_icon")
'(elcord-idle-message "Conquering the Pyu city-states...")
'(elcord-mode t nil (elcord))
'(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
'(package-selected-packages
'(polymode fish-mode solidity-mode yaml-mode bison-mode graphql-mode arduino-mode gdscript-mode speed-type ivy-posframe lsp-haskell treemacs key-chord))
'(safe-local-variable-values
'((eval company-mode nil)
(org-todo-keyword-faces
("DIRE" . "red")
("MEH" . "orange")
("GOOD" . "green")
("AWESOME" . "purple")
("UNFILLED" . "white"))
(org-todo-keyword-faces
("DIRE" . "red")
("MEH" . "orange")
("GOOD" . "green")
("AWESOME" . "purple")
("UNFILLED" . pink))
(org-todo-keyword-faces
("DIRE" . "red")
("MEH" . "orange")
("GOOD" . "green")
("AWESOME" . "purple")
("UNFILLED" . grey))
(org-todo-keyword-faces
("DIRE" . "red")
("MEH" . "orange")
("GOOD" . "green")
("AWESOME" . "purple")
("UNFILLED" . white))
(org-todo-keyword-faces
("DIRE" . "red")
("MEH" . "orange")
("GOOD" . "green")
("AWESOME" . "purple"))
(org-todo-keyword-faces
("DIRE" . "red"))))
'(warning-suppress-log-types
'((lsp-completion-mode-hook)
(lsp-completion-mode-hook)
@@ -20,6 +56,8 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
'(ledger-font-posting-account-face ((t (:foreground "gray"))))
'(org-scheduled-previously ((t (:foreground "#cbccc6"))))
'(org-scheduled-today ((t (:foreground "gray")))))
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)

30
init.el
View File

@@ -20,6 +20,9 @@
+prescient
+icons)
vertico ;;todo checkout
:checkers
syntax
@@ -27,7 +30,7 @@
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;fill-column ; a `fill-column' indicator
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
@@ -84,7 +87,7 @@
;;direnv
;;docker
editorconfig ; let someone else argue about tabs vs spaces
ein ; tame Jupyter notebooks with emacs
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
flycheck ; tasing you for every semicolon you forget
;;flyspell ; tasing you for misspelling mispelling
@@ -101,7 +104,7 @@
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
rgb ; creating color strings
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;upload ; map local to remote projects via ssh/ftp
@@ -111,8 +114,8 @@
;;agda ; types of types of types of types...
;;assembly ; assembly for fun or debugging
cc ; C/C++/Obj-C madness
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
(clojure +lsp) ; java with a lisp
common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
@@ -126,7 +129,7 @@
;;fsharp ; ML stands for Microsoft's Language
;;go ; the hipster dialect
(haskell +lsp) ; a language that's lazier than I am
hy ; readability of scheme w/ speed of python
;;hy ; readability of scheme w/ speed of python
;;idris ;
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
(javascript +lsp) ; all(hope(abandon(ye(who(enter(here))))))
@@ -134,7 +137,7 @@
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean
;;ledger ; an accounting system in Emacs
ledger ; an accounting system in Emacs
lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
@@ -155,20 +158,21 @@
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
(python ; beautiful is better than ugly
;; +conda
+lsp)
qt ; the 'cutest' gui framework ever
racket ; a DSL for DSLs
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
scheme ; a fully conniving family of lisps
(sh +fish +lsp) ; she sells {ba,z,fi}sh shells on the C xor
solidity ; do you need a blockchain? No.
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
web ; the tubes
(web +lsp) ; the tubes
:email
;;(mu4e +gmail)
@@ -183,6 +187,6 @@
;;write ; emacs for writers (fiction, notes, papers, etc.)
:config
;;literate
literate
(default +bindings +smartparens)
)

1
lisp/eaf Submodule

Submodule lisp/eaf added at 46733de03b

1
lisp/eaf-browser Submodule

Submodule lisp/eaf-browser added at 1c0076cca2

View File

@@ -0,0 +1,68 @@
;;; ob-ledger.el --- Babel Functions for Ledger -*- lexical-binding: t; -*-
;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
;; Author: Eric S Fraga
;; Keywords: literate programming, reproducible research, accounting
;; Homepage: https://orgmode.org
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Org-Babel support for evaluating ledger entries.
;;
;; This differs from most standard languages in that
;;
;; 1) there is no such thing as a "session" in ledger
;;
;; 2) we are generally only going to return output from the ledger program
;;
;; 3) we are adding the "cmdline" header argument
;;
;; 4) there are no variables
;;; Code:
(require 'ob)
(defvar org-babel-default-header-args:ledger
'((:results . "output") (:cmdline . "bal"))
"Default arguments to use when evaluating a ledger source block.")
(defun org-babel-execute:ledger (body params)
"Execute a block of Ledger entries with org-babel. This function is
called by `org-babel-execute-src-block'."
(message "executing Ledger source code block")
(let ((cmdline (cdr (assq :cmdline params)))
(in-file (org-babel-temp-file "ledger-"))
(out-file (org-babel-temp-file "ledger-output-")))
(with-temp-file in-file (insert body))
(message "%s" (concat "ledger"
" -f " (org-babel-process-file-name in-file)
" " cmdline))
(with-output-to-string
(shell-command (concat "ledger"
" -f " (org-babel-process-file-name in-file)
" " cmdline
" > " (org-babel-process-file-name out-file))))
(with-temp-buffer (insert-file-contents out-file) (buffer-string))))
(defun org-babel-prep-session:ledger (_session _params)
(error "Ledger does not support sessions"))
(provide 'ob-ledger)
;;; ob-ledger.el ends here

View File

@@ -8,5 +8,12 @@
(package! key-chord)
(package! which-key)
(package! org-mode :recipe (:repo "https://code.orgmode.org/bzg/org-mode.git"))
(add-to-list 'load-path "./elfiles")
(package! ledger-mode)
(package! ob-ledger :recipe (:local-repo "lisp/ob-ledger"))
(package! elcord)
(package! emacsql-sqlite3)
(package! sly-overlay
:recipe (:host sourcehut :repo "fosskers/sly-overlay") :pin "916b50297a1f3bb110f840b89b8717d194623e5f")

11
snippets/org-mode/acc Normal file
View File

@@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# -*- time-stamp-active: nil; -*-
# name: accounting block
# uuid: acc
# trigger: acc
# condition: t
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
# --
`(format-time-string "%Y")`/$1/$2 $3
acc_entry$0

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# -*- time-stamp-active: nil; -*-
# name: accounting entry
# uuid: acc_entry
# trigger: acc_entry
# condition: t
# expand-env: ((yas-indent-line nil) (yas-wrap-around-region 'nil)
# --
$1 €$2
${3:$$(yas-choose-value '("acc_entry" "Assets:Bank:Kahr:Primary\n" "Liabilities:Credit Card:Kahr:Main\n"))}$0