update my uwaterloo address
[~bandali/configs] / .emacs.d / init.el
index 0f080b6..48971fd 100644 (file)
@@ -582,7 +582,7 @@ For disabling the behaviour for certain buffers and/or modes."
 
 (use-feature exwm-input
   :demand
-  :after exwm-workspace
+  :after exwm
   :config
   (defun b/exwm-ws-prev-index ()
     "Return the index for the previous EXWM workspace, wrapping
@@ -602,14 +602,16 @@ around if needed."
   ;; shorten 'C-c C-q' to 'C-q'
   (define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)
 
-  (setq exwm-input-global-keys
+  (setq exwm-workspace-number 4
+        exwm-input-global-keys
         `(([?\s-R] . exwm-reset)
           ([?\s-\\] . exwm-workspace-switch)
-          ([?\s-\s] . (lambda (command)
-                        (interactive
-                         (list (read-shell-command "➜ ")))
-                        (start-process-shell-command
-                         command nil command)))
+          ([?\s-\s] . dmenu)
+          ([?\S-\s-\s] . (lambda (command)
+                              (interactive
+                               (list (read-shell-command "➜ ")))
+                              (start-process-shell-command
+                               command nil command)))
           ([s-return] . (lambda ()
                           (interactive)
                           (start-process "" nil "urxvt")))
@@ -618,6 +620,18 @@ around if needed."
                            (interactive)
                            (start-process-shell-command
                             "rofi-pass" nil "rofi-pass")))
+          ([?\s-h] . windmove-left)
+          ([?\s-j] . windmove-down)
+          ([?\s-k] . windmove-up)
+          ([?\s-l] . windmove-right)
+          ([?\s-H] . windmove-swap-states-left)
+          ([?\s-J] . windmove-swap-states-down)
+          ([?\s-K] . windmove-swap-states-up)
+          ([?\s-L] . windmove-swap-states-right)
+          ([?\M-\s-h] . shrink-window-horizontally)
+          ([?\M-\s-l] . enlarge-window-horizontally)
+          ([?\M-\s-k] . shrink-window)
+          ([?\M-\s-j] . enlarge-window)
           ([?\s-\[] . (lambda ()
                         (interactive)
                         (exwm-workspace-switch-create
@@ -642,10 +656,10 @@ around if needed."
                     (number-sequence 0 (1- exwm-workspace-number)))
           ([?\s-t] . exwm-floating-toggle-floating)
           ([?\s-f] . exwm-layout-toggle-fullscreen)
-          ([?\s-w] . (lambda ()
+          ([?\s-W] . (lambda ()
                        (interactive)
                        (kill-buffer (current-buffer))))
-          ([?\s-q] . (lambda ()
+          ([?\s-Q] . (lambda ()
                        (interactive)
                        (exwm-manage--kill-client)))
           ([?\s-\'] . (lambda ()
@@ -681,7 +695,9 @@ around if needed."
           ([XF86ScreenSaver] .
            (lambda ()
                     (interactive)
-                    (start-process "" nil "dm-tool" "lock")))))
+                    (start-process "" nil "dm-tool" "lock")))
+          ([\s-XF86Back] . previous-buffer)
+          ([\s-XF86Forward] . next-buffer)))
 
   ;; Line-editing shortcuts
   (setq exwm-input-simulation-keys
@@ -706,9 +722,12 @@ around if needed."
       ([?\C-y] . [?\C-v])
       ([?\M-d] . [C-S-right ?\C-x])
       ([?\M-\d] . [C-S-left ?\C-x])
-      ;; search
+      ;; window
+      ([?\s-w] . [?\C-w])
+      ([?\s-q] . [?\C-q])
+      ;; misc
       ([?\C-s] . [?\C-f])
-      ;; escape
+      ([?\s-s] . [?\C-s])
       ([?\C-g] . [escape]))))
 
 (use-feature exwm-manage
@@ -721,9 +740,7 @@ around if needed."
                              ((string= exwm-class-name "Abrowser")
                               (exwm-input-set-local-simulation-keys
                                `(,@exwm-input-simulation-keys
-                                 ([?\C-\S-d] . [?\C-d])
-                                 ([?\C-q] . [?\C-w])
-                                 ([?\s-q] . [?\C-q]))))
+                                 ([?\C-\S-d] . [?\C-d]))))
                              ((string= exwm-class-name "URxvt")
                               (exwm-input-set-local-simulation-keys
                                '(([?\C-c ?\C-c] . [?\C-c])
@@ -745,11 +762,11 @@ around if needed."
   :config
   (exwm-systemtray-enable))
 
-(use-feature exwm-workspace
+(use-feature exwm-workspace)
+
+(use-package exwm-edit
   :demand
-  :after exwm
-  :custom
-  (exwm-workspace-number 4))
+  :after exwm)
 
 ;; use the org-plus-contrib package to get the whole deal
 (use-package org-plus-contrib)
@@ -1466,6 +1483,10 @@ This function is intended for use with `ivy-ignore-buffers'."
   :hook ((tex-mode . auto-fill-mode)
          (tex-mode . flyspell-mode)))
 
+(use-package george-mode
+  :straight (:host nil :repo "https://git.shemshak.org/amin/george-mode")
+  :mode "\\.grg\\'")
+
 \f
 ;;; Theme
 
@@ -1475,6 +1496,7 @@ This function is intended for use with `ivy-ignore-buffers'."
 (load-theme 'tangomod t)
 
 (use-package smart-mode-line
+  :disabled
   :commands (sml/apply-theme)
   :demand
   :config
@@ -1490,18 +1512,38 @@ This function is intended for use with `ivy-ignore-buffers'."
 
 (use-package doom-themes)
 
+(use-package solarized-theme
+  :disabled
+  :config
+  (load-theme 'solarized-light t))
+
+(use-package moody
+  :demand
+  :config
+  (setq x-underline-at-descent-line t)
+  (let ((line (face-attribute 'mode-line :underline)))
+    (set-face-attribute 'mode-line          nil :overline   line)
+    (set-face-attribute 'mode-line-inactive nil :overline   line)
+    (set-face-attribute 'mode-line-inactive nil :underline  line)
+    (set-face-attribute 'mode-line          nil :box        nil)
+    (set-face-attribute 'mode-line-inactive nil :box        nil)
+    (set-face-attribute 'mode-line-inactive nil :background "#eeeeee")) ; d3d7cf
+  (moody-replace-mode-line-buffer-identification)
+  (moody-replace-vc-mode))
+
 (defvar b/org-mode-font-lock-keywords
   '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
       (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
       (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
-      (4 '(:foreground "#c5c8c6") t))))                    ; title
+      (4 '(:foreground "#c5c8c6") t)))                     ; title
+  "For use with the `doom-tomorrow-night' theme.")
 
 (defun b/lights-on ()
   "Enable my favourite light theme."
   (interactive)
   (mapc #'disable-theme custom-enabled-themes)
   (load-theme 'tangomod t)
-  (sml/apply-theme 'automatic)
+  ;; (sml/apply-theme 'automatic)
   (font-lock-remove-keywords
    'org-mode b/org-mode-font-lock-keywords)
   (exwm-systemtray--refresh))
@@ -1510,8 +1552,8 @@ This function is intended for use with `ivy-ignore-buffers'."
   "Go dark."
   (interactive)
   (mapc #'disable-theme custom-enabled-themes)
-  (load-theme 'doom-tomorrow-night t)
-  (sml/apply-theme 'automatic)
+  (load-theme 'doom-one t)
+  ;; (sml/apply-theme 'automatic)
   (font-lock-add-keywords
    'org-mode b/org-mode-font-lock-keywords t)
   (exwm-systemtray--refresh))
@@ -1873,6 +1915,14 @@ This function is intended for use with `ivy-ignore-buffers'."
   :config (pdf-tools-install nil t)
   :custom (pdf-view-resize-factor 1.05))
 
+(use-package org-pdftools
+  :straight (:host github :repo "fuxialexander/org-pdftools")
+  :demand
+  :after org
+  :config
+  (with-eval-after-load 'org
+    (require 'org-pdftools)))
+
 (use-package biblio)
 
 (use-feature reftex
@@ -1897,9 +1947,7 @@ This function is intended for use with `ivy-ignore-buffers'."
   :config (minions-mode))
 
 (use-package dmenu
-  :disabled
   :custom
-  (dmenu-history-size 0)
   (dmenu-prompt-string "run: ")
   (dmenu-save-file (b/var "dmenu-items")))
 
@@ -1953,9 +2001,9 @@ This function is intended for use with `ivy-ignore-buffers'."
                                  ;; (: gnus-group-split-fancy "INBOX" t "INBOX")
                                  ;; gnu
                                  (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1")
-                                 ;; *@lists.sr.ht, omitting one dot if present
-                                 ;;    add more \\.?\\([^.@]*\\) if needed
-                                 (list ".*<~\\(.*\\)/\\([^.@]*\\)\\.?\\([^.@]*\\)@lists.sr.ht>.*" "l.~\\1.\\2\\3")
+                                 ;; *.lists.sr.ht, omitting one dot if present
+                                 ;;    add more \\.?\\([^.]*\\) if needed
+                                 (list ".*<~\\(.*\\)/\\([^.]*\\)\\.?\\([^.]*\\)\\.lists.sr.ht>.*" "l.~\\1.\\2\\3")
                                  ;; webmasters
                                  (from "webmasters\\(-comment\\)?@gnu\\.org" "webmasters")
                                  ;; other
@@ -2225,7 +2273,7 @@ https://csclub.uwaterloo.ca/~abandali")
            (body "")
            (eval (setq b/message-cite-say-hi nil)))
           ("nnimap\\+uw:.*"
-           (address "abandali@uwaterloo.ca")
+           (address "bandali@uwaterloo.ca")
            (signature b/uw-signature))
           ("nnimap\\+uw:INBOX"
            (gcc "\"nnimap+uw:Sent Items\""))
@@ -2308,7 +2356,7 @@ https://csclub.uwaterloo.ca/~abandali")
         message-subscribed-address-functions
         '(gnus-find-subscribed-addresses)
         message-dont-reply-to-names
-        "\\(\\(\\(amin\\|mab\\)@shemshak\\.org\\)\\|\\(amin@bndl\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a\\(min\\.\\)?bandali@uwaterloo\\.ca\\)\\|\\(abandali@csclub\\.uwaterloo\\.ca\\)\\)")
+        "\\(\\(\\(amin\\|mab\\)@shemshak\\.org\\)\\|\\(amin@bndl\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(\\(a\\(min\\.\\)?\\)?bandali@uwaterloo\\.ca\\)\\|\\(abandali@csclub\\.uwaterloo\\.ca\\)\\)")
   (require 'company-ebdb)
   :hook (;; (message-setup . mml-secure-message-sign-pgpmime)
          (message-mode . flyspell-mode)
@@ -2471,6 +2519,7 @@ https://csclub.uwaterloo.ca/~abandali")
   (erc-track-enable-keybindings nil)
   (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
                              "324" "329" "332" "333" "353" "477"))
+  (erc-track-position-in-mode-line t)
   (erc-track-priority-faces-only 'all)
   (erc-track-shorten-function nil))