From 072aa746c02e8a423c128cfc253ac2c410eb47e1 Mon Sep 17 00:00:00 2001 From: Hunt Date: Thu, 12 Jun 2025 09:30:33 -0700 Subject: Fixes some emacs stuff --- dots/emacs/.config/emacs.d/early-init.el | 5 - dots/emacs/.config/emacs.d/empressomacs.org.j2 | 264 ------------------------ dots/emacs/.config/emacs.d/init.el | 51 ----- dots/emacs/.emacs.d/early-init.el | 5 + dots/emacs/.emacs.d/empressomacs.org.j2 | 268 +++++++++++++++++++++++++ dots/emacs/.emacs.d/init.el | 55 +++++ 6 files changed, 328 insertions(+), 320 deletions(-) delete mode 100644 dots/emacs/.config/emacs.d/early-init.el delete mode 100644 dots/emacs/.config/emacs.d/empressomacs.org.j2 delete mode 100644 dots/emacs/.config/emacs.d/init.el create mode 100644 dots/emacs/.emacs.d/early-init.el create mode 100644 dots/emacs/.emacs.d/empressomacs.org.j2 create mode 100644 dots/emacs/.emacs.d/init.el (limited to 'dots/emacs') diff --git a/dots/emacs/.config/emacs.d/early-init.el b/dots/emacs/.config/emacs.d/early-init.el deleted file mode 100644 index 7bb24d4..0000000 --- a/dots/emacs/.config/emacs.d/early-init.el +++ /dev/null @@ -1,5 +0,0 @@ -;;-- -- -(add-to-list 'default-frame-alist '(undecorated-round . t)) -(setq package-enable-at-startup t) -;;-- -- - diff --git a/dots/emacs/.config/emacs.d/empressomacs.org.j2 b/dots/emacs/.config/emacs.d/empressomacs.org.j2 deleted file mode 100644 index 8aa8be5..0000000 --- a/dots/emacs/.config/emacs.d/empressomacs.org.j2 +++ /dev/null @@ -1,264 +0,0 @@ -#+TITLE: emprespresso's settings -#+AUTHOR: emprespresso -#+STARTUP: fold - -* melpa -#+BEGIN_SRC emacs-lisp - (require 'package) - (add-to-list 'package-archives - '("melpa" . "https://melpa.org/packages/") t) -#+END_SRC -* macos hacks that have to be run before most stuff. -** image types. -#+BEGIN_SRC emacs-lisp - (setq image-types '(svg png gif tiff jpeg xpm xbm pbg)) -#+END_SRC -* yeah, be evil. whatcha gonna do about it?? huh?? >:P -#+BEGIN_SRC emacs-lisp - (use-package evil - :init - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - (setq evil-want-C-u-scroll t) - (setq evil-want-C-i-jump nil) - (setq evil-shift-width {{ editorconfig.tab_width }}) - (setq evil-cross-lines t) - (setq evil-respect-visual-line-mode t) - (setq evil-vsplit-window-below t) - (setq evil-split-window-below t) - (setq evil-undo-system 'undo-redo) - :config - (evil-mode 1) - (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) - - (evil-global-set-key 'motion "j" 'evil-next-visual-line) - (evil-global-set-key 'motion "k" 'evil-previous-visual-line) - - (add-hook 'evil-visual-activate-hook - #'(lambda () - (global-hl-line-mode 0))) - - (add-hook 'evil-visual-deactivate-hook - #'(lambda () - (global-hl-line-mode 1))) - - (setq evil-want-fine-undo t) - (evil-set-initial-state 'messages-buffer-mode 'normal)) -#+END_SRC - -* misc. emacs stuff -** files and autosaves -#+BEGIN_SRC emacs-lisp - (setq auto-save-default nil - make-backup-files nil - create-lockfiles nil) - (global-auto-revert-mode t) ;; Change files on disk as they are updated -#+END_SRC -** env.PATH -#+BEGIN_SRC emacs-lisp - (use-package exec-path-from-shell - :ensure t - :init - (when (memq window-system '(mac ns x)) - (exec-path-from-shell-initialize))) -#+END_SRC -** case-region -#+BEGIN_SRC emacs-lisp - (put 'downcase-region 'disabled nil) - (put 'upcase-region 'disabled nil) -#+END_SRC -** silence, bell -#+BEGIN_SRC emacs-lisp - (setq ring-bell-function 'ignore) -#+END_SRC -* appearance -** global -#+BEGIN_SRC emacs-lisp - ;; > expert users often turn off the menu bar - ;; > https://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bars.html - ;; we're experts, right?? (*^.^*) - (menu-bar-mode -1) - - ;; don't show startup screen, go straight to scratch - (setq inhibit-startup-screen t) -#+END_SRC -** gui -*** clutter -#+BEGIN_SRC emacs-lisp - ;; don't show clutter - (tool-bar-mode -1) - - ;; make line-wrap arrows basically invisible by setting the fringe area - ;; dimensions to 1 - (set-fringe-mode '(1 . 1)) - - ;; disable scroll bars - (scroll-bar-mode nil) - (horizontal-scroll-bar-mode nil) -#+END_SRC -*** line - related -#+BEGIN_SRC emacs-lisp - ;; move by whole line units, not visually - (setq line-move-visual nil) - - ;; make comfy - (setq line-spacing 0.24) - - ;; highlight current line - (global-hl-line-mode) - - ;; fixes an "issue", where the frame doesn't use the entire space available given - ;; by the window manager since the frame will resize only by factors of the line - ;; height by default. - ;; especially noticeable when tiling ヽ(ー_ー )ノ - (setq frame-resize-pixelwise t) -#+END_SRC -*** icons -must run ~(all-the-icons-install-fonts)~ and ~(nerd-fonts-install-fonts)~ -#+BEGIN_SRC emacs-lisp - (use-package all-the-icons - :ensure t) - (use-package nerd-icons - :ensure t) -#+END_SRC -*** modeline -#+BEGIN_SRC emacs-lisp - (use-package doom-modeline - :ensure t - :config - (doom-modeline-mode 1)) -#+END_SRC -*** themes -#+BEGIN_SRC emacs-lisp - (use-package doom-themes - :ensure t - :config - (setq doom-themes-enable-bold t ; enable bold globally - doom-themes-enable-italic t) ; enable italics globally - - ;; flash mode-line on errors - (doom-themes-visual-bell-config) - - (doom-themes-neotree-config) - - ;; corrects (and improves) org-mode's native fontification. - (doom-themes-org-config)) -#+END_SRC -*** eager loading of theme -#+BEGIN_SRC emacs-lisp - (require 'filenotify) - - (setq *theme-file* "~/.config/theme/emacs.el") - (file-notify-add-watch *theme-file* '(change) - #'(lambda (event) (load-file *theme-file*))) -#+END_SRC - -* neotree -#+BEGIN_SRC emacs-lisp - (use-package neotree - :ensure t - :bind ("C-c j" . 'neotree-toggle) - :init - ;; slow rendering - (setq inhibit-compacting-font-caches t) - - ;; set icons theme - (setq neo-theme (if (display-graphic-p) 'icons 'arrow)) - (setq neo-window-width 35) - - ;; every time when the neotree window is opened, let it find current file - ;; and jump to node - (setq neo-smart-open t) - - ;; when running ‘projectile-switch-project’ (C-c p p), ‘neotree’ - ;; will change root automatically - (setq projectile-switch-project-action 'neotree-projectile-action) - - ;; show hidden files - (setq-default neo-show-hidden-files t)) -#+END_SRC -* org mode -** misc vars -#+BEGIN_SRC emacs-lisp - (setq org-startup-indented t - org-html-postamble nil - org-html-preamble t - org-src-tab-acts-natively t) -#+END_SRC -** roam -#+BEGIN_SRC emacs-lisp - (use-package org-roam - :straight t) -#+END_SRC -** babel -#+BEGIN_SRC emacs-lisp - (org-babel-do-load-languages - 'org-babel-load-languages - '((lisp . t) - (emacs-lisp . t) - (python . t))) -#+END_SRC -** org-bullets -#+BEGIN_SRC emacs-lisp - (use-package org-bullets - :ensure t - :init - (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) -#+END_SRC -** org-appear -#+BEGIN_SRC emacs-lisp - (use-package org-appear - :ensure t - :init - (add-hook 'org-mode-hook 'org-appear-mode)) -#+END_SRC -** presentations -#+BEGIN_SRC emacs-lisp - (use-package org-present - :ensure t - :straight '(org-present - :type git - :host github - :repo "rlister/org-present")) -#+END_SRC -* major modes -** markdown -#+BEGIN_SRC emacs-lisp -(use-package markdown-mode - :ensure t - :mode ("README\\.md\\'" . gfm-mode) - :init (setq markdown-command "multimarkdown") - :bind (:map markdown-mode-map - ("C-c C-e" . markdown-do))) -#+END_SRC -* dev stuff -** completion -#+BEGIN_SRC emacs-lisp - ;; > yasnippet is a template system for emacs. - ;; > it allows you to type an abbreviation and automatically expand it into - ;; function templates. - ;; https://github.com/joaotavora/yasnippet/blob/master/README.mdown - (use-package yasnippet - :ensure t - :init (yas-global-mode 1)) -#+END_SRC -** lsp -#+BEGIN_SRC emacs-lisp - ;; pip3 install epc orjson sexpdata six setuptools \ - ;; paramiko rapidfuzz watchdog packaging - (use-package lsp-bridge - :straight - '(lsp-bridge :type git :host github - :repo "manateelazycat/lsp-bridge" - :files (:defaults - "*.el" "*.py" "acm" "core" "langserver" - "multiserver" "resources") - :build (:not compile)) - :init (global-lsp-bridge-mode)) -#+END_SRC -** format -#+BEGIN_SRC emacs-lisp - (use-package format-all - :ensure t - :bind (("C-c C-f" . format-all-region))) -#+END_SRC diff --git a/dots/emacs/.config/emacs.d/init.el b/dots/emacs/.config/emacs.d/init.el deleted file mode 100644 index bff8177..0000000 --- a/dots/emacs/.config/emacs.d/init.el +++ /dev/null @@ -1,51 +0,0 @@ -;;-- -- -(defun find-user-file (file-name) - (expand-file-name file-name user-emacs-directory)) - -(defmacro in-remote-buffer (url &rest body) - "evals in a buffer whose contents are raw retrieved from (url)" - `(with-current-buffer (url-retrieve-synchronously - ,url 'silent 'inhibit-cookies) - ,body)) - -(defun eval-remote (url) - "essentially `curl (url) | sh` (ノ´ヮ`)ノ*" - (in-remote-buffer url - (eval-buffer))) -;;-- -- - -;;-- -- -;;(( what abt gay.el („• ֊ •„) hehe )) - -;; bootstrap, installing if it doesn't yet exist. -(defvar *straight-version* 5) -(defvar *straight-bootstrap-file* - (find-user-file "straight/repos/straight.el/bootstrap.el")) -(defvar *straight-src* - "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el") -(defun bootstrap-straight (&optional version file src) - "bootstrap straight (version), eval'ing (file) or falling back to (src)" - (or version (setq version *straight-version*)) - (or file (setq file *straight-bootstrap-file*)) - (or src (setq src *stragith-src*)) - - (if file-exists-p file) - (load file nil 'nomessage) - (eval-remote src)) -(bootstrap-staight) - -;; install it and use it by default! -(straight-use-package 'use-package) -(use-package straight - :custom - (straight-use-package-by-default t)) -;;-- -- - -;;-- -- -(use-package org - :straight (:type built-in)) - -(defvar *settings-org* "empressomacs.org") -(org-babel-load-file (find-user-file *settings-org*)) -;;-- -- - diff --git a/dots/emacs/.emacs.d/early-init.el b/dots/emacs/.emacs.d/early-init.el new file mode 100644 index 0000000..7bb24d4 --- /dev/null +++ b/dots/emacs/.emacs.d/early-init.el @@ -0,0 +1,5 @@ +;;-- -- +(add-to-list 'default-frame-alist '(undecorated-round . t)) +(setq package-enable-at-startup t) +;;-- -- + diff --git a/dots/emacs/.emacs.d/empressomacs.org.j2 b/dots/emacs/.emacs.d/empressomacs.org.j2 new file mode 100644 index 0000000..e1f079d --- /dev/null +++ b/dots/emacs/.emacs.d/empressomacs.org.j2 @@ -0,0 +1,268 @@ +#+TITLE: emprespresso's settings +#+AUTHOR: emprespresso +#+STARTUP: fold + +* melpa +#+BEGIN_SRC emacs-lisp + (require 'package) + (add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/") t) +#+END_SRC +* macos hacks that have to be run before most stuff. +** image types. +#+BEGIN_SRC emacs-lisp + (setq image-types '(svg png gif tiff jpeg xpm xbm pbg)) +#+END_SRC +* yeah, be evil. whatcha gonna do about it?? huh?? >:P +#+BEGIN_SRC emacs-lisp + (use-package evil + :init + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + (setq evil-want-C-u-scroll t) + (setq evil-want-C-i-jump nil) + (setq evil-shift-width {{ editorconfig.tab_width }}) + (setq evil-cross-lines t) + (setq evil-respect-visual-line-mode t) + (setq evil-vsplit-window-below t) + (setq evil-split-window-below t) + (setq evil-undo-system 'undo-redo) + :config + (evil-mode 1) + (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) + + (evil-global-set-key 'motion "j" 'evil-next-visual-line) + (evil-global-set-key 'motion "k" 'evil-previous-visual-line) + + (add-hook 'evil-visual-activate-hook + #'(lambda () + (global-hl-line-mode 0))) + + (add-hook 'evil-visual-deactivate-hook + #'(lambda () + (global-hl-line-mode 1))) + + (setq evil-want-fine-undo t) + (evil-set-initial-state 'messages-buffer-mode 'normal)) +#+END_SRC + +* misc. emacs stuff +** files and autosaves +#+BEGIN_SRC emacs-lisp + (setq auto-save-default nil + make-backup-files nil + create-lockfiles nil) + (global-auto-revert-mode t) ;; Change files on disk as they are updated +#+END_SRC +** env.PATH +#+BEGIN_SRC emacs-lisp + (use-package exec-path-from-shell + :ensure t + :init + (when (memq window-system '(mac ns x)) + (exec-path-from-shell-initialize))) +#+END_SRC +** case-region +#+BEGIN_SRC emacs-lisp + (put 'downcase-region 'disabled nil) + (put 'upcase-region 'disabled nil) +#+END_SRC +** silence, bell +#+BEGIN_SRC emacs-lisp + (setq ring-bell-function 'ignore) +#+END_SRC +* appearance +** global +#+BEGIN_SRC emacs-lisp + ;; > expert users often turn off the menu bar + ;; > https://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bars.html + ;; we're experts, right?? (*^.^*) + (menu-bar-mode -1) + + ;; don't show startup screen, go straight to scratch + (setq inhibit-startup-screen t) +#+END_SRC +** gui +*** clutter +#+BEGIN_SRC emacs-lisp + ;; don't show clutter + (tool-bar-mode -1) + + ;; make line-wrap arrows basically invisible by setting the fringe area + ;; dimensions to 1 + (set-fringe-mode '(1 . 1)) + + ;; disable scroll bars + (scroll-bar-mode -1) + (horizontal-scroll-bar-mode -1) +#+END_SRC +*** line - related +#+BEGIN_SRC emacs-lisp + ;; move by whole line units, not visually + (setq line-move-visual nil) + + ;; make comfy + (setq line-spacing 0.24) + + ;; highlight current line + (global-hl-line-mode) + + ;; fixes an "issue", where the frame doesn't use the entire space available given + ;; by the window manager since the frame will resize only by factors of the line + ;; height by default. + ;; especially noticeable when tiling ヽ(ー_ー )ノ + (setq frame-resize-pixelwise t) +#+END_SRC +*** icons +must run ~(all-the-icons-install-fonts)~ and ~(nerd-fonts-install-fonts)~ +#+BEGIN_SRC emacs-lisp + (use-package all-the-icons + :ensure t) + (use-package nerd-icons + :ensure t) +#+END_SRC +*** modeline +#+BEGIN_SRC emacs-lisp + (use-package doom-modeline + :ensure t + :config + (doom-modeline-mode 1)) +#+END_SRC +*** themes +#+BEGIN_SRC emacs-lisp + (use-package doom-themes + :ensure t + :config + (setq doom-themes-enable-bold t ; enable bold globally + doom-themes-enable-italic t) ; enable italics globally + + ;; flash mode-line on errors + (doom-themes-visual-bell-config) + + (doom-themes-neotree-config) + + ;; corrects (and improves) org-mode's native fontification. + (doom-themes-org-config)) +#+END_SRC +*** eager loading of theme +#+BEGIN_SRC emacs-lisp + ;; TODO: figure out why this won't work when this is a symlink. + (setq *theme-file* "~/.config/theme/emacs.el") + (defun lazy-theme (event) + (message "Event %S" event) + (load-file *theme-file*)) + + (file-notify-add-watch *theme-file* '(change attribute-change) + 'lazy-theme) + (lazy-theme nil) +#+END_SRC + +* neotree +#+BEGIN_SRC emacs-lisp + (use-package neotree + :ensure t + :bind ("C-c j" . 'neotree-toggle) + :init + ;; slow rendering + (setq inhibit-compacting-font-caches t) + + ;; set icons theme + (setq neo-theme (if (display-graphic-p) 'icons 'arrow)) + (setq neo-window-width 35) + + ;; every time when the neotree window is opened, let it find current file + ;; and jump to node + (setq neo-smart-open t) + + ;; when running ‘projectile-switch-project’ (C-c p p), ‘neotree’ + ;; will change root automatically + (setq projectile-switch-project-action 'neotree-projectile-action) + + ;; show hidden files + (setq-default neo-show-hidden-files t)) +#+END_SRC +* org mode +** misc vars +#+BEGIN_SRC emacs-lisp + (setq org-startup-indented t + org-html-postamble nil + org-html-preamble t + org-src-tab-acts-natively t) +#+END_SRC +** roam +#+BEGIN_SRC emacs-lisp + (use-package org-roam + :straight t) +#+END_SRC +** babel +#+BEGIN_SRC emacs-lisp + (org-babel-do-load-languages + 'org-babel-load-languages + '((lisp . t) + (emacs-lisp . t) + (python . t))) +#+END_SRC +** org-bullets +#+BEGIN_SRC emacs-lisp + (use-package org-bullets + :ensure t + :init + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) +#+END_SRC +** org-appear +#+BEGIN_SRC emacs-lisp + (use-package org-appear + :ensure t + :init + (add-hook 'org-mode-hook 'org-appear-mode)) +#+END_SRC +** presentations +#+BEGIN_SRC emacs-lisp + (use-package org-present + :ensure t + :straight '(org-present + :type git + :host github + :repo "rlister/org-present")) +#+END_SRC +* major modes +** markdown +#+BEGIN_SRC emacs-lisp +(use-package markdown-mode + :ensure t + :mode ("README\\.md\\'" . gfm-mode) + :init (setq markdown-command "multimarkdown") + :bind (:map markdown-mode-map + ("C-c C-e" . markdown-do))) +#+END_SRC +* dev stuff +** completion +#+BEGIN_SRC emacs-lisp + ;; > yasnippet is a template system for emacs. + ;; > it allows you to type an abbreviation and automatically expand it into + ;; function templates. + ;; https://github.com/joaotavora/yasnippet/blob/master/README.mdown + (use-package yasnippet + :ensure t + :init (yas-global-mode 1)) +#+END_SRC +** lsp +#+BEGIN_SRC emacs-lisp + ;; pip3 install epc orjson sexpdata six setuptools \ + ;; paramiko rapidfuzz watchdog packaging + (use-package lsp-bridge + :straight + '(lsp-bridge :type git :host github + :repo "manateelazycat/lsp-bridge" + :files (:defaults + "*.el" "*.py" "acm" "core" "langserver" + "multiserver" "resources") + :build (:not compile)) + :init (global-lsp-bridge-mode)) +#+END_SRC +** format +#+BEGIN_SRC emacs-lisp + (use-package format-all + :ensure t + :bind (("C-c C-f" . format-all-region))) +#+END_SRC diff --git a/dots/emacs/.emacs.d/init.el b/dots/emacs/.emacs.d/init.el new file mode 100644 index 0000000..a52ee9e --- /dev/null +++ b/dots/emacs/.emacs.d/init.el @@ -0,0 +1,55 @@ +;;-- -- +(defun find-user-file (file-name) + (expand-file-name file-name user-emacs-directory)) + +(defmacro in-remote-buffer (url &rest body) + "evals in a buffer whose contents are raw retrieved from (url)" + `(with-current-buffer (url-retrieve-synchronously + ,url 'silent 'inhibit-cookies) + ;; delete headers + (goto-char (point-min)) + (re-search-forward "^$") + (delete-region (point) (point-min)) + + ,@body)) + +(defun eval-remote (url) + "essentially `curl (url) | sh` (ノ´ヮ`)ノ*" + (in-remote-buffer url + (eval-buffer))) +;;-- -- + +;;-- -- +;;(( what abt gay.el („• ֊ •„) hehe )) + +;; bootstrap, installing if it doesn't yet exist. +(defvar *straight-version* 5) +(defvar *straight-bootstrap-file* + (find-user-file "straight/repos/straight.el/bootstrap.el")) +(defvar *straight-src* + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el") +(defun bootstrap-straight (&optional version file src) + "bootstrap straight.el (version), eval'ing (file) or falling back to (src)" + (or version (setq version *straight-version*)) + (or file (setq file *straight-bootstrap-file*)) + (or src (setq src *straight-src*)) + (if (file-exists-p file) + (load file nil 'nomessage) + (eval-remote src))) + +(bootstrap-straight) + +;; install it and use it by default! +(straight-use-package 'use-package) +(use-package straight + :custom + (straight-use-package-by-default t)) +;;-- -- + +;;-- -- +(use-package org + :straight (:type built-in)) + +(defvar *settings-org* "empressomacs.org") +(org-babel-load-file (find-user-file *settings-org*)) +;;-- -- -- cgit v1.2.3-70-g09d2