Files
.emacs.d/lisp/init-startup.el
trogloxene c7352d0460 feat: add dashboard and enhance completion
- Add startup dashboard with recent files and bookmarks
- Enhance corfu with icons and minibuffer transfer
- Add avy-zap, markdown-mode, consult-dir
- Optimize GC settings and editor config
2026-04-02 14:56:29 +08:00

96 lines
2.6 KiB
EmacsLisp
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;;; init-startup.el --- startup settings -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; mac自动全屏
(when *is-mac*
(toggle-frame-fullscreen)
(global-unset-key (kbd "<f12>"))
(global-set-key (kbd "<f12>") 'toggle-frame-fullscreen))
;; 配置备份文件和自动保存文件目录
(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)
;; 关闭lock文件
(setq create-lockfiles nil)
;; 关闭提示音
(setq ring-bell-function 'ignore)
;; 同步scoop目录
(when *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"))))
;; 同步brew目录
(when *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)
;; 开启rencent file mode
(recentf-mode)
(setq recentf-max-saved-items 30) ;; 最大保存数量
;; 启用select delete
(delete-selection-mode)
;; 启用winner mode
(winner-mode)
;; 自定义scratch
(setq initial-scratch-message
"")
;; 开启server mode
(server-start)
;; 窗口名
(setq-default frame-title-format '("%b - Emacs"))
;; electirc-pair-mode
(add-hook 'emacs-lisp-mode-hook 'electric-pair-mode)
(add-hook 'org-mode-hook 'electric-pair-mode)
;; short anwser
(if (boundp 'use-short-answers)
(setq use-short-answers t)
(fset 'yes-or-no-p 'y-or-n-p))
(setq-default major-mode 'text-mode
fill-column 100
tab-width 4
indent-tabs-mode nil)
(setq visible-bell t
inhibit-compacting-font-caches t ; Dont compact font caches during GC
delete-by-moving-to-trash t ; Deleting files go to OS's trash folder
make-backup-files nil ; Forbide to make backup files
auto-save-default nil ; Disable auto save
uniquify-buffer-name-style 'post-forward-angle-brackets ; Show path if names are same
adaptive-fill-regexp "[ t]+|[ t]*([0-9]+.|*+)[ t]*"
adaptive-fill-first-line-regexp "^* *$"
sentence-end "\\([。!?]\\|……\\|[.?!][]\"')}]*\\($\\|[ \t]\\)\\)[ \t\n]*"
sentence-end-double-space nil
word-wrap-by-category t)
(provide 'init-startup)
;;; init-startup.el ends here