72 lines
2.0 KiB
EmacsLisp
72 lines
2.0 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)))
|
|
|
|
(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))
|
|
(setq w32-unicode-filenames t)
|
|
(setq w32-system-coding-system 'utf-8)))
|
|
|
|
(setq backup-directory-alist
|
|
`((".*" . ,(expand-file-name "backup/" user-emacs-directory)))
|
|
backup-by-copying t
|
|
delete-old-versions t
|
|
kept-new-versions 6
|
|
kept-old-versions 2
|
|
version-control t)
|
|
|
|
(setq auto-save-file-name-transforms
|
|
`((".*" ,(expand-file-name "auto-save-list/" user-emacs-directory) t)))
|
|
|
|
(put 'scroll-left 'disabled nil)
|
|
|
|
(setq create-lockfiles nil)
|
|
|
|
(setq ring-bell-function 'ignore)
|
|
|
|
(cond
|
|
(*is-windows*
|
|
(add-to-list 'exec-path (expand-file-name "H/appppppppppp/scoop/apps/"))
|
|
(setenv "PATH" (concat (expand-file-name "H/appppppppppp/scoop/apps/") ";" (getenv "PATH"))))
|
|
(*is-mac*
|
|
(add-to-list 'exec-path (expand-file-name "/opt/homebrew/bin/"))
|
|
(setenv "PATH" (concat (expand-file-name "/opt/homebrew/bin/") ":" (getenv "PATH")))))
|
|
|
|
|
|
(global-auto-revert-mode 1)
|
|
|
|
(when (display-graphic-p)
|
|
(recentf-mode)
|
|
(setq recentf-max-saved-items 30)) ;; 最大保存数量
|
|
|
|
(delete-selection-mode)
|
|
|
|
(setq initial-scratch-message
|
|
"")
|
|
|
|
(setq ibuffer-default-sorting-mode 'filename)
|
|
|
|
(setq native-comp-async-warnings-errors-kind 'silent)
|
|
|
|
(if (boundp 'use-short-answers)
|
|
(setq use-short-answers t)
|
|
(fset 'yes-or-no-p 'y-or-n-p))
|
|
|
|
(provide 'init-terminal-startup)
|
|
|
|
;;; init-terminal-statup.el ends here
|