aboutsummaryrefslogtreecommitdiff
path: root/config/emacs.org
diff options
context:
space:
mode:
Diffstat (limited to 'config/emacs.org')
-rw-r--r--config/emacs.org557
1 files changed, 254 insertions, 303 deletions
diff --git a/config/emacs.org b/config/emacs.org
index 2010d2c..71c56ef 100644
--- a/config/emacs.org
+++ b/config/emacs.org
@@ -15,190 +15,167 @@ Change these variables:
(setq system-username "prestonpan")
(setq system-fullname "Preston Pan")
#+end_src
-** UI Elements
-This section contains important UI elements and starting customization variables to make
-emacs work in a semi-sane way and make it not look ugly:
-#+begin_src emacs-lisp
- (require 'tex-site)
- (pixel-scroll-precision-mode 1)
- (setq scroll-conservatively 101)
- (display-battery-mode 1)
- (setq display-time-24hr-format t)
- (display-time-mode 1)
- (menu-bar-mode -1)
- (scroll-bar-mode -1)
- (tool-bar-mode -1)
- (load-theme 'catppuccin :no-confirm)
- (setq display-line-numbers-type 'relative)
- (add-hook 'prog-mode-hook #'display-line-numbers-mode)
- (add-hook 'org-mode-hook #'display-line-numbers-mode)
- (setq org-confirm-babel-evaluate nil)
- (set-face-attribute 'default nil :height 120)
- (setq use-short-answers t)
- (setq make-backup-files nil)
- (setq org-export-with-broken-links t)
- (setq org-src-fontify-natively t)
- ;; (setq org-highlight-latex-and-related '(latex script entities))
- (setq warning-minimum-level :emergency)
- (add-hook 'text-mode-hook 'visual-line-mode)
- (and window-system (server-start))
- (setq debug-ignored-errors
- (cons 'remote-file-error debug-ignored-errors))
- (set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 140)
- (setq preview-default-option-list '("displaymath" "textmath" "graphics"))
- (setq preview-image-type 'png)
- (setq org-latex-pdf-process
- '("xelatex -interaction=nonstopmode -output-directory=%o %f"))
- (setq org-latex-preview-image-directory (expand-file-name "~/.cache/ltximg/"))
- (setq org-preview-latex-image-directory (expand-file-name "~/.cache/ltximg/"))
- (setq-default line-spacing 2)
- (setq org-startup-with-latex-preview t)
- (setq-default org-startup-indented t
- org-pretty-entities t
- org-use-sub-superscripts "{}"
- org-hide-emphasis-markers t
- org-startup-with-inline-images t
- org-image-actual-width '(300))
-
- (setq-default fill-column 100)
- (add-hook 'text-mode-hook #'auto-fill-mode)
- (add-hook 'prog-mode-hook #'auto-fill-mode)
- (add-hook 'org-mode-hook #'auto-fill-mode)
-
- (setopt display-fill-column-indicator-column 100)
- (add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
- (add-hook 'org-mode-hook #'display-fill-column-indicator-mode)
- (setq TeX-engine 'xetex)
+** Emacs
+#+begin_src emacs-lisp
+ (use-package emacs
+ :custom
+ (scroll-conservatively 101)
+ (display-time-24hr-format t)
+ (display-line-numbers-type 'relative)
+ (use-short-answers t)
+ (make-backup-files nil)
+ (warning-minimum-level :emergency)
+ (debug-ignored-errors
+ (cons 'remote-file-error debug-ignored-errors))
+ (mouse-wheel-scroll-amount '(1 ((shift) . 1)))
+ (mouse-wheel-progressive-speed nil)
+ (mouse-wheel-follow-mouse 't)
+ (scroll-step 1)
+ (display-fill-column-indicator-column 100)
+ :config
+ (require 'tex-site)
+ (pixel-scroll-precision-mode 1)
+ (display-battery-mode 1)
+ (display-time-mode 1)
+ (menu-bar-mode -1)
+ (scroll-bar-mode -1)
+ (tool-bar-mode -1)
+ (and window-system (server-start))
+ (load-theme 'catppuccin :no-confirm)
+ (set-face-attribute 'default nil :height 120)
+ (set-frame-parameter nil 'alpha-background 90)
+ (add-to-list 'default-frame-alist '(alpha-background . 90))
+ (set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 140)
+ (setq-default line-spacing 2)
+ (setq-default fill-column 100)
+ (global-prettify-symbols-mode 1)
- (add-hook 'prog-mode-hook
- (lambda ()
- (setq prettify-symbols-alist
- '(("lambda" . ?λ)
- ("->" . ?→)
- ("map" . ?↦)
- ("/=" . ?≠)
- ("!=" . ?≠)
- ("==" . ?≡)
- ("<=" . ?≤)
- (">=" . ?≥)
- ("&&" . ?∧)
- ("||" . ?∨)
- ("sqrt" . ?√)
- ("..." . ?…)))
- (prettify-symbols-mode)))
+ :hook ((text-mode . auto-fill-mode)
+ (text-mode . visual-line-mode)
+ (prog-mode . auto-fill-mode)
+ (prog-mode . display-line-numbers-mode)
+ (prog-mode . display-fill-column-indicator-mode)
+ (org-mode . auto-fill-mode)
+ (org-mode . display-fill-column-indicator-mode)
- (add-hook 'org-mode-hook (lambda ()
- (setq prettify-symbols-alist
- '(("#+begin_src" . ?)
- ("#+BEGIN_SRC" . ?)
- ("#+end_src" . ?)
- ("#+END_SRC" . ?)
- ("#+begin_example" . ?)
- ("#+BEGIN_EXAMPLE" . ?)
- ("#+end_example" . ?)
- ("#+END_EXAMPLE" . ?)
- ("#+header:" . ?)
- ("#+HEADER:" . ?)
- ("#+name:" . ?﮸)
- ("#+NAME:" . ?﮸)
- ("#+results:" . ?)
- ("#+RESULTS:" . ?)
- ("#+call:" . ?)
- ("#+CALL:" . ?)
- (":PROPERTIES:" . ?)
- (":properties:" . ?)
- ("lambda" . ?λ)
- ("->" . ?→)
- ("map" . ?↦)
- ("/=" . ?≠)
- ("!=" . ?≠)
- ("==" . ?≡)
- ("<=" . ?≤)
- (">=" . ?≥)
- ("&&" . ?∧)
- ("||" . ?∨)
- ("sqrt" . ?√)
- ("..." . ?…))))
- (prettify-symbols-mode))
- (global-prettify-symbols-mode 1)
+ (org-mode . (lambda ()
+ (setq prettify-symbols-alist
+ '(("#+begin_src" . ?)
+ ("#+BEGIN_SRC" . ?)
+ ("#+end_src" . ?)
+ ("#+END_SRC" . ?)
+ ("#+begin_example" . ?)
+ ("#+BEGIN_EXAMPLE" . ?)
+ ("#+end_example" . ?)
+ ("#+END_EXAMPLE" . ?)
+ ("#+header:" . ?)
+ ("#+HEADER:" . ?)
+ ("#+name:" . ?﮸)
+ ("#+NAME:" . ?﮸)
+ ("#+results:" . ?)
+ ("#+RESULTS:" . ?)
+ ("#+call:" . ?)
+ ("#+CALL:" . ?)
+ (":PROPERTIES:" . ?)
+ (":properties:" . ?)
+ ("lambda" . ?λ)
+ ("->" . ?→)
+ ("map" . ?↦)
+ ("/=" . ?≠)
+ ("!=" . ?≠)
+ ("==" . ?≡)
+ ("<=" . ?≤)
+ (">=" . ?≥)
+ ("&&" . ?∧)
+ ("||" . ?∨)
+ ("sqrt" . ?√)
+ ("..." . ?…)))
+ (prettify-symbols-mode)))
+ (prog-mode .
+ (lambda ()
+ (setq prettify-symbols-alist
+ '(("lambda" . ?λ)
+ ("->" . ?→)
+ ("map" . ?↦)
+ ("/=" . ?≠)
+ ("!=" . ?≠)
+ ("==" . ?≡)
+ ("<=" . ?≤)
+ (">=" . ?≥)
+ ("&&" . ?∧)
+ ("||" . ?∨)
+ ("sqrt" . ?√)
+ ("..." . ?…)))
+ (prettify-symbols-mode)))))
+#+end_src
+** Org Mode
+#+begin_src emacs-lisp
+ (use-package org
+ :init
+ (setq org-confirm-babel-evaluate nil)
+ (setq org-export-with-broken-links t)
+ (setq org-src-fontify-natively t)
+ (setq org-latex-preview-image-directory (expand-file-name "~/.cache/ltximg/"))
+ (setq org-preview-latex-image-directory (expand-file-name "~/.cache/ltximg/"))
+ (setq org-latex-pdf-process
+ '("xelatex -interaction=nonstopmode -output-directory=%o %f"))
+ (setq preview-default-option-list '("displaymath" "textmath" "graphics"))
+ (setq preview-image-type 'png)
+ (setq TeX-engine 'xetex)
+ (setq TeX-PDF-mode t)
+ (setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
+ (setq org-return-follows-link t)
+ (setq org-startup-with-latex-preview t)
+ (setq org-habit-preceding-days 1)
+ (setq-default org-startup-indented t
+ org-pretty-entities t
+ org-use-sub-superscripts "{}"
+ org-hide-emphasis-markers t
+ org-startup-with-inline-images t
+ org-image-actual-width '(300))
+ (setq org-agenda-files (list "~/org/agenda.org"
+ "~/org/notes.org"
+ "~/org/website/agenda.org"))
+ (setq org-default-notes-file (concat org-directory "/notes.org"))
+ (setq org-publish-project-alist
+ '(("website-org"
+ :base-directory "~/org/website"
+ :base-extension "org"
+ :publishing-directory "~/website_html"
+ :recursive t
+ :publishing-function org-html-publish-to-html
+ :headline-levels 4
+ :html-preamble t
+ :html-preamble-format (("en" "<p class=\"preamble\"><a href=\"/index.html\">home</a> | <a href=\"./index.html\">section main page</a></p><hr>")))
+ ("website-static"
+ :base-directory "~/org/website"
+ :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|ico\\|asc\\|pub\\|webmanifest\\|xml"
+ :publishing-directory "~/website_html/"
+ :recursive t
+ :publishing-function org-publish-attachment)
+ ("website" :auto-sitemap t :components ("website-org" "website-static"))))
+ (setq org-html-postamble "Copyright © 2024 Preston Pan")
+ :config
+ (require 'ox-publish)
+ (require 'org-tempo)
+ (require 'org-habit)
+ (org-babel-do-load-languages 'org-babel-load-languages
+ '((shell . t)
+ (python . t)
+ (latex . t))))
#+end_src
* Unicode
#+begin_src emacs-lisp
(use-package unicode-fonts
:init (unicode-fonts-setup))
#+end_src
-
-* Transparency
-My NixOS configuration uses Hyprland to make things transparent:
-#+begin_src emacs-lisp
- (set-frame-parameter nil 'alpha-background 90)
- (add-to-list 'default-frame-alist '(alpha-background . 90))
-#+end_src
-* Scrolling
-Make emacs scroll in a sane way:
-#+begin_src emacs-lisp
- (setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
- (setq mouse-wheel-progressive-speed nil)
- (setq mouse-wheel-follow-mouse 't)
- (setq scroll-step 1)
-#+end_src
-* Agenda
-Configure org agenda variables:
-#+begin_src emacs-lisp
- (require 'org-habit)
- (setq org-agenda-files (list "~/org/agenda.org"
- "~/org/notes.org"
- "~/org/website/agenda.org"))
- (setq org-default-notes-file (concat org-directory "/notes.org"))
- (setq org-habit-preceding-days 1)
-#+end_src
-* Publishing
-This is the configuration required to publish my website:
-#+begin_src emacs-lisp
- (require 'ox-publish)
- (setq org-publish-project-alist
- '(("website-org"
- :base-directory "~/org/website"
- :base-extension "org"
- :publishing-directory "~/website_html"
- :recursive t
- :publishing-function org-html-publish-to-html
- :headline-levels 4
- :html-preamble t
- :html-preamble-format (("en" "<p class=\"preamble\"><a href=\"/index.html\">home</a> | <a href=\"./index.html\">section main page</a></p><hr>")))
- ("website-static"
- :base-directory "~/org/website"
- :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|ico\\|asc\\|pub\\|webmanifest\\|xml"
- :publishing-directory "~/website_html/"
- :recursive t
- :publishing-function org-publish-attachment)
- ("website" :auto-sitemap t :components ("website-org" "website-static"))))
- (setq org-html-postamble "Copyright © 2024 Preston Pan")
-#+end_src
* Autopair
Use electric-pair to automatically complete pairs of things. We need to change
what electric-pair does based on the mode.
#+begin_src emacs-lisp
- (defun electric-pair ()
- "If at end of line, insert character pair without surrounding spaces.
- Otherwise, just insert the typed character."
- (interactive)
- (if (eolp) (let (parens-require-spaces) (insert-pair)) (self-insert-command 1)))
-
- (add-hook 'org-mode-hook
- (lambda ()
- (define-key org-mode-map "\"" 'electric-pair)
- (define-key org-mode-map "(" 'electric-pair)
- (define-key org-mode-map "[" 'electric-pair)
- (define-key org-mode-map "{" 'electric-pair)))
-
- (add-hook 'prog-mode-hook
- (lambda ()
- (define-key prog-mode-map "\"" 'electric-pair)
- (define-key prog-mode-map "(" 'electric-pair)
- (define-key prog-mode-map "[" 'electric-pair)
- (define-key prog-mode-map "{" 'electric-pair)))
- (electric-pair-mode)
+ (use-package electric-pair
+ :hook ((org-mode . electric-pair-mode)
+ (prog-mode . electric-pair-mode)))
#+end_src
* Lyrics
#+begin_src emacs-lisp
@@ -218,45 +195,34 @@ what electric-pair does based on the mode.
(use-package yasnippet
:config
(add-to-list 'yas-snippet-dirs "~/org/website/yasnippet/")
- (yas-global-mode 1))
- (add-hook 'org-mode-hook
- (lambda () (yas-minor-mode)
- (yas-activate-extra-mode 'latex-mode)))
+ (yas-global-mode 1)
+ :hook (org-mode . (lambda () (yas-minor-mode) (yas-activate-extra-mode 'latex-mode))))
#+end_src
* Completion
Company-mode! We need this to do autocomplete stuff.
#+begin_src emacs-lisp
- (eval-after-load "company" '(add-to-list 'company-backends
- '(company-ispell company-capf company-irony
- company-yasnippet company-files)))
- (add-hook 'after-init-hook 'global-company-mode)
+ (use-package company
+ :config
+ '(add-to-list 'company-backends
+ '(company-ispell company-capf company-irony
+ company-yasnippet company-files))
+ :hook ((after-init . global-company-mode)))
+#+end_src
+* Spelling
+#+begin_src emacs-lisp
(use-package ispell
:init
(setq ispell-program-name "aspell")
(setq ispell-silently-savep t)
(setq ispell-dictionary "en")
(setq ispell-alternate-dictionary "~/.local/share/dict"))
-#+end_src
-* Spelling
-#+begin_src emacs-lisp
-(dolist (hook '(text-mode-hook))
- (add-hook hook (lambda () (flyspell-mode 1))))
-#+end_src
-* Org Babel
-For some reason, org-babel doesn't load these languages by default:
-#+begin_src emacs-lisp
- (org-babel-do-load-languages 'org-babel-load-languages
- '(
- (shell . t)
- (python . t)
- (latex . t)
- )
- )
+
+ (use-package flyspell
+ :hook (text-mode . flyspell-mode))
#+end_src
* Packages
First, some small configurations and some evil-mode initilaization because I like vim keybindings:
#+begin_src emacs-lisp
- (require 'org-tempo)
(use-package evil
:init
(setq evil-want-keybinding nil)
@@ -265,6 +231,7 @@ First, some small configurations and some evil-mode initilaization because I lik
(evil-set-undo-system 'undo-redo))
(use-package evil-collection
+ :after (evil)
:init
(setq evil-want-keybinding nil)
:config
@@ -275,11 +242,12 @@ First, some small configurations and some evil-mode initilaization because I lik
(define-key evil-motion-state-map (kbd "TAB") nil))
(use-package evil-commentary
+ :after (evil)
:config
(evil-commentary-mode))
(use-package evil-org
- :after org
+ :after (evil org)
:hook (org-mode . (lambda () evil-org-mode))
:config
(require 'evil-org-agenda)
@@ -314,8 +282,7 @@ I use org-journal to journal about my life, and it's a part of my website:
(setq org-journal-file-header 'org-journal-file-header-func)
(setq org-journal-file-format "%Y%m%d.org")
- (setq org-journal-enable-agenda-integration t)
- )
+ (setq org-journal-enable-agenda-integration t))
#+end_src
** Doom Modeline
The default modeline is ugly.
@@ -327,18 +294,15 @@ The default modeline is ugly.
** Grammar
I want to write good!
#+begin_src emacs-lisp
- (use-package writegood-mode)
-
-(dolist (hook '(text-mode-hook))
- (add-hook hook (lambda () (writegood-mode))))
+(use-package writegood-mode
+ :hook (text-mode . writegood-mode))
#+end_src
** Make Org Look Better
Org superstar adds those nice looking utf-8 bullets:
#+begin_src emacs-lisp
(use-package org-superstar
:after (org)
- :config
- (add-hook 'org-mode-hook (lambda () (org-superstar-mode 1))))
+ :hook (org-mode . (lambda () (org-superstar-mode 1))))
#+end_src
** LSP
We set up eglot, the LSP manager for emacs, now built in:
@@ -346,8 +310,8 @@ We set up eglot, the LSP manager for emacs, now built in:
(use-package eglot
:config
(add-to-list 'eglot-server-programs '(nix-mode . ("nil")))
- (add-hook 'prog-mode-hook 'eglot-ensure)
:hook
+ (prog-mode . eglot-ensure)
(nix-mode . eglot-ensure))
(use-package lsp
:hook
@@ -357,15 +321,15 @@ We set up eglot, the LSP manager for emacs, now built in:
#+end_src
*** C/C++
#+begin_src emacs-lisp
- (use-package irony-mode
- :config
- (add-hook 'c++-mode-hook 'irony-mode)
- (add-hook 'c-mode-hook 'irony-mode)
- (add-hook 'objc-mode-hook 'irony-mode)
- (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
+ (use-package irony-mode
+ :hook (
+ (c++-mode . irony-mode)
+ (c-mode . irony-mode)
+ (objc-mode . irony-mode)
+ (irony-mode . irony-cdb-autosetup-compile-options)))
- (use-package irony-eldoc
- :config (add-hook 'irony-mode-hook #'irony-eldoc))
+ (use-package irony-eldoc
+ :hook ((irony-mode . irony-eldoc)))
#+end_src
*** Solidity
For writing solidity:
@@ -377,9 +341,8 @@ For writing solidity:
(setq solidity-flycheck-solc-checker-active t))
(use-package flycheck
- :init (global-flycheck-mode))
+ :config (global-flycheck-mode))
#+end_src
-
** Projectile
Manages projects and shit.
#+begin_src emacs-lisp
@@ -411,32 +374,31 @@ We want our emacs initialization to be pretty and display useful things.
** Ivy
Ivy is a pretty cool general program for displaying stuff:
#+begin_src emacs-lisp
- (use-package counsel)
- (use-package ivy
- :init
- (setq ivy-use-virtual-buffers t)
- (setq enable-recursive-minibuffers t)
- ;; enable this if you want `swiper' to use it
- ;; (setq search-default-mode #'char-fold-to-regexp)
- (global-set-key "\C-s" 'swiper)
- (global-set-key (kbd "C-c C-r") 'ivy-resume)
- (global-set-key (kbd "<f6>") 'ivy-resume)
- (global-set-key (kbd "M-x") 'counsel-M-x)
- (global-set-key (kbd "C-x C-f") 'counsel-find-file)
- (global-set-key (kbd "<f1> f") 'counsel-describe-function)
- (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
- (global-set-key (kbd "<f1> o") 'counsel-describe-symbol)
- (global-set-key (kbd "<f1> l") 'counsel-find-library)
- (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
- (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
- (global-set-key (kbd "C-c g") 'counsel-git)
- (global-set-key (kbd "C-c j") 'counsel-git-grep)
- (global-set-key (kbd "C-c k") 'counsel-ag)
- (global-set-key (kbd "C-x l") 'counsel-locate)
- (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
- :config
- (ivy-mode))
- (define-key ivy-minibuffer-map (kbd "C-j") 'ivy-immediate-done)
+ (use-package counsel)
+ (use-package ivy
+ :init
+ (setq ivy-use-virtual-buffers t)
+ (setq enable-recursive-minibuffers t)
+ :bind
+ ;; enable this if you want `swiper' to use it
+ ;; (setq search-default-mode #'char-fold-to-regexp)
+ ("C-s" . swiper)
+ ("C-c C-r" . ivy-resume)
+ ("M-x" . counsel-M-x)
+ ("C-x C-f" . counsel-find-file)
+ ("<f1> f" . counsel-describe-function)
+ ("<f1> v" . counsel-describe-variable)
+ ("<f1> o" . counsel-describe-symbol)
+ ("<f1> l" . counsel-find-library)
+ ("<f2> i" . counsel-info-lookup-symbol)
+ ("<f2> u" . counsel-unicode-char)
+ ("C-c g" . counsel-git)
+ ("C-c j" . counsel-git-grep)
+ ("C-c k" . counsel-ag)
+ ("C-x l" . counsel-locate)
+ :config
+ (ivy-mode))
+ (define-key ivy-minibuffer-map (kbd "C-j") 'ivy-immediate-done)
#+end_src
** Magit
#+begin_src emacs-lisp
@@ -444,35 +406,31 @@ Ivy is a pretty cool general program for displaying stuff:
#+end_src
** IRC
#+begin_src emacs-lisp
- (setq
- erc-nick system-username
- erc-user-full-name system-fullname)
-
- (defun prestonpan ()
- (interactive)
- (erc-tls :server "nullring.xyz"
- :port "6697"))
-
- (defun liberachat ()
- (interactive)
- (erc-tls :server "irc.libera.chat"
- :port "6697"))
-
-
- (defun efnet ()
- (interactive)
- (erc-tls :server "irc.prison.net"
- :port "6697"))
-#+end_src
-** Matrix
-#+begin_src emacs-lisp
- (defun matrix-org ()
- (interactive)
- (ement-connect :uri-prefix "http://localhost:8009"))
+ (use-package erc
+ :init
+ (setq
+ erc-nick system-username
+ erc-user-full-name system-fullname))
#+end_src
** Keybindings
#+begin_src emacs-lisp
(use-package general
+ :init
+ (defun prestonpan ()
+ (interactive)
+ (erc-tls :server "nullring.xyz"
+ :port "6697"))
+ (defun liberachat ()
+ (interactive)
+ (erc-tls :server "irc.libera.chat"
+ :port "6697"))
+ (defun efnet ()
+ (interactive)
+ (erc-tls :server "irc.prison.net"
+ :port "6697"))
+ (defun matrix-org ()
+ (interactive)
+ (ement-connect :uri-prefix "http://localhost:8009"))
:config
(general-create-definer leader-key
:prefix "SPC")
@@ -525,8 +483,7 @@ Ivy is a pretty cool general program for displaying stuff:
"w r" '(writeroom-mode :wk "focus mode for writing")
"y n s" '(yas-new-snippet :wk "Create new snippet")
"u w" '((lambda () (interactive) (shell-command "rsync -azvP ~/website_html/ root@nullring.xyz:/usr/share/nginx/ret2pop/")) :wk "rsync website update")
- "h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/org/website/config/emacs.org")))
- ))
+ "h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/org/website/config/emacs.org")))))
#+end_src
** LLM
I use LLMs in order to help me come up with ideas. I use a local LLM so that I can have a
@@ -546,9 +503,10 @@ I use really simple syndication (RSS) in order to read news. As a result, I use
elfeed to fetch feeds found on my website:
#+begin_src emacs-lisp
(use-package elfeed
+ :hook ((elfeed-search-mode . elfeed-update))
:init
- (add-hook 'elfeed-search-mode-hook #'elfeed-update)
(setq elfeed-search-filter "@1-month-ago +unread"))
+
(use-package elfeed-org
:init
(setq rmh-elfeed-org-files '("~/org/website/config/elfeed.org"))
@@ -595,32 +553,32 @@ interface and can control it from emacs):
Used only for the purpose of viewing RSS feed items in emacs if I can, only resorting
to Chromium if I have to:
#+begin_src emacs-lisp
-(setq search-engines
- '(
- (("google" "g") "https://google.com/search?q=%s")
- (("duckduckgo" "d" "ddg") "https://duckduckgo.com/?q=%s")
- (("rfc" "r") "https://www.rfc-editor.org/rfc/rfc%s.txt")
- (("rfc-kw" "rk") "https://www.rfc-editor.org/search/rfc_search_detail.php?title=%s")))
+ (use-package eww
+ :init
+ (setq search-engines
+ '((("google" "g") "https://google.com/search?q=%s")
+ (("duckduckgo" "d" "ddg") "https://duckduckgo.com/?q=%s")
+ (("rfc" "r") "https://www.rfc-editor.org/rfc/rfc%s.txt")
+ (("rfc-kw" "rk") "https://www.rfc-editor.org/search/rfc_search_detail.php?title=%s")))
-(setq search-engine-default "google")
-(setq eww-search-prefix "https://google.com/search?q=")
-(setq browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "firefox")
-;; (setq browse-url-browser-function "firefox")
-(add-hook 'eww-mode-hook
- (lambda () (local-set-key (kbd "y Y") #'eww-copy-page-url)))
+ (setq search-engine-default "google")
+ (setq eww-search-prefix "https://google.com/search?q=")
+ (setq browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "firefox")
+ :hook ((eww-mode . (lambda () (local-set-key (kbd "y Y") #'eww-copy-page-url)))))
#+end_src
** Org Roam
For all my mathematics and programming notes:
#+begin_src emacs-lisp
(use-package org-roam
+ :after (org)
:init
(setq org-roam-db-update-on-save t)
(setq org-roam-graph-viewer "chromium")
(setq org-roam-directory (file-truename "~/org/website/mindmap"))
(setq org-roam-capture-templates '(("d" "default" plain "%?"
:target (file+head "${title}.org"
- "#+title: ${title}\n#+author: Preston Pan\n#+html_head: <link rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" />\n#+html_head: <script src=\"https://polyfill.io/v3/polyfill.min.js?features=es6\"></script>\n#+html_head: <script id=\"MathJax-script\" async src=\"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js\"></script>\n#+options: broken-links:t")
- :unnarrowed t)))
+ "#+title: ${title}\n#+author: Preston Pan\n#+html_head: <link rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" />\n#+html_head: <script src=\"https://polyfill.io/v3/polyfill.min.js?features=es6\"></script>\n#+html_head: <script id=\"MathJax-script\" async src=\"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js\"></script>\n#+options: broken-links:t")
+ :unnarrowed t)))
:config
(org-roam-db-autosync-mode))
@@ -629,9 +587,9 @@ For all my mathematics and programming notes:
:hook (after-init . org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t
- org-roam-ui-follow t
- org-roam-ui-update-on-save t
- org-roam-ui-open-on-start t))
+ org-roam-ui-follow t
+ org-roam-ui-update-on-save t
+ org-roam-ui-open-on-start t))
#+end_src
** Pinentry
@@ -644,9 +602,6 @@ Set up pinentry so that I can use emacs as my pinentry frontend:
** LaTeX
Make LaTeX a litle better:
#+begin_src emacs-lisp
- (setq TeX-PDF-mode t)
- (setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
- (setq org-return-follows-link t)
;; (use-package latex-preview-pane
;; :config
;; (latex-preview-pane-enable))
@@ -655,16 +610,18 @@ Make LaTeX a litle better:
Email in emacs can be done with Mu4e.
#+begin_src emacs-lisp
;; SMTP settings:
- (setq user-mail-address system-email)
- (setq user-full-name system-fullname)
- (setq sendmail-program "msmtp"
+ (use-package smtpmail
+ :config
+ (setq user-mail-address system-email)
+ (setq user-full-name system-fullname)
+ (setq sendmail-program "msmtp"
send-mail-function 'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
- message-send-mail-function 'message-send-mail-with-sendmail)
+ message-send-mail-function 'message-send-mail-with-sendmail))
- (require 'smtpmail)
(use-package mu4e
+ :after smtpmail
:init
(setq mu4e-drafts-folder "/Drafts")
(setq mu4e-sent-folder "/Sent")
@@ -704,11 +661,5 @@ Set up emms in order to play music from my music directory:
(setq emms-player-list '(emms-player-mpd))
(add-to-list 'emms-info-functions 'emms-info-mpd)
(add-to-list 'emms-player-list 'emms-player-mpd)
- :config
- (emms-player-mpd-connect))
-#+end_src
-** Server
-So that emacsclient can connect.
-#+begin_src emacs-lisp
-(server-start)
+ :config (emms-player-mpd-connect))
#+end_src