From: Eshel Yaron Date: Sun, 9 Jul 2023 05:59:28 +0000 (+0300) Subject: Update Emacs configuration X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bf9c80730b6291a5a33528361ca3b00b4dbea38a;p=dotfiles.git Update Emacs configuration --- diff --git a/.emacs.d/early-init.el b/.emacs.d/early-init.el index 5a555e7..317d0d4 100644 --- a/.emacs.d/early-init.el +++ b/.emacs.d/early-init.el @@ -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 diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1843506..94bee84 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -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 @@ -264,6 +264,9 @@ (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 @@ -314,7 +317,7 @@ 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" @@ -359,8 +362,6 @@ 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 @@ -430,9 +431,45 @@ (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." @@ -467,6 +504,8 @@ (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 "" #'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)))