diff options
author | Preston Pan <preston@nullring.xyz> | 2024-12-11 23:29:14 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2024-12-11 23:29:14 -0800 |
commit | fd231d6eaa9d2eea7f590650894ca8384694a7a8 (patch) | |
tree | 6a9cf0fc40acde806c8a9606056b85f2a205042a | |
parent | e7dd5245c35d2794f59bcf700a6a92009ec8c478 (diff) |
change emacs configuration
-rw-r--r-- | config/emacs.el | 195 | ||||
-rw-r--r-- | config/emacs.org | 204 | ||||
-rw-r--r-- | index.org | 4 | ||||
-rw-r--r-- | journal/20240924.org | 13 | ||||
-rw-r--r-- | mindmap/emergence.org | 1 | ||||
-rw-r--r-- | mindmap/lrc_circuit.png | bin | 3271 -> 3271 bytes |
6 files changed, 238 insertions, 179 deletions
diff --git a/config/emacs.el b/config/emacs.el index 66c5697..d1a4b50 100644 --- a/config/emacs.el +++ b/config/emacs.el @@ -1,81 +1,94 @@ (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 org-preview-latex-image-directory "/home/preston/.cache/ltximg/") - (add-hook 'prog-mode-hook - (lambda () - (setq prettify-symbols-alist - '(("lambda" . ?λ) - ("->" . ?→) - ("map" . ?↦) - ("/=" . ?≠) - ("!=" . ?≠) - ("==" . ?≡) - ("<=" . ?≤) - (">=" . ?≥) - ("&&" . ?∧) - ("||" . ?∨) - ("sqrt" . ?√) - ("..." . ?…))) - (prettify-symbols-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)) +(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 org-preview-latex-image-directory "/home/preston/.cache/ltximg/") + +(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) + +(add-hook 'prog-mode-hook + (lambda () + (setq prettify-symbols-alist + '(("lambda" . ?λ) + ("->" . ?→) + ("map" . ?↦) + ("/=" . ?≠) + ("!=" . ?≠) + ("==" . ?≡) + ("<=" . ?≤) + (">=" . ?≥) + ("&&" . ?∧) + ("||" . ?∨) + ("sqrt" . ?√) + ("..." . ?…))) + (prettify-symbols-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) +(use-package unicode-fonts + :init (unicode-fonts-setup)) + (set-frame-parameter nil 'alpha-background 90) (add-to-list 'default-frame-alist '(alpha-background . 90)) @@ -123,12 +136,14 @@ Otherwise, just insert the typed character." (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 lyrics-fetcher :after (emms) @@ -240,7 +255,8 @@ Otherwise, just insert the typed character." (use-package eglot :config - (add-hook 'prog-mode-hook 'eglot-ensure)) + (add-hook 'prog-mode-hook 'eglot-ensure) + (add-hook 'prog-mode-hook 'lsp)) (use-package projectile :init @@ -302,20 +318,15 @@ Otherwise, just insert the typed character." (erc-tls :server "nullring.xyz" :port "6697")) +(defun liberachat () + (interactive) + (erc-tls :server "irc.libera.chat" + :port "6697")) + (defun matrix-org () (interactive) (ement-connect :uri-prefix "http://localhost:8009")) -(use-package gptel - :init - (setq gptel-default-mode 'org-mode) - (setq-default - gptel-model "zephyr:latest" - gptel-backend (gptel-make-ollama "Ollama" - :host "localhost:11434" - :stream t - :models '("zephyr:latest")))) - (use-package general :config (general-create-definer leader-key @@ -358,7 +369,8 @@ Otherwise, just insert the typed character." "o p" '(treemacs :wk "Project Drawer") "o P" '(treemacs-projectile :wk "Import Projectile project to treemacs") "f f" '(eglot-format :wk "Format code buffer") - "i c" '(prestonpan :wk "Connect to my IRC server") + "i p c" '(prestonpan :wk "Connect to my IRC server") + "i l c" '(liberachat :wk "Connect to libera chat server") "h m" '(woman :wk "Manual") "h i" '(info :wk "Info") "s m" '(proced :wk "System Manager") @@ -369,6 +381,15 @@ Otherwise, just insert the typed character." "h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/org/website/config/emacs.org"))) )) +(use-package ellama + :init + (setopt ellama-sessions-directory "/home/preston/org/ellama/") + (require 'llm-ollama) + (with-eval-after-load 'llm-ollama) + (setopt ellama-provider (make-llm-ollama + :host "localhost" + :chat-model "gemma:7b"))) + (use-package elfeed :init (add-hook 'elfeed-search-mode-hook #'elfeed-update) diff --git a/config/emacs.org b/config/emacs.org index f04214d..dcc4a0e 100644 --- a/config/emacs.org +++ b/config/emacs.org @@ -12,84 +12,100 @@ emacs-lisp language only to configure variables for said packages, for the most 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 - (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 org-preview-latex-image-directory "/home/preston/.cache/ltximg/") - (add-hook 'prog-mode-hook - (lambda () - (setq prettify-symbols-alist - '(("lambda" . ?λ) - ("->" . ?→) - ("map" . ?↦) - ("/=" . ?≠) - ("!=" . ?≠) - ("==" . ?≡) - ("<=" . ?≤) - (">=" . ?≥) - ("&&" . ?∧) - ("||" . ?∨) - ("sqrt" . ?√) - ("..." . ?…))) - (prettify-symbols-mode))) + (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 org-preview-latex-image-directory "/home/preston/.cache/ltximg/") - (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)) + (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) + + (add-hook 'prog-mode-hook + (lambda () + (setq prettify-symbols-alist + '(("lambda" . ?λ) + ("->" . ?→) + ("map" . ?↦) + ("/=" . ?≠) + ("!=" . ?≠) + ("==" . ?≡) + ("<=" . ?≤) + (">=" . ?≥) + ("&&" . ?∧) + ("||" . ?∨) + ("sqrt" . ?√) + ("..." . ?…))) + (prettify-symbols-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) #+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 @@ -153,12 +169,14 @@ what electric-pair does based on the mode. (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) #+end_src * Lyrics #+begin_src emacs-lisp @@ -302,7 +320,8 @@ We set up eglot, the LSP manager for emacs, now built in: #+begin_src emacs-lisp (use-package eglot :config - (add-hook 'prog-mode-hook 'eglot-ensure)) + (add-hook 'prog-mode-hook 'eglot-ensure) + (add-hook 'prog-mode-hook 'lsp)) #+end_src ** Projectile Manages projects and shit. @@ -376,6 +395,11 @@ Ivy is a pretty cool general program for displaying stuff: (interactive) (erc-tls :server "nullring.xyz" :port "6697")) + + (defun liberachat () + (interactive) + (erc-tls :server "irc.libera.chat" + :port "6697")) #+end_src ** Matrix #+begin_src emacs-lisp @@ -383,18 +407,6 @@ Ivy is a pretty cool general program for displaying stuff: (interactive) (ement-connect :uri-prefix "http://localhost:8009")) #+end_src -** LLMs -#+begin_src emacs-lisp - (use-package gptel - :init - (setq gptel-default-mode 'org-mode) - (setq-default - gptel-model "zephyr:latest" - gptel-backend (gptel-make-ollama "Ollama" - :host "localhost:11434" - :stream t - :models '("zephyr:latest")))) -#+end_src ** Keybindings #+begin_src emacs-lisp (use-package general @@ -439,7 +451,8 @@ Ivy is a pretty cool general program for displaying stuff: "o p" '(treemacs :wk "Project Drawer") "o P" '(treemacs-projectile :wk "Import Projectile project to treemacs") "f f" '(eglot-format :wk "Format code buffer") - "i c" '(prestonpan :wk "Connect to my IRC server") + "i p c" '(prestonpan :wk "Connect to my IRC server") + "i l c" '(liberachat :wk "Connect to libera chat server") "h m" '(woman :wk "Manual") "h i" '(info :wk "Info") "s m" '(proced :wk "System Manager") @@ -450,6 +463,19 @@ Ivy is a pretty cool general program for displaying stuff: "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 +competitive LLM that doesn't cost money. +#+begin_src emacs-lisp + (use-package ellama + :init + (setopt ellama-sessions-directory "/home/preston/org/ellama/") + (require 'llm-ollama) + (with-eval-after-load 'llm-ollama) + (setopt ellama-provider (make-llm-ollama + :host "localhost" + :chat-model "gemma:7b"))) +#+end_src ** RSS Feed I use really simple syndication (RSS) in order to read news. As a result, I use elfeed to fetch feeds found on my website: @@ -91,5 +91,5 @@ bc1qjxec4e08hzv09h0ss8q80ey0kc7356p6c8fg8h Note that all of the above cryptocurrencies I believe are either potentially useful for some niche, or have value because of their de-facto link to other currencies that are useful for some niche. ** Do I advocate for using these as currencies? -Only Monero and some forms of ETH tokens for privacy reasons, and maybe they can become better than fiat, -but that algorithm that keeps them stable does not really exist yet. +Only Monero; maybe they can become better than fiat, but that algorithm that keeps them stable does +not really exist yet. Ethereum has some interesting usecases such as with DeFi. diff --git a/journal/20240924.org b/journal/20240924.org new file mode 100644 index 0000000..b7acdf6 --- /dev/null +++ b/journal/20240924.org @@ -0,0 +1,13 @@ +#+TITLE: Daily Journal +#+STARTUP: showeverything +#+DESCRIPTION: My daily journal entry +#+AUTHOR: Preston Pan +#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" /> +#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> +#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> +#+options: broken-links:t +* Tuesday, 24 September 2024 +** 00:14 +I've just talked to Kai Stevenson and Chatgpt for a long time. I'm currently trying to journal again, and hopefully, +I will be able to journal on paper some. I never am able to commit to a written journal, but a digital journal is +fine. diff --git a/mindmap/emergence.org b/mindmap/emergence.org index a2ea32e..08cdc39 100644 --- a/mindmap/emergence.org +++ b/mindmap/emergence.org @@ -56,6 +56,5 @@ have made more particular statements about the state of economic affairs with th under neokeynesian theory. *** Languages Emergent - * Key Takeaway Emergence is the bootstrapping problem that attempts to solve the problem of induction. diff --git a/mindmap/lrc_circuit.png b/mindmap/lrc_circuit.png Binary files differindex 118536b..7356424 100644 --- a/mindmap/lrc_circuit.png +++ b/mindmap/lrc_circuit.png |