From fcb5f35aad5811e6549dd71b7898f69a5665c1ea Mon Sep 17 00:00:00 2001 From: Zelong Kuang Date: Sun, 22 Mar 2026 20:26:17 +1100 Subject: [PATCH] Update --- .gitignore | 1 + auctex/elegantbook.el | 26 ++++++------------- early-init.el | 4 +-- lisp/init-better-default.el | 10 ++++++- lisp/init-coding.el | 11 +++----- lisp/init-org.el | 5 ++-- lisp/init-utils.el | 2 ++ lisp/init-workspace.el | 22 ++++++++++++++++ snippets/latex-mode/Display Math | 4 +-- snippets/latex-mode/greater or equal | 2 +- snippets/latex-mode/implied by | 2 +- snippets/latex-mode/less or equal | 2 +- snippets/latex-mode/lrangle | 2 +- snippets/latex-mode/newline | 8 ------ snippets/latex-mode/not in | 2 +- .../latex-mode/{complex conjugate => sqrt} | 8 +++--- 16 files changed, 61 insertions(+), 50 deletions(-) delete mode 100644 snippets/latex-mode/newline rename snippets/latex-mode/{complex conjugate => sqrt} (62%) diff --git a/.gitignore b/.gitignore index 846a65b..63d97f2 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ rime flycheck_*.el tabsession.el emacs.desktop +!alias # generated by elisp packages at root /.local/ diff --git a/auctex/elegantbook.el b/auctex/elegantbook.el index 1568db5..cd930bf 100644 --- a/auctex/elegantbook.el +++ b/auctex/elegantbook.el @@ -3,29 +3,13 @@ (TeX-add-style-hook "elegantbook" (lambda () + (setq TeX-command-extra-options + "-shell-escape") (TeX-add-to-alist 'LaTeX-provided-class-options '(("book" "a4paper" "oneside"))) (TeX-add-to-alist 'LaTeX-provided-package-options '(("kvoptions" "") ("etoolbox" "") ("setspace" "") ("csquotes" "") ("hyperref" "") ("geometry" "") ("indentfirst" "") ("comment" "") ("mtpro2" "lite") ("iftex" "") ("newtxtext" "") ("helvet" "scaled=.90") ("fontspec" "no-math") ("ctex" "UTF8" "scheme=plain" "fontset=none") ("anyfontsize" "") ("newtxmath" "") ("esint" "") ("xcolor" "table") ("mwe" "") ("enumerate" "") ("enumitem" "shortlabels" "inline") ("caption" "labelfont={bf,color=structurecolor}") ("footmisc" "flushmargin" "stable") ("graphicx" "") ("amsmath" "") ("mathrsfs" "") ("amsfonts" "") ("amssymb" "") ("physics" "") ("physics2" "") ("mathtools" "") ("booktabs" "") ("multirow" "") ("tikz" "") ("fancyvrb" "") ("makecell" "") ("lipsum" "") ("hologo" "") ("titlesec" "center" "pagestyles") ("appendix" "title" "titletoc" "header") ("biblatex" "backend=\\ELEGANT@bibend" "citestyle=\\ELEGANT@citestyle" "bibstyle=\\ELEGANT@bibstyle") ("inputenc" "utf8") ("fontenc" "T1" "T2A") ("babel" "italian" "french" "dutch" "magyar" "spanish" "mongolian" "portuguese") ("luatexja" "") ("apptools" "") ("pifont" "") ("manfnt" "") ("bbding" "") ("tcolorbox" "many") ("amsthm" "") ("multicol" "") ("adforn" "") ("fancyhdr" "") ("listings" "") ("bm" "") ("calc" "") ("tocloft" "titles"))) - (add-to-list 'LaTeX-verbatim-environments-local "lstlisting") - (add-to-list 'LaTeX-verbatim-environments-local "SaveVerbatim") - (add-to-list 'LaTeX-verbatim-environments-local "VerbatimOut") - (add-to-list 'LaTeX-verbatim-environments-local "LVerbatim*") - (add-to-list 'LaTeX-verbatim-environments-local "LVerbatim") - (add-to-list 'LaTeX-verbatim-environments-local "BVerbatim*") - (add-to-list 'LaTeX-verbatim-environments-local "BVerbatim") - (add-to-list 'LaTeX-verbatim-environments-local "Verbatim*") - (add-to-list 'LaTeX-verbatim-environments-local "Verbatim") - (add-to-list 'LaTeX-verbatim-macros-with-braces-local "lstinline") - (add-to-list 'LaTeX-verbatim-macros-with-braces-local "href") - (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage") - (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl") - (add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl") - (add-to-list 'LaTeX-verbatim-macros-with-braces-local "url") (add-to-list 'LaTeX-verbatim-macros-with-braces-local "path") - (add-to-list 'LaTeX-verbatim-macros-with-delims-local "lstinline") - (add-to-list 'LaTeX-verbatim-macros-with-delims-local "Verb*") - (add-to-list 'LaTeX-verbatim-macros-with-delims-local "Verb") (add-to-list 'LaTeX-verbatim-macros-with-delims-local "path") (TeX-run-style-hooks "latex2e" @@ -180,6 +164,12 @@ '("problem" LaTeX-env-args ["argument"] 0) '("exercise" LaTeX-env-args ["argument"] 0) '("example" LaTeX-env-args ["argument"] 0) + '("theorem" LaTeX-env-args ["argument"] 0) + '("definition" LaTeX-env-args ["argument"] 0) + '("proposition" LaTeX-env-args ["argument"] 0) + '("lemma" LaTeX-env-args ["argument"] 0) + '("axiom" LaTeX-env-args ["argument"] 0) + '("corollary" LaTeX-env-args ["argument"] 0) '("custom" 1) "note" "proof" diff --git a/early-init.el b/early-init.el index a82c325..a33b949 100644 --- a/early-init.el +++ b/early-init.el @@ -11,8 +11,8 @@ (setq package-enable-at-startup nil) -(setq native-comp-jit-compilation nil) -(setq native-comp-async-report-pwarnings-errors nil) +(setq native-comp-jit-compilation t) +(setq native-comp-async-report-warnings-errors nil) (add-to-list 'load-path (expand-file-name "lisp/" user-emacs-directory)) (setq use-package-enable-imenu-support t) diff --git a/lisp/init-better-default.el b/lisp/init-better-default.el index d6dead2..f914d76 100644 --- a/lisp/init-better-default.el +++ b/lisp/init-better-default.el @@ -37,6 +37,13 @@ (column-number-mode 1) (scroll-bar-mode -1) +;; (use-package delete-trailing +;; :ensure nil +;; :hook (text-mode delete-trailing-whitespace-mode) +;; :hook (prog-mode delete-trailing-whitespace-mode)) +(add-hook 'prog-mode #'delete-trailing-whitespace-mode) +(add-hook 'text-mode #'delete-trailing-whitespace-mode) + (use-package subword :ensure nil :diminish @@ -114,7 +121,8 @@ :map lisp-interaction-mode-map ("C-c C-d" . helpful-at-point) :map helpful-mode-map - ("r" . remove-hook-at-point)) + ("r" . remove-hook-at-point) + ("q" . kill-current-buffer)) :hook (helpful-mode . cursor-sensor-mode) ; for remove-advice button :init (with-no-warnings diff --git a/lisp/init-coding.el b/lisp/init-coding.el index 8c91300..2deb7b7 100644 --- a/lisp/init-coding.el +++ b/lisp/init-coding.el @@ -43,7 +43,7 @@ :defines eshell-highlight-prompt :autoload (epe-theme-lambda epe-theme-dakrone epe-theme-pipeline) :init - (setq eshell-highlight-prompt nil + (setq eshell-highlight-prompt t eshell-prompt-function #'epe-theme-lambda)) (use-package eshell-z @@ -53,12 +53,9 @@ :commands setup-esh-help-eldoc :init (setup-esh-help-eldoc)) -;; (use-package vterm) - -;; (use-package vterm-toggle -;; :bind ("C-`" . vterm-toggle) -;; :config -;; (define-key vterm-mode-map (kbd "C-`") #'vterm-toggle)) +(use-package eshell-syntax-highlighting + :after eshell-mode + :hook (elpaca-after-init . eshell-syntax-highlighting-global-mode)) (use-package editorconfig :diminish diff --git a/lisp/init-org.el b/lisp/init-org.el index 4da9642..535cdff 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -193,8 +193,9 @@ the element after the #+HEADER: tag." :hook (org-latex-preview-mode . org-latex-preview-center-mode) :config ;; Higher resolution when using dvipng - (plist-put org-latex-preview-appearance-options :page-width 0.6) - (plist-put org-latex-preview-appearance-options :scale 1.8) + (plist-put org-latex-preview-appearance-options :page-width 1.0) + ;; (plist-put org-latex-preview-appearance-options :margin 1) + (plist-put org-latex-preview-appearance-options :scale 2.0) ;; ;; Block C-n, C-p etc from opening up previews when using `org-latex-preview-mode' ;; (setq org-latex-preview-mode-ignored-commands diff --git a/lisp/init-utils.el b/lisp/init-utils.el index 7afa06b..1e43bb9 100644 --- a/lisp/init-utils.el +++ b/lisp/init-utils.el @@ -1,5 +1,7 @@ ;; -*- lexical-binding: t; -*- +(use-package rg) + (use-package which-key :diminish :functions childframe-completion-workable-p diff --git a/lisp/init-workspace.el b/lisp/init-workspace.el index daa2a0f..fb385e0 100644 --- a/lisp/init-workspace.el +++ b/lisp/init-workspace.el @@ -10,6 +10,28 @@ ;; Recommended keymap prefix on Windows/Linux (define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)) +(use-package ibuffer-projectile + :config + (add-hook 'ibuffer-hook + (lambda () + (ibuffer-projectile-set-filter-groups) + (unless (eq ibuffer-sorting-mode 'alphabetic) + (ibuffer-do-sort-by-alphabetic))))) + +(use-package consult-projectile + :bind (([remap projectile-find-file] . consult-projectile-find-file) + ([remap projectile-recentf] . consult-projectile-recentf) + ([remap projectile-switch-project] . consult-projectile-switch-project) + ([remap projectile-switch-to-buffer] . consult-projectile-switch-to-buffer) + ([remap projectile-find-dir] . consult-projectile-find-dir))) + +;; (use-package org-project-capture) + +;; (use-package org-projectile +;; :config +;; (setq org-project-capture-default-backend +;; (make-instance 'org-project-capture-projectile-backend))) + (global-set-key (kbd "C-x C-b") #'ibuffer) ;; (use-package beframe diff --git a/snippets/latex-mode/Display Math b/snippets/latex-mode/Display Math index 090572d..b59a1d5 100644 --- a/snippets/latex-mode/Display Math +++ b/snippets/latex-mode/Display Math @@ -3,6 +3,4 @@ # condition: (and (not (texmathp)) (quote auto)) # group: math # -- -\[ - $0 -\] \ No newline at end of file +\[ $0 \] \ No newline at end of file diff --git a/snippets/latex-mode/greater or equal b/snippets/latex-mode/greater or equal index ac8e050..28d481f 100644 --- a/snippets/latex-mode/greater or equal +++ b/snippets/latex-mode/greater or equal @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: greater or equal -# key: geq +# key: >= # condition: (and (texmathp) 'auto) # group: math # -- diff --git a/snippets/latex-mode/implied by b/snippets/latex-mode/implied by index f5f91bf..bb44cbb 100644 --- a/snippets/latex-mode/implied by +++ b/snippets/latex-mode/implied by @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: implied by -# key: <= +# key: =< # condition: (and (texmathp) 'auto) # group: math # -- diff --git a/snippets/latex-mode/less or equal b/snippets/latex-mode/less or equal index ba5dba3..1222957 100644 --- a/snippets/latex-mode/less or equal +++ b/snippets/latex-mode/less or equal @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: less or equal -# key: leq +# key: <= # condition: (and (texmathp) 'auto) # group: math # -- diff --git a/snippets/latex-mode/lrangle b/snippets/latex-mode/lrangle index d742715..62860a3 100644 --- a/snippets/latex-mode/lrangle +++ b/snippets/latex-mode/lrangle @@ -4,4 +4,4 @@ # condition: (and (texmathp) 'auto) # group: math # -- -\\left\\langle $1 \\right\\rangle$0 \ No newline at end of file +\\left\\langle $1 \\right\\rangle \ No newline at end of file diff --git a/snippets/latex-mode/newline b/snippets/latex-mode/newline deleted file mode 100644 index 905e809..0000000 --- a/snippets/latex-mode/newline +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: newline -# key: \\ -# condition: (and (texmathp) 'auto) -# group: math -# -- -\\\\ -`(save-excursion (previous-line)(make-string (current-indentation) ?\s))`$0 \ No newline at end of file diff --git a/snippets/latex-mode/not in b/snippets/latex-mode/not in index 53d3a72..cde6e63 100644 --- a/snippets/latex-mode/not in +++ b/snippets/latex-mode/not in @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: not in -# key: notin +# key: !in # condition: (and (texmathp) 'auto) # group: math # -- diff --git a/snippets/latex-mode/complex conjugate b/snippets/latex-mode/sqrt similarity index 62% rename from snippets/latex-mode/complex conjugate rename to snippets/latex-mode/sqrt index a873f81..5268b46 100644 --- a/snippets/latex-mode/complex conjugate +++ b/snippets/latex-mode/sqrt @@ -1,7 +1,7 @@ # -*- mode: snippet -*- -# name: complex conjugate -# key: cj -# condition: (and (texmathp) 'auto) +# name: sqrt +# key: sq # group: math +# condition: (and (texmathp) 'auto) # -- -^{\\star}$0 \ No newline at end of file +\\sqrt{$1} \ No newline at end of file