aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/emacs.el195
-rw-r--r--config/emacs.org204
2 files changed, 223 insertions, 176 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: