changes
This commit is contained in:
274
config.el
274
config.el
@@ -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,39 @@
|
||||
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)
|
||||
|
||||
(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 "Mononoki 12" nil t)
|
||||
(set-frame-font "Mononoki 22" nil t))
|
||||
|
||||
(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,93 +52,99 @@
|
||||
(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-font "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 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)
|
||||
|
||||
(which-key-mode 1)
|
||||
(setq which-key-idle-delay 0.25)
|
||||
(setq python-shell-interpreter "ipython"
|
||||
python-shell-interpreter-args "-i --simple-prompt")
|
||||
(setq python-shell-completion-native-disabled-interpreters '("ipython"))
|
||||
|
||||
(setq org-startup-folded t)
|
||||
|
||||
(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))
|
||||
(org-roam-db-autosync-mode)
|
||||
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((ledger . t)
|
||||
))
|
||||
|
||||
(setq akko/org-agenda-path (car (org-roam-id-find "7f9b4c89-d527-43be-8f6b-47658d87cc87"))
|
||||
akko/org-tickler-path (car (org-roam-id-find "efe09517-236c-4665-af62-abfd5951a172"))
|
||||
akko/org-projects-path (car (org-roam-id-find "36cd8b7e-8853-4986-8b1d-a186aa75a204"))
|
||||
akko/org-inbox-path (car (org-roam-id-find "251c9862-a97c-4652-b9ee-6fcfc953cf5c"))
|
||||
akko/org-someday-path (car (org-roam-id-find "22caafc8-f319-4d8a-ae64-534b1568e02e")))
|
||||
|
||||
(setq org-refile-targets '((akko/org-projects-path :maxlevel . 3)
|
||||
(akko/org-someday-path :level . 1)
|
||||
(akko/org-tickler-path :maxlevel . 2)))
|
||||
|
||||
(setq org-refile-use-outline-path 'title)
|
||||
|
||||
(setq org-agenda-files (list akko/org-agenda-path
|
||||
akko/org-tickler-path
|
||||
akko/org-projects-path))
|
||||
(setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
|
||||
|
||||
(setq org-agenda-custom-commands
|
||||
'(("p" "Projects" alltodo ""
|
||||
((org-agenda-overriding-header "Projects")
|
||||
(org-agenda-skip-function #'akko/org-agenda-skip-all-siblings-but-first)
|
||||
(org-agenda-files (list akko/org-projects-path))
|
||||
(org-agenda-prefix-format '((todo . " %i %b")))))))
|
||||
|
||||
(defun akko/org-agenda-skip-all-siblings-but-first ()
|
||||
"Skip all but the first non-done entry."
|
||||
(let (should-skip-entry)
|
||||
(unless (org-current-is-todo)
|
||||
(setq should-skip-entry t))
|
||||
(save-excursion
|
||||
(while (and (not should-skip-entry) (org-goto-sibling t))
|
||||
(when (org-current-is-todo)
|
||||
(setq should-skip-entry t))))
|
||||
(when should-skip-entry
|
||||
(or (outline-next-heading)
|
||||
(goto-char (point-max))))))
|
||||
|
||||
(defun org-current-is-todo ()
|
||||
(string= "TODO" (org-get-todo-state)))
|
||||
|
||||
(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-ayu-mirage)
|
||||
|
||||
(display-time-mode 1)
|
||||
|
||||
|
||||
(global-set-key (kbd "C-x C-f") #'counsel-find-file)
|
||||
(map! :leader
|
||||
"." #'counsel-find-file)
|
||||
|
||||
(after! evil-escape
|
||||
(setq evil-escape-key-sequence "jj")
|
||||
(setq-default evil-escape-delay 0.2))
|
||||
|
||||
(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)
|
||||
@@ -252,76 +261,3 @@
|
||||
(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 org-roam-directory (file-truename "/mnt/tenma/srv/boymind"))
|
||||
(org-roam-db-autosync-mode)
|
||||
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((ledger . t)
|
||||
))
|
||||
|
||||
(require 'elcord)
|
||||
(elcord-mode)
|
||||
|
||||
(use-package! org-roam
|
||||
:config
|
||||
(setq org-roam-database-connector 'sqlite3))
|
||||
|
||||
(setq akko/org-agenda-path (car (org-roam-id-find "7f9b4c89-d527-43be-8f6b-47658d87cc87"))
|
||||
akko/org-tickler-path (car (org-roam-id-find "efe09517-236c-4665-af62-abfd5951a172"))
|
||||
akko/org-projects-path (car (org-roam-id-find "36cd8b7e-8853-4986-8b1d-a186aa75a204"))
|
||||
akko/org-inbox-path (car (org-roam-id-find "251c9862-a97c-4652-b9ee-6fcfc953cf5c"))
|
||||
akko/org-someday-path (car (org-roam-id-find "22caafc8-f319-4d8a-ae64-534b1568e02e")))
|
||||
|
||||
(setq org-agenda-files (list akko/org-agenda-path
|
||||
akko/org-tickler-path
|
||||
akko/org-projects-path
|
||||
akko/org-inbox-path
|
||||
akko/org-someday-path))
|
||||
|
||||
(setq org-roam-capture-templates '(("d" "default" plain "%?"
|
||||
:target (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
|
||||
"#+title: ${title}\n")
|
||||
:unnarrowed t)
|
||||
("i" "inbox" plain "* %?"
|
||||
:target (node "inbox")
|
||||
:unnarrowed t)))
|
||||
|
||||
(setq org-refile-targets
|
||||
(list akko/org-projects-path akko/org-someday-path akko/org-tickler-path))
|
||||
|
||||
(setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
|
||||
|
||||
(setq org-agenda-custom-commands
|
||||
'(("p" "Projects" alltodo ""
|
||||
((org-agenda-overriding-header "Projects")
|
||||
(org-agenda-skip-function #'akko/org-agenda-skip-all-siblings-but-first)
|
||||
(org-agenda-files (list akko/org-projects-path))
|
||||
(org-agenda-prefix-format '((todo . " %i %b")))))))
|
||||
|
||||
(defun akko/org-agenda-skip-all-siblings-but-first ()
|
||||
"Skip all but the first non-done entry."
|
||||
(let (should-skip-entry)
|
||||
(unless (org-current-is-todo)
|
||||
(setq should-skip-entry t))
|
||||
(save-excursion
|
||||
(while (and (not should-skip-entry) (org-goto-sibling t))
|
||||
(when (org-current-is-todo)
|
||||
(setq should-skip-entry t))))
|
||||
(when should-skip-entry
|
||||
(or (outline-next-heading)
|
||||
(goto-char (point-max))))))
|
||||
|
||||
(defun org-current-is-todo ()
|
||||
(string= "TODO" (org-get-todo-state)))
|
||||
|
323
config.org
Normal file
323
config.org
Normal file
@@ -0,0 +1,323 @@
|
||||
#+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)
|
||||
|
||||
(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 "Mononoki 12" nil t)
|
||||
(set-frame-font "Mononoki 22" nil t))
|
||||
#+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
|
||||
|
||||
* 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
|
||||
*** General
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq org-startup-folded t)
|
||||
#+END_SRC
|
||||
|
||||
*** 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))
|
||||
(org-roam-db-autosync-mode)
|
||||
#+END_SRC
|
||||
*** Accounting
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((ledger . t)
|
||||
))
|
||||
#+END_SRC
|
||||
*** GTD
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq akko/org-agenda-path (car (org-roam-id-find "7f9b4c89-d527-43be-8f6b-47658d87cc87"))
|
||||
akko/org-tickler-path (car (org-roam-id-find "efe09517-236c-4665-af62-abfd5951a172"))
|
||||
akko/org-projects-path (car (org-roam-id-find "36cd8b7e-8853-4986-8b1d-a186aa75a204"))
|
||||
akko/org-inbox-path (car (org-roam-id-find "251c9862-a97c-4652-b9ee-6fcfc953cf5c"))
|
||||
akko/org-someday-path (car (org-roam-id-find "22caafc8-f319-4d8a-ae64-534b1568e02e")))
|
||||
|
||||
(setq org-refile-targets '((akko/org-projects-path :maxlevel . 3)
|
||||
(akko/org-someday-path :level . 1)
|
||||
(akko/org-tickler-path :maxlevel . 2)))
|
||||
|
||||
(setq org-refile-use-outline-path 'title)
|
||||
|
||||
(setq org-agenda-files (list akko/org-agenda-path
|
||||
akko/org-tickler-path
|
||||
akko/org-projects-path))
|
||||
(setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
|
||||
|
||||
(setq org-agenda-custom-commands
|
||||
'(("p" "Projects" alltodo ""
|
||||
((org-agenda-overriding-header "Projects")
|
||||
(org-agenda-skip-function #'akko/org-agenda-skip-all-siblings-but-first)
|
||||
(org-agenda-files (list akko/org-projects-path))
|
||||
(org-agenda-prefix-format '((todo . " %i %b")))))))
|
||||
|
||||
(defun akko/org-agenda-skip-all-siblings-but-first ()
|
||||
"Skip all but the first non-done entry."
|
||||
(let (should-skip-entry)
|
||||
(unless (org-current-is-todo)
|
||||
(setq should-skip-entry t))
|
||||
(save-excursion
|
||||
(while (and (not should-skip-entry) (org-goto-sibling t))
|
||||
(when (org-current-is-todo)
|
||||
(setq should-skip-entry t))))
|
||||
(when should-skip-entry
|
||||
(or (outline-next-heading)
|
||||
(goto-char (point-max))))))
|
||||
|
||||
(defun org-current-is-todo ()
|
||||
(string= "TODO" (org-get-todo-state)))
|
||||
#+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 ("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))))
|
||||
#+END_SRC
|
@@ -6,7 +6,7 @@
|
||||
'(elcord-editor-icon "emacs_icon")
|
||||
'(elcord-idle-message "Conquering the Pyu city-states...")
|
||||
'(elcord-mode t nil (elcord))
|
||||
'(org-agenda-files '("~/org/tasks.org" "~/todo.org"))
|
||||
'(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))
|
||||
'(warning-suppress-log-types
|
||||
@@ -23,6 +23,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.
|
||||
'(org-scheduled-previously ((t (:foreground "#cbccc6")))))
|
||||
'(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)
|
||||
|
4
init.el
4
init.el
@@ -111,7 +111,7 @@
|
||||
;;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
|
||||
(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
|
||||
@@ -184,6 +184,6 @@
|
||||
;;write ; emacs for writers (fiction, notes, papers, etc.)
|
||||
|
||||
:config
|
||||
;;literate
|
||||
literate
|
||||
(default +bindings +smartparens)
|
||||
)
|
||||
|
11
snippets/org-mode/acc
Normal file
11
snippets/org-mode/acc
Normal 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
|
10
snippets/org-mode/acc_entry
Normal file
10
snippets/org-mode/acc_entry
Normal 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
|
Reference in New Issue
Block a user