This commit is contained in:
Zelong Kuang
2026-04-02 15:31:43 +11:00
parent a416bffb54
commit abaeeb6486
22 changed files with 23 additions and 204 deletions

View File

@@ -181,7 +181,12 @@ If this is a daemon session, load them all immediately instead."
(setq kill-whole-line t) (setq kill-whole-line t)
(setq make-backup-files nil) (setq make-backup-files nil)
(setq use-short-answers t) (setq use-short-answers t)
;; (setq frame-title-format "\n") (setq frame-title-format
'((:eval (if (and (boundp 'projectile-mode)
projectile-mode
(projectile-project-p))
(format "[%s] %s" (projectile-project-name) (buffer-name)) ;; Add project name in front when avaliable
"%b")))) ;; Otherwise buffer name only
(setq custom-safe-themes t) (setq custom-safe-themes t)
(add-to-list 'default-frame-alist '(drag-internal-border . 1)) (add-to-list 'default-frame-alist '(drag-internal-border . 1))

View File

@@ -117,6 +117,7 @@
([remap Info-search] . consult-info) ([remap Info-search] . consult-info)
;; ([remap isearch-forward] . consult-line) ;; ([remap isearch-forward] . consult-line)
([remap recentf-open-files] . consult-recent-file) ([remap recentf-open-files] . consult-recent-file)
([remap bookmark-jump] . consult-bookmark)
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
;; Custom M-# bindings for fast register access ;; Custom M-# bindings for fast register access
("M-#" . consult-register-load) ("M-#" . consult-register-load)

View File

