]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update Emacs configuration
authorEshel Yaron <me@eshelyaron.com>
Sun, 9 Jul 2023 05:59:28 +0000 (08:59 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Jul 2023 05:59:28 +0000 (08:59 +0300)
.emacs.d/early-init.el
.emacs.d/init.el

index 5a555e714c61db682dbb5028b78b4b7efd58cf0c..317d0d4d7d45ffc4fb8b4e40f6f04350222f858f 100644 (file)
@@ -6,5 +6,11 @@
 (tool-bar-mode -1)
 (set-scroll-bar-mode nil)
 
+(unless (eq system-type 'darwin)
+  (menu-bar-mode -1))
+
+(setq initial-frame-alist '((fullscreen . fullboth)
+                            (alpha-background . 85)))
+
 (provide 'early-init)
 ;;; early-init.el ends here
index 184350691e2644b406fe5b3d06c9b53738ad34b8..94bee8477f78af258de35891cf818898b3beaebd 100644 (file)
@@ -49,7 +49,7 @@
    ;; don't use stale .elc files
    load-prefer-newer t
    ;; maximize Emacs on startup
-   default-frame-alist '((fullscreen . fullboth))
+   ;; default-frame-alist '((fullscreen . fullboth))
    ;; disable popup dialogs
    use-dialog-box nil
    ;; disable splash screen
                                            (underline-link-visited border)
                                            (underline-link-symbolic border)
                                            (fg-region unspecified))
+   ef-themes-mixed-fonts t
+   ef-themes-variable-pitch-ui t
+   ef-themes-region nil
    ;; follow links to version-controlled files without confirming
    vc-follow-symlinks t
    ;; jump from .c to .h files with find-sibling-file
    gnus-face-1 'bold
    gnus-face-2 'gnus-cite-1
    gnus-face-3 'shadow
-   gnus-summary-line-format "%1{%U%R%z%}%B%2{%f%} %3{(%&user-date;, %k)%}:%* %s\n"
+   gnus-summary-line-format "%1{%U%R%z%}%B%2{%~(form (replace-regexp-in-string \" via .*\" \"\" (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header gnus-tmp-from)))@%} %3{(%&user-date;, %k)%}:%* %s\n"
    gnus-simplify-subject-functions '(gnus-simplify-subject-re)
    gnus-treat-display-smileys nil
    gnus-secondary-select-methods '((nnimap "gmail"
    magit-repository-directories '(("~/checkouts/" . 1))
    ;; have Dired operations target another visible Dired buffer
    dired-dwim-target t
-   ;; use zsh in vterm by default
-   vterm-shell "/bin/zsh"
    vterm-max-scrollback 2048
    vterm-kill-buffer-on-exit nil
    vterm-use-vterm-prompt-detection-method t
   (setq-default indent-tabs-mode nil))
 
 (esy/init-step theme
-  "Load the `modus-vivendi' theme."
-  (require-theme 'modus-themes)
-  (load-theme 'modus-vivendi))
+  "Load and enable a custom theme."
+  ;; (require-theme 'modus-themes)
+  ;; (load-theme 'modus-vivendi)
+  (require 'ef-themes)
+
+    (defun esy/ef-themes-load-random ()
+    (interactive)
+    (let* ((themes (seq-filter
+                    (lambda (theme)
+                      (not (equal theme (ef-themes--current-theme))))
+                    '(
+                      ef-autumn
+                      ef-bio
+                      ef-cherie
+                      ef-cyprus
+                      ef-dark
+                      ef-day
+                      ef-duo-dark
+                      ef-duo-light
+                      ef-elea-dark
+                      ef-elea-light
+                      ef-frost
+                      ef-kassio
+                      ef-light
+                      ef-night
+                      ef-spring
+                      ef-summer
+                      ef-symbiosis
+                      ef-trio-dark
+                      ef-trio-light
+                      ef-winter
+                      )))
+           (n (random (length themes)))
+           (pick (nth n themes))
+           (loaded (if (null pick) (car themes) pick)))
+      (ef-themes--load-theme loaded)
+      (message "Loaded `%s'" loaded)))
+
+  (esy/ef-themes-load-random))
 
 (esy/init-step fonts
   "Set up the Iosevka font family."
         (backward-word)
         (kill-region (point) end))))
 
+  (defvar duplicate-line-final-position)
+
   (defun duplicate-line-stay (arg)
     (interactive "p")
     (let ((duplicate-line-final-position 0))
@@ -714,7 +753,6 @@ Interactively, POINT is point and KILL is the prefix argument."
   (keymap-global-set "C-c l" #'org-store-link)
   (keymap-global-set "C-c a" #'org-agenda)
   (keymap-global-set "C-c v" #'vterm-other-window)
-  (keymap-global-set "C-c p" sweeprolog-prefix-map)
   (keymap-global-set "C-c S" #'scratch-buffer)
   (keymap-global-set "C-c m" #'esy/emms-map)
   (keymap-global-set "C-c !" #'consult-flymake)
@@ -747,6 +785,7 @@ Interactively, POINT is point and KILL is the prefix argument."
   (keymap-global-set "C-s-f" #'toggle-frame-fullscreen)
   (keymap-global-set "C-s-l" #'esy/pulse-line)
   (keymap-global-set "\"" #'insert-pair)
+  (keymap-global-set "<f5>" #'esy/ef-themes-load-random)
 
   (keymap-set ctl-x-map "b" #'consult-buffer)
   (keymap-set ctl-x-4-map "b" #'consult-buffer-other-window)
@@ -1074,6 +1113,8 @@ as the initial input for completion, and return that directory."
 (esy/init-step vterm
   "Configure terminal emulation via `vterm'."
   (with-eval-after-load 'vterm
+    (when (eq system-type 'darwin)
+      (setq vterm-shell "/bin/zsh"))
     (add-to-list 'vterm-tramp-shells '("kubernetes" "/bin/bash"))))
 
 (esy/init-step paredit
@@ -1089,6 +1130,7 @@ as the initial input for completion, and return that directory."
   (with-eval-after-load 'sweeprolog
     (setq sweeprolog-top-level-persistent-history
           (locate-user-emacs-file ".sweep_history"))
+    (keymap-global-set "C-c p" sweeprolog-prefix-map)
     (add-hook 'sweeprolog-mode-hook #'sweeprolog-electric-layout-mode)
     (add-hook 'sweeprolog-top-level-mode-hook #'compilation-shell-minor-mode)))