From 36e61234ecb62bf15506451cac3930a5984898f1 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Thu, 3 Oct 2024 14:47:20 -0700 Subject: [PATCH] Swap thoom/ to my/ prefix --- emacs/init.el | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index ac5fd29..48a5a42 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -115,7 +115,7 @@ ("C-o D" . windmove-swap-states-right) ;; TODO C-wasd for resizing ;; TODO C-/ for undo window state change - ("C-o z" . thoom/zoom-window) + ("C-o z" . my/zoom-window) ;; TODO other-window scrolling ("C-o n" . next-buffer) ("C-o p" . previous-buffer) @@ -504,7 +504,7 @@ compilation-mode "\\*eshell.*\\*" eshell-mode)) - (defun thoom/popper-window-height (window) + (defun my/popper-window-height (window) "Make eshell popups take half the frame height, otherwise defer to popper--fit-window-height" (let ((buffer (window-buffer window))) (if (with-current-buffer buffer @@ -512,29 +512,29 @@ (/ (frame-height (window-frame window)) 2) (popper--fit-window-height window)))) - (setq popper-window-height #'thoom/popper-window-height) + (setq popper-window-height #'my/popper-window-height) ;; (setq popper-group-function #'popper-group-by-project) (popper-mode +1) (popper-echo-mode +1)) ;;;; Zooming -(defvar thoom/zoom-saved-windows nil - "Variable to store the current window configuration for thoom/zoom.") +(defvar my/zoom-saved-windows nil + "Variable to store the current window configuration for my/zoom.") -(defun thoom/zoom-window () +(defun my/zoom-window () "Delete other windows, or restore the saved window configuration if available." (interactive) ;; Clean up if the saved config isn't valid anymore. - (if (and thoom/zoom-saved-windows - (not (window-configuration-p thoom/zoom-saved-windows))) + (if (and my/zoom-saved-windows + (not (window-configuration-p my/zoom-saved-windows))) - (setq thoom/zoom-saved-windows nil)) + (setq my/zoom-saved-windows nil)) - (if thoom/zoom-saved-windows + (if my/zoom-saved-windows (progn - (set-window-configuration thoom/zoom-saved-windows) - (setq thoom/zoom-saved-windows nil)) - (setq thoom/zoom-saved-windows (current-window-configuration)) + (set-window-configuration my/zoom-saved-windows) + (setq my/zoom-saved-windows nil)) + (setq my/zoom-saved-windows (current-window-configuration)) (if (window-parameter (selected-window) 'window-side) (shrink-window -100) (delete-other-windows)))) @@ -648,7 +648,7 @@ ;;; Org-mode (use-package org - :bind (("C-c o ," . thoom/org-clear-all) + :bind (("C-c o ," . my/org-clear-all) ("C-c o s" . org-screenshot) ("C-c SPC" . org-table-blank-field) ;; Unbind to make room for avy and mwim @@ -676,7 +676,7 @@ ;; Eagerly load org-mode (with-temp-buffer (org-mode)) -(defun thoom/org-clear-all () +(defun my/org-clear-all () (interactive) (goto-char 0) (org-map-entries @@ -698,7 +698,7 @@ ;; 3. Put the following at the top of the org file: ;; #+STARTUP: inlineimages ;; #+ATTR_HTML: :width 500px -(defvar org-screenshot-import-path "/mnt/c/Users/thoom/Seafile/Games/Screenshots/") +(defvar org-screenshot-import-path "/mnt/c/Users/my/Seafile/Games/Screenshots/") (defvar org-screenshot-export-path org-screenshot-import-path) (defvar org-screenshot-exec-path "ShareX.exe") (defvar org-screenshot-exec-args "-s -workflow GameNotes") @@ -869,7 +869,7 @@ ;;; Eshell ;;;; Eshell (use-package eshell - :bind (("M-`" . thoom/eshell-toggle)) + :bind (("M-`" . my/eshell-toggle)) :config (setq eshell-destroy-buffer-when-process-dies t eshell-scroll-to-bottom-on-input t @@ -878,7 +878,7 @@ eshell-visual-commands '() eshell-banner-message "") - (defun thoom/eshell-toggle () + (defun my/eshell-toggle () "Toggle eshell based on context. If in eshell, call `popper-toggle`. If not in eshell but in a project, call `project-eshell`.