@@ -86,6 +86,10 @@
org-faces org-entities org-list org-pcomplete org-src org-faces org-entities org-list org-pcomplete org-src
org-footnote org-macro ob org org-clock org-agenda org-footnote org-macro ob org org-clock org-agenda
org-capture)) org-capture))
(add-hook 'org-mode-hook
(lambda ()
(yas-activate-extra-mode 'LaTeX-mode)))
;; For hydra ;; For hydra
(defun hot-expand (str &optional mod) (defun hot-expand (str &optional mod)
"Expand org template. "Expand org template.
@@ -209,10 +213,6 @@ the element after the #+HEADER: tag."
("BUG" error bold) ("BUG" error bold)
("XXX" font-lock-constant-face bold)))) ("XXX" font-lock-constant-face bold))))
(add-hook 'org-mode-hook
(lambda ()
(yas-activate-extra-mode 'LaTeX-mode)))
(use-package org-latex-preview (use-package org-latex-preview
:straight nil :straight nil
:hook (org-mode . org-latex-preview-mode) :hook (org-mode . org-latex-preview-mode)

View File

@@ -164,10 +164,6 @@
;; but you can use any other Nerd Font if you want ;; but you can use any other Nerd Font if you want
(nerd-icons-font-family "Symbols Nerd Font Mono")) (nerd-icons-font-family "Symbols Nerd Font Mono"))
(use-package nerd-icons-ibuffer
:straight t
:hook (ibuffer-mode-hook . nerd-icons-ibuffer-mode))
;; Display transient in child frame ;; Display transient in child frame
;; (use-package transient-posframe ;; (use-package transient-posframe
;; :diminish ;; :diminish

View File

@@ -10,23 +10,21 @@
;; Recommended keymap prefix on Windows/Linux ;; Recommended keymap prefix on Windows/Linux
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)) (define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map))
(use-package ibuffer
:ensure nil
:bind ("C-x C-b" . ibuffer)
:init (setq ibuffer-filter-group-name-face '(:inherit (font-lock-string-face bold))))
(use-package nerd-icons-ibuffer
:straight t
:hook (ibuffer-mode-hook . nerd-icons-ibuffer-mode))
(use-package ibuffer-projectile (use-package ibuffer-projectile
:config :init
(add-hook 'ibuffer-hook (add-hook 'ibuffer-hook
(lambda () (lambda ()
(ibuffer-projectile-set-filter-groups) (ibuffer-projectile-set-filter-groups)
(unless (eq ibuffer-sorting-mode 'alphabetic) (unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-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)))
(global-set-key (kbd "C-x C-b") #'ibuffer)
(use-package beframe (use-package beframe
:hook after-init :hook after-init
:bind ("C-x f" . other-frame-prefix) :bind ("C-x f" . other-frame-prefix)
@@ -49,6 +47,7 @@
(beframe--assume (beframe--assume
(list (get-buffer buf)))))) (list (get-buffer buf))))))
;; Beframe integration with other packages
(with-eval-after-load 'consult (with-eval-after-load 'consult
(defun consult-beframe-buffer-list (&optional frame) (defun consult-beframe-buffer-list (&optional frame)
"Return the list of buffers from `beframe-buffer-names' sorted by visibility. "Return the list of buffers from `beframe-buffer-names' sorted by visibility.

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : abstract
# group: sections
# name : \abstract
# --
\begin{abstract}
$0
\end{abstract}

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# contributor : Rasmus Borgsmidt <rasmus@borgsmidt.dk>
# key : align
# group: environments
# name : \begin{align} ... \end{align}
# --
\begin{align}
$0
\end{align}

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# contributor : Rasmus Borgsmidt <rasmus@borgsmidt.dk>
# key : align*
# group: environments
# name : \begin{align*} ... \end{align*}
# --
\begin{align*}
$0
\end{align*}

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# contributor : Peter Urbak <peter@dragonwasrobot.com>
# key : arr
# group: environments
# name : \begin{array} ... \end{array}
# --
\begin{array}{$1}
$0
\end{array}

View File

@@ -1,28 +0,0 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# contributor : Song Qiang <tsiangsung@gmail.com>
# key: article
# group: skeleton
# name: \documentclass{article} ...
# --
\documentclass[11pt]{article}
\usepackage{graphicx,amsmath,amssymb,subfigure,url,xspace}
\newcommand{\eg}{e.g.,\xspace}
\newcommand{\bigeg}{E.g.,\xspace}
\newcommand{\etal}{\textit{et~al.\xspace}}
\newcommand{\etc}{etc.\@\xspace}
\newcommand{\ie}{i.e.,\xspace}
\newcommand{\bigie}{I.e.,\xspace}
\title{${1:title}}
\author{${2:Author Name}}
\begin{document}
\maketitle
\bibliographystyle{${3:plain}}
\bibliography{${4:literature.bib}}
\end{document}

View File

@@ -1,37 +0,0 @@
# -*- mode: snippet -*-
# contributor: Claudio Marforio <marforio@gmail.com>
# key: beamer
# group: skeleton
# name: \documentclass{beamer} ...
# --
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage{graphicx,subfigure,url}
% example themes
\usetheme{Frankfurt}
\usecolortheme{seahorse}
\usecolortheme{rose}
% put page numbers
% \setbeamertemplate{footline}[frame number]{}
% remove navigation symbols
% \setbeamertemplate{navigation symbols}{}
\title{${1:Presentation Title}}
\author{${2:Author Name}}
\begin{document}
\frame[plain]{\titlepage}
\begin{frame}[plain]{Outline}
\tableofcontents
\end{frame}
\section{${3:Example Section}}
\begin{frame}{${4:Frame Title}}
\end{frame}
\end{document}

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key : beg
# name : \begin{} ... \end{}
# --
\begin{${1:$$(yas-choose-value (mapcar 'car LaTeX-environment-list))}}
$0
\end{$1}

View File

@@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: bib
# group: misc
# name: \bibliography
# --
\bibliographystyle{plain}
\bibliography{$1}$0

View File

@@ -1,7 +1,8 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# contributor: François Garillot <francois@garillot.net> # contributor: François Garillot <francois@garillot.net>
# key: bigop # key: bop
# group: math # group: math
# name: \bigop_{n}^{} # name: \bigop_{n}^{}
# condition: (and (texmathp) 'auto)
# -- # --
\\big${1:$$(yas/choose-value '("oplus" "otimes" "odot" "cup" "cap" "uplus" "sqcup" "vee" "wedge"))}_{$2}^{$3}$0 \\big${1:$$(yas/choose-value '("oplus" "otimes" "odot" "cup" "cap" "uplus" "sqcup" "vee" "wedge"))}_{$2}^{$3}$0

View File

@@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : cha*
# group: sections
# name : \chapter*
# --
\chapter*{${1:name}}
$0

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key: enum
# group: environments
# name : \begin{enumerate} ... \end{enumerate}
# --
\begin{enumerate}
\item $0
\end{enumerate}

View File

@@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: eq
# group: math
# name: \begin{equation} ... \end{equation}
# --
\begin{equation}
\label{${1:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
\end{equation}

View File

@@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: eqs
# group: math
# name: \begin{align} ... \end{align}
# --
\begin{${1:$$(yas/choose-value '("align" "align*" "multline" "gather" "subequations"))}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
\end{$1}

View File

@@ -1,12 +0,0 @@
# -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : fig
# group: environments
# name : \begin{figure} ... \end{figure}
# --
\begin{figure}[htbp]
\centering
$0
\caption{${1:caption}}
\label{${2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
\end{figure}

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# contributor: Claudio Marforio <marforio@gmail.com>
# key: frame
# group: environments
# name : \begin{frame} ... \end{frame}
# --
\begin{frame}{${1:Frame Title$(capitalize yas-text)}}
$0
\end{frame}

View File

@@ -1,7 +1,7 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name: limit # name: limit
# key: lim # key: lim
# conditon: (texmathp) # condition: (and (texmathp) 'auto)
# group: math # group: math
# -- # --
\\lim_{${1:n} \\to ${2:\\infty}} $0 \\lim_{${1:n} \\to ${2:\\infty}} $0

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# contributor: Mads D. Kristensen <madsdk@gmail.com>
# key: minipage
# group: environments
# name: \begin{minipage}[position][width] ... \end{minipage}
# --
\begin{minipage}[${1:htbp}]{${2:1.0}${3:\linewidth}}
$0
\end{minipage}