This commit is contained in:
2026-05-21 11:17:30 +08:00
commit d01d150f36
4 changed files with 779 additions and 0 deletions

69
init.el Normal file
View File

@@ -0,0 +1,69 @@
;; package sources
(require 'package)
(setq package-archives '(("gnu" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
("nongnu" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/nongnu/")
("melpa" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")))
(package-initialize)
;; load local config script (not git controlled, like .env file)
(setq local-file (expand-file-name "local.el" user-emacs-directory))
(when (file-exists-p local-file)
(load-file local-file))
;; handy settings
(tool-bar-mode -1)
(scroll-bar-mode -1)
(global-display-line-numbers-mode 1)
(global-auto-revert-mode t)
(setq mac-command-modifier 'meta)
(setq confirm-kill-emacs 'y-or-n-p)
(setq-default cursor-type '(bar . 2))
(add-to-list 'default-frame-alist '(fullscreen . maximized))
(global-unset-key (kbd "C-SPC"))
(global-set-key (kbd "M-SPC") 'set-mark-command)
(global-set-key (kbd "C-x C-b") 'bs-show)
(windmove-default-keybindings 'meta)
(let ((font (face-attribute 'default :font)))
(when font
(set-face-attribute 'default nil :height 160)))
(setq custom-file (expand-file-name "custom-file.el" user-emacs-directory))
(load custom-file)
;; end handy settings
;; treesit
(setq treesit-language-source-alist
'((c3 "https://github.com/c3lang/tree-sitter-c3")))
;; packages
(use-package use-package-treesit
:ensure t)
(use-package gruber-darker-theme
:ensure t
:init
(load-theme 'gruber-darker t))
(use-package dimmer
:ensure t
:init
(setq dimmer-fraction 0.3) ; 调整变暗的程度0.0 到 1.0越大越暗0.3 刚刚好)
:config
(dimmer-mode 1))
(use-package ace-window
:ensure t
:bind ("M-o" . ace-window))
;; vendor
(add-to-list 'load-path (expand-file-name "vendor/c3-ts-mode" user-emacs-directory))
(require 'c3-ts-mode)