- Replace projectile with built-in project.el - Add cal-china-x for Chinese lunar calendar support - Add dired-gitignore integration with dirvish - Add mwim for smarter line navigation - Add keycast mode for key display - Add ef-themes theme collection - Improve corfu terminal handling for Emacs 31+ - Add gptel-agent-project and consult-ripgrep-project helpers - Remove custom.el from repo, support init-local.el for local config - Update theme faces for transient, keycast, and calendar holidays - Various keybinding additions and cleanup
44 lines
1.5 KiB
EmacsLisp
44 lines
1.5 KiB
EmacsLisp
;;; init-const.el --- constant and system stuff -*- lexical-binding: t -*-
|
|
|
|
;;; Commentary:
|
|
|
|
;;; Code:
|
|
|
|
;; 识别操作系统
|
|
(defconst *is-mac* (eq system-type 'darwin))
|
|
(defconst *is-linux* (eq system-type 'gnu/linux))
|
|
(defconst *is-windows* (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)))
|
|
(defconst *is-android* (if (getenv "TERMUX_VERSION") t nil))
|
|
|
|
(if *is-windows*
|
|
(progn
|
|
;; 设置默认编码环境
|
|
(set-language-environment "UTF-8")
|
|
(prefer-coding-system 'utf-8)
|
|
(set-default-coding-systems 'utf-8)
|
|
(set-terminal-coding-system 'utf-8)
|
|
(set-keyboard-coding-system 'utf-8)
|
|
(setq default-buffer-file-coding-system 'utf-8)
|
|
|
|
;; 设置进程通信编码
|
|
(setq default-process-coding-system '(utf-8 . utf-8))
|
|
|
|
;; Windows 文件名 Unicode 支持
|
|
(setq w32-unicode-filenames t)
|
|
(setq w32-system-coding-system 'utf-8)
|
|
|
|
;; 为特定程序设置编码
|
|
(add-to-list 'process-coding-system-alist '("rg" utf-8 . gbk))
|
|
(add-to-list 'process-coding-system-alist '("ripgrep" utf-8 . gbk)))
|
|
(progn
|
|
(add-to-list 'process-coding-system-alist '("rg" utf-8 . utf-8))
|
|
(add-to-list 'process-coding-system-alist '("ripgrep" utf-8 . utf-8))))
|
|
(add-to-list 'process-coding-system-alist '("grep" utf-8 . utf-8))
|
|
(add-to-list 'process-coding-system-alist '("find" utf-8 . utf-8))
|
|
(add-to-list 'process-coding-system-alist '("fd" utf-8 . utf-8))
|
|
(add-to-list 'process-coding-system-alist '("fdfind" utf-8 . utf-8))
|
|
|
|
(provide 'init-const)
|
|
|
|
;;; init-const.el ends here
|