This commit is contained in:
Zelong Kuang
2026-03-14 11:42:48 +11:00
parent 2bfe738a6a
commit 27dac8f3e9
22 changed files with 127 additions and 322 deletions

View File

@@ -135,6 +135,14 @@
;; (setq auto-save-file-name-transforms
;; `((".*" ,(concat user-emacs-directory "auto-save/") t)))
(use-package tramp-hlo
:config
(tramp-hlo-setup))
(use-package tramp-rpc
:ensure (tramp-rpc :host github :repo "ArthurHeymans/emacs-tramp-rpc")
:config
(tramp-rpc-magit-enable)
(tramp-rpc-projectile-enable))
(provide 'init-better-default)

View File

@@ -1,39 +1,42 @@
;; -*- lexical-binding: t; -*-
(use-package dashboard
(elpaca dashboard
(require 'dashboard))
(use-package doom-dashboard
:ensure (doom-dashboard :host github
:repo "emacs-dashboard/doom-dashboard")
:after dashboard
:demand t
:bind ("<f2>" . dashboard-open)
:diminish dashboard-mode
:custom-face
(dashboard-heading ((t (:inherit (font-lock-string-face bold)))))
(dashboard-items-face ((t (:weight normal))))
(dashboard-no-items-face ((t (:weight normal))))
:hook (dashboard-mode . (lambda () (setq-local frame-title-format nil)))
:config
(add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists)
(add-hook 'elpaca-after-init-hook #'dashboard-initialize)
:init
(setq dashboard-banner-logo-title "ZEMACS - Enjoy Programming & Writing"
;; dashboard-page-separator "\n\f\n"
dashboard-projects-backend 'project-el
dashboard-path-style 'truncate-middle
dashboard-path-max-length 60
dashboard-center-content t
dashboard-vertically-center-content t
dashboard-show-shortcuts nil
dashboard-items '((recents . 10)
(projects . 5)
(bookmarks . 5))
dashboard-startupify-list '(dashboard-insert-banner
dashboard-insert-newline
dashboard-insert-banner-title
dashboard-insert-newline
dashboard-insert-navigator
dashboard-insert-newline
dashboard-insert-init-info
dashboard-insert-items
dashboard-insert-newline
dashboard-insert-footer)))
;; Movement keys like doom.
:bind
(:map dashboard-mode-map
("<remap> <dashboard-previous-line>" . widget-backward)
("<remap> <dashboard-next-line>" . widget-forward)
("<remap> <previous-line>" . widget-backward)
("<remap> <next-line>" . widget-forward)
("<remap> <right-char>" . widget-forward)
("<remap> <left-char>" . widget-backward))
:custom
(dashboard-banner-logo-title "E M A C S")
(dashboard-startup-banner
(concat doom-dashboard-banner-directory "bcc.txt")) ; Use banner you want
(dashboard-footer-icon
(nerd-icons-faicon "nf-fa-github_alt" :face 'success :height 1.5))
(dashboard-page-separator "\n")
(dashboard-startupify-list `(dashboard-insert-banner
dashboard-insert-banner-title
dashboard-insert-newline
dashboard-insert-items
,(dashboard-insert-newline 2)
dashboard-insert-init-info
,(dashboard-insert-newline 2)
doom-dashboard-insert-homepage-footer))
(dashboard-item-generators
'((recents . doom-dashboard-insert-recents-shortmenu)
(bookmarks . doom-dashboard-insert-bookmark-shortmenu)
(projects . doom-dashboard-insert-project-shortmenu)
(agenda . doom-dashboard-insert-org-agenda-shortmenu)))
(dashboard-items '(projects agenda bookmarks recents)))
(provide 'init-dashboard)

View File

@@ -1,15 +1,15 @@
;; -*- lexical-binding: t; -*-
;;;;;;;;;;;; elpaca initialise ;;;;;;;;;;;;;;;;;;
(defvar elpaca-installer-version 0.11)
(defvar elpaca-installer-version 0.12)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
(defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
:ref nil :depth 1 :inherit ignore
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
:build (:not elpaca--activate-package)))
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
:build (:not elpaca-activate)))
(let* ((repo (expand-file-name "elpaca/" elpaca-sources-directory))
(build (expand-file-name "elpaca/" elpaca-builds-directory))
(order (cdr elpaca-order))
(default-directory repo))
@@ -39,7 +39,6 @@
(let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
;; Install a package via the elpaca macro
;; See the "recipes" section of the manual for more details.

View File

@@ -45,6 +45,9 @@
calc-angle-mode rad)))))))
;; (setq TeX-view-program-selection '((output-pdf "PDF Tools")))
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
(setq reftex-plug-into-AUCTeX t)
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs '((LaTeX-mode latex-mode) "texlab"))))

View File

@@ -19,50 +19,34 @@
(use-package solaire-mode
:hook (elpaca-after-init . solaire-global-mode))
(use-package standard-themes :demand t)
(use-package ef-themes :demand t)
(use-package doric-themes
:demand t
:bind ("<f5>" . doric-load-random)
:init
(defun doric-load-random ()
(interactive)
(mapc #'disable-theme custom-enabled-themes)
(let* ((themes '(doric-fire
doric-oak
doric-jade
doric-wind
doric-beach
doric-earth
doric-valley))
(loaded (seq-random-elt themes)))
(load-theme loaded :no-confirm)))
(doric-load-random)
)
(use-package standard-themes :demand t
:config
(modus-themes-load-theme 'standard-wombat))
;; (use-package doom-themes
;; (use-package doric-themes
;; :demand t
;; :bind ("<f5>" . doric-load-random)
;; :init
;; (setq doom-themes-enable-bold t)
;; (setq doom-themes-enable-italic t))
;; (defun doric-load-random ()
;; (interactive)
;; (mapc #'disable-theme custom-enabled-themes)
;; (let* ((themes '(doric-fire
;; doric-oak
;; doric-jade
;; doric-wind
;; doric-beach
;; doric-earth
;; doric-valley))
;; (loaded (seq-random-elt themes)))
;; (load-theme loaded :no-confirm)))
;; (doric-load-random)
;; )
;; (require 'modus-summer-time)
(use-package modus-themes
:init
(setq modus-themes-italic-constructs t
modus-themes-bold-constructs t
modus-themes-mixed-fonts t)
(setq modus-themes-headings ; read the manual's entry or the doc string
'((0 . (regular 1))
(1 . (regular 1))
(2 . (regular 1))
(3 . (regular 1))
(4 . (regular 1))
(5 . (regular 1)) ; absence of weight means `bold'
(6 . (regular 1))
(7 . (regular 1))
(t . (regular 1)))))
modus-themes-mixed-fonts t))
(use-package rainbow-delimiters
:hook ((prog-mode . rainbow-delimiters-mode)
@@ -72,6 +56,12 @@
(use-package rainbow-mode
:hook elpaca-after-init)
;; (use-package nano-theme
;; :ensure (nano-theme :type git :host github
;; :repo "rougier/nano-theme")
;; :init
;; (modus-themes-load-theme 'nano-dark))
(use-package doom-modeline
:hook (elpaca-after-init . doom-modeline-mode)
:config
@@ -107,7 +97,7 @@
(pcase system-type
('darwin ; macOS
(set-face-attribute 'default nil :font "Sarasa Term SC-22") ; 20 * 1.5
(set-face-attribute 'default nil :font "Sarasa Mono TC Nerd Font-22") ; 20 * 1.5
(set-face-attribute 'variable-pitch nil :font "Bookerly-22" :weight 'light)
(set-face-attribute 'fixed-pitch nil :font "Sarasa Term SC-22")
@@ -115,7 +105,7 @@
(add-to-list 'default-frame-alist '(width . 120)))
('gnu/linux ; Linux (including Debian)
(set-face-attribute 'variable-pitch nil :font "Sarasa Term SC-14") ; 20 * 1.5
(set-face-attribute 'variable-pitch nil :font "Sarasa Mono TC Nerd Font-14") ; 20 * 1.5
(add-to-list 'default-frame-alist '(height . 40))
(add-to-list 'default-frame-alist '(width . 90))))
@@ -124,7 +114,9 @@
:hook LaTeX-mode)
(use-package diff-hl
:init (global-diff-hl-mode))
:hook (elpaca-after-init global-diff-hl-mode)
:hook (elpaca-after-init diff-hl-dired-mode)
:hook (elpaca-after-init diff-hl-flydiff-mode))
;; Easily adjust the font size in all frames
(use-package default-text-scale

View File

@@ -1,64 +1,17 @@
;; -*- lexical-binding: t; -*-
(use-package project)
;; (use-package project)
(use-package projectile
:hook elpaca-after-init
:config
;; Recommended keymap prefix on macOS
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
;; Recommended keymap prefix on Windows/Linux
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map))
(global-set-key (kbd "C-x C-b") #'ibuffer)
;; (use-package tab-bar
;; :ensure nil
;; :init
;; (tab-bar-mode t)
;; (setq tab-bar-new-tab-choice "*scratch*") ;; buffer to show in new tabs
;; (setq tab-bar-close-button-show nil) ;; hide tab close / X button
;; (setq tab-bar-show t) ;; hide bar if <= 1 tabs open
;; (setq tab-bar-format '(tab-bar-format-tabs tab-bar-separator))
;; (setq tab-bar-tab-hints t))
;; (use-package tabspaces
;; :functions tabspaces-mode
;; :commands (tabspaces-switch-or-create-workspace
;; tabspaces-open-or-create-project-and-workspace)
;; :hook (elpaca-after-init . tabspaces-mode)
;; :bind (:map tabspaces-mode-map
;; ([remap project-switch-project] . tabspaces-project-switch-project-open-file))
;; :bind (:map tabspaces-command-map
;; ("l" . tabspaces-restore-session)
;; ("s" . tabspaces-save-session)
;; ("TAB" . tabspaces-switch-or-create-workspace))
;; :custom
;; (tabspaces-use-filtered-buffers-as-default t)
;; (tabspaces-default-tab "Default")
;; (tabspaces-remove-to-default t)
;; (tabspaces-include-buffers '("*scratch*" "*Messages*"))
;; (tabspaces-exclude-buffers '("*eat*" "*vterm*" "*shell*" "*eshell*"))
;; ;; sessions
;; (tabspaces-session t)
;; (tabspaces-session-auto-restore t)
;; (tabspaces-keymap-prefix "C-c o")
;; (tab-bar-new-tab-choice "default")
;; (with-eval-after-load 'consult
;; ;; hide full buffer list (still available with "b" prefix)
;; (consult-customize consult--source-buffer :hidden nil :default nil)
;; ;; set consult-workspace buffer list
;; (defvar consult--source-workspace
;; (list :name "Workspace Buffers"
;; :narrow ?w
;; :history 'buffer-name-history
;; :category 'buffer
;; :state #'consult--buffer-state
;; :default t
;; :items (lambda () (consult--buffer-query
;; :predicate #'tabspaces--local-buffer-p
;; :sort 'visibility
;; :as #'buffer-name)))
;; "Set workspace buffer list for consult-buffer.")
;; (add-to-list 'consult-buffer-sources 'consult--source-workspace)))
(use-package beframe
:hook elpaca-after-init
:bind (("C-x b" . beframe-switch-buffer)
@@ -67,4 +20,22 @@
:config
(define-key global-map (kbd "C-c b") #'beframe-prefix-map))
(use-package desktop
:ensure nil
:demand t
:init
(setq desktop-dirname (expand-file-name user-emacs-directory)
desktop-path (list desktop-dirname)
desktop-save t
desktop-files-not-to-save "^$" ;reload tramp paths
desktop-load-locked-desktop nil
desktop-restore-eager 4)
:config
(desktop-save-mode 1))
(use-package eyebrowse
:hook elpaca-after-init
:custom
(eyebrowse-new-workspace t))
(provide 'init-workspace)