From 97b4a23582ccd458d0b9be5e54268607e07736c3 Mon Sep 17 00:00:00 2001 From: Micheal Smith Date: Thu, 30 Oct 2025 13:44:45 -0500 Subject: [PATCH] Moved social section into its own file. --- config.org | 21 +--------- config/hydra.org | 105 ++++++++++++++++++++++++++++++++++++++++++++++ config/social.org | 21 ++++++++++ 3 files changed, 127 insertions(+), 20 deletions(-) create mode 100644 config/hydra.org create mode 100644 config/social.org diff --git a/config.org b/config.org index 63c1527..2856719 100644 --- a/config.org +++ b/config.org @@ -210,26 +210,7 @@ features. #+INCLUDE: "config/documentation.org" :minlevel 1 -* Socializing - -Here are some things I use to optionally communicate with the rest of the world -via Emacs. I keep them in separate files so I can optionally load them easily -on a system by system basis. - -#+begin_src emacs-lisp -;;; Extra optional files - -(defun maybe-load-rel (relpath) - "Loads a file relative to the user-emacs-directory fi it exists." - (let ((path (concat (file-name-as-directory user-emacs-directory) relpath))) - (when (file-exists-p path) - (load-file path)))) - -(maybe-load-rel "extra/email.el") -(maybe-load-rel "extra/feed.el") -(maybe-load-rel "extra/social.el") -;;; -#+end_src +#+INCLUDE: "config/social.org" :minlevel 1 * Hail Hydra?! diff --git a/config/hydra.org b/config/hydra.org new file mode 100644 index 0000000..79c6abf --- /dev/null +++ b/config/hydra.org @@ -0,0 +1,105 @@ +* Hail Hydra?! + +I find that [[https://github.com/abo-abo/hydra][Hydra]] is great for providing visual menus for tasks that might +otherwise be fairly unwieldy. I use them hydra's for windows, tabs, and a +few other things in the future perhaps. + +** Tabs + +Pretty simple tab hydra. Handles opening, closing, and simple navigation. + +#+name: tab-hydra +#+begin_src emacs-lisp :tangle no + (defhydra hydra-tab (:color red :hint nil) + " +Movement^^ ^Modifier^ +---------------------------------------------------------------- +_h_ ← _n_ ew +_l_ → _c_ lose +" + ("h" tab-previous) + ("l" tab-next) + ("n" tab-new) + ("c" tab-close) + ("SPC" nil)) + (global-set-key (kbd "C-c t") 'hydra-tab/body) +#+end_src + +** Windows + +Quite a helpful window hydra. I cannot take credit for this. I copied it +from somewhere. When I find the link I'll add it here. + +#+name: window-hydra +#+begin_src emacs-lisp :tangle no + (defhydra hydra-window (:color red :hint nil) + " +Movement^^ ^Split^ ^Switch^ ^Resize^ +---------------------------------------------------------------- +_h_ ← _v_ertical _b_uffer _q_ X← +_j_ ↓ _x_ horizontal _f_ind files _w_ X↓ +_k_ ↑ _z_ undo _a_ce 1 _e_ X↑ +_l_ → _Z_ reset _s_wap _r_ X→ +_F_ollow _D_lt Other _S_ave max_i_mize +_SPC_ cancel _o_nly this _d_elete +" + ("h" windmove-left ) + ("j" windmove-down ) + ("k" windmove-up ) + ("l" windmove-right ) + ("q" hydra-move-splitter-left) + ("w" hydra-move-splitter-down) + ("e" hydra-move-splitter-up) + ("r" hydra-move-splitter-right) + ("b" consult-buffer) + ("f" consult-fd) + ("F" follow-mode) + ("a" (lambda () + (interactive) + (ace-window 1) + (add-hook 'ace-window-end-once-hook + 'hydra-window/body)) + ) + ("v" (lambda () + (interactive) + (split-window-right) + (windmove-right)) + ) + ("x" (lambda () + (interactive) + (split-window-below) + (windmove-down)) + ) + ("s" (lambda () + (interactive) + (ace-window 4) + (add-hook 'ace-window-end-once-hook + 'hydra-window/body))) + ("S" save-buffer) + ("d" delete-window) + ("D" (lambda () + (interactive) + (ace-window 16) + (add-hook 'ace-window-end-once-hook + 'hydra-window/body)) + ) + ("o" delete-other-windows) + ("i" ace-maximize-window) + ("z" (progn + (winner-undo) + (setq this-command 'winner-undo)) + ) + ("Z" winner-redo) + ("SPC" nil)) + (global-set-key (kbd "C-c w") 'hydra-window/body) +#+end_src + +** Pulling it all together + +#+begin_src emacs-lisp +(use-package hydra + :demand t + :config + <> + <>) +#+end_src diff --git a/config/social.org b/config/social.org new file mode 100644 index 0000000..d209b18 --- /dev/null +++ b/config/social.org @@ -0,0 +1,21 @@ +* Socializing + +Here are some things I use to optionally communicate with the rest of the world +via Emacs. I keep them in separate files so I can optionally load them easily +on a system by system basis. + +#+begin_src emacs-lisp +;;; Extra optional files + +(defun maybe-load-rel (relpath) + "Loads a file relative to the user-emacs-directory fi it exists." + (let ((path (concat (file-name-as-directory user-emacs-directory) relpath))) + (when (file-exists-p path) + (load-file path)))) + +(maybe-load-rel "extra/email.el") +(maybe-load-rel "extra/feed.el") +(maybe-load-rel "extra/social.el") +;;; +#+end_src +