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 /config/emacs.org | |
parent | e7dd5245c35d2794f59bcf700a6a92009ec8c478 (diff) |
change emacs configuration
Diffstat (limited to 'config/emacs.org')
-rw-r--r-- | config/emacs.org | 204 |
1 files changed, 115 insertions, 89 deletions
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: |