Add built-in functionality

This commit is contained in:
lemyx 2025-01-27 11:40:07 +08:00
parent 44bb63ffe0
commit 9cea46891f
10 changed files with 57 additions and 29 deletions

View File

@ -22,6 +22,7 @@
(require 'init-rime)
;; Edit
(require 'init-edit)
(require 'init-completion)
(require 'init-meow)
(require 'init-dired)

View File

@ -1,15 +1,7 @@
#!/bin/bash
if command -v xelatex > /dev/null 2> /dev/null; then
echo "TeX Live is already installed."
else
echo "ERROR! TeX Live has not been installed. Make sure it's installed and environment variables are configured correctly."
echo "Depends on the TeX Live edition, append corresponding environments variables into ~/.zshrc"
echo 'export PATH="/usr/local/texlive/2023/bin/x86_64-linux:$PATH"'
echo 'export MANPATH="/usr/local/texlive/2023/texmf-dist/doc/man:$MANPATH"'
echo 'export INFOPATH="/usr/local/texlive/2023/texmf-dist/doc/info:$INFOPATH"'
exit 1
fi
# LaTeX
brew install texlive
# emacs
brew tap d12frosted/emacs-plus
@ -29,9 +21,10 @@ brew install node
npm install -g yaml-language-server
npm install -g bash-language-server
npm install -g vscode-langservers-extracted
pip3 install ruff-lsp --break-system-packages
brew install texlab
brew install basedpyright
brew install ruff
brew install beancount-language-server
# aider
brew install aider

12
lisp/init-edit.el Normal file
View File

@ -0,0 +1,12 @@
;;; init-edit.el --- Edit settings -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; sudo-edit
(use-package sudo-edit)
(provide 'init-edit)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-edit.el ends here

View File

@ -27,7 +27,7 @@
when (font-installed-p font)
return (set-face-attribute 'default nil
:family font
:height (cond (sys/macp 130)
:height (cond (sys/macp 160)
(sys/win32p 110)
(t 100))))

View File

@ -12,6 +12,9 @@
(setq org-startup-numerated t)
; Hide emphasis markup characters in buffers @ https://orgmode.org/manual/Emphasis-and-Monospace.html
(setq org-hide-emphasis-markers t)
; if there is a #+ATTR.*: width="200", resize to 200, otherwise resize to 320
(setq org-image-actual-width '(320))
(setq org-startup-with-inline-images t)
; https://orgmode.org/manual/Fast-access-to-TODO-states.html
; https://orgmode.org/guide/Progress-Logging.html
(setq org-todo-keywords
@ -91,9 +94,6 @@
:config
(setq-default org-download-heading-lvl nil)
(setq-default org-download-image-dir "./img")
;;if there is a #+ATTR.*: width="200", resize to 200, otherwise resize to 320
(setq org-image-actual-width '(320))
(setq org-startup-with-inline-images t)
:hook
(org-mode . org-download-enable))

View File

@ -5,19 +5,20 @@
(use-package pdf-tools
:mode ("\\.pdf\\'" . pdf-view-mode) ; pdf 文件默认打开方式
:bind
(:map pdf-view-mode-map
("d" . pdf-view-next-page-command)
("a" . pdf-view-previous-page-command)
("s" . pdf-view-scroll-up-or-next-page)
("w" . pdf-view-scroll-down-or-previous-page)
:map pdf-history-minor-mode-map
("b" . pdf-history-backward)
:map pdf-annot-minor-mode-map
("C-a a" . pdf-annot-add-highlight-markup-annotation)
("C-a s" . pdf-annot-add-squiggly-markup-annotation)
("C-a u" . pdf-annot-add-underline-markup-annotation)
("C-a d" . pdf-annot-delete))
;; :bind
;; (:map pdf-view-mode-map
;; ("d" . pdf-view-next-page-command)
;; ("a" . pdf-view-previous-page-command)
;; ("s" . pdf-view-scroll-up-or-next-page)
;; ("w" . pdf-view-scroll-down-or-previous-page)
;; :map pdf-history-minor-mode-map
;; ("b" . pdf-history-backward)
;; :map pdf-annot-minor-mode-map
;; ("C-a a" . pdf-annot-add-highlight-markup-annotation)
;; ("C-a s" . pdf-annot-add-squiggly-markup-annotation)
;; ("C-a u" . pdf-annot-add-underline-markup-annotation)
;; ("C-a d" . pdf-annot-delete)
;; )
:custom
(pdf-view-midnight-colors '("#000000" . "#9bCD9b")) ; 夜间模式设置绿色底色
:config

View File

@ -5,7 +5,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; auto-revert
(global-auto-revert-mode 1)
(use-package autorevert
:ensure nil
:hook
(after-init . global-auto-revert-mode)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Fluently Edit Large Files

View File

@ -32,6 +32,8 @@
rime-predicate-current-uppercase-letter-p
; 在 LaTeX 数学环境中或者输入 LaTeX 命令时
rime-predicate-tex-math-or-command-p
; 在 org-mode 代码块中时
rime-predicate-org-in-src-block-p
)
)
; 强制中文模式, 无视 rime-disable-predicates 中的规则

View File

@ -68,6 +68,12 @@
(nerd-icons-font-family "Symbols Nerd Font Mono")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; global-hl-line-mode
(use-package hl-line
:ensure nil
:hook (after-init . global-hl-line-mode))
(provide 'init-ui)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-ui.el ends here

View File

@ -3,6 +3,15 @@
;;; Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; winner-mode
(use-package winner-mode
:ensure nil
:hook
(after-init . winner-mode)
(ediff-quit . winner-undo)
)
(use-package shackle
:ensure t
:hook (after-init . shackle-mode)