2025-12-14 04:51:24 +11:00
|
|
|
;; -*- lexical-binding: t -*-
|
2025-12-14 21:09:42 +11:00
|
|
|
|
2025-12-14 09:04:11 +11:00
|
|
|
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
|
|
|
|
(add-hook 'org-mode-hook #'display-line-numbers-mode)
|
2025-12-14 04:51:24 +11:00
|
|
|
(setq-default cursor-type 'bar)
|
2025-12-15 00:26:46 +11:00
|
|
|
(setq display-line-numbers-type 'relative)
|
2025-12-14 04:51:24 +11:00
|
|
|
(show-paren-mode t)
|
|
|
|
|
(recentf-mode 1)
|
|
|
|
|
(setq make-backup-files nil)
|
|
|
|
|
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
|
|
|
|
|
(load custom-file 'no-error 'no-message)
|
2025-12-14 06:09:17 +11:00
|
|
|
(setq use-short-answers t)
|
2025-12-14 04:51:24 +11:00
|
|
|
|
2025-12-14 22:30:26 +11:00
|
|
|
|
|
|
|
|
(setq kill-ring-max 200)
|
|
|
|
|
|
|
|
|
|
;; Save clipboard contents into kill-ring before replace them
|
|
|
|
|
(setq save-interprogram-paste-before-kill t)
|
|
|
|
|
;; Kill & Mark things easily
|
|
|
|
|
(use-package easy-kill
|
|
|
|
|
:bind (([remap kill-ring-save] . easy-kill)
|
|
|
|
|
([remap mark-sexp] . easy-mark)))
|
|
|
|
|
|
|
|
|
|
;; Interactively insert and edit items from kill-ring
|
|
|
|
|
(use-package browse-kill-ring
|
|
|
|
|
:bind ("C-c k" . browse-kill-ring)
|
|
|
|
|
:hook (after-init . browse-kill-ring-default-keybindings)
|
|
|
|
|
:init (setq browse-kill-ring-separator "────────────────"
|
|
|
|
|
browse-kill-ring-separator-face 'shadow))
|
|
|
|
|
|
2025-12-14 04:51:24 +11:00
|
|
|
(global-set-key (kbd "s-a") 'mark-whole-buffer) ;;对应Windows上面的Ctrl-a 全选
|
|
|
|
|
(global-set-key (kbd "s-c") 'kill-ring-save) ;;对应Windows上面的Ctrl-c 复制
|
|
|
|
|
(global-set-key (kbd "s-s") 'save-buffer) ;; 对应Windows上面的Ctrl-s 保存
|
|
|
|
|
(global-set-key (kbd "s-v") 'yank) ;对应Windows上面的Ctrl-v 粘贴
|
|
|
|
|
(global-set-key (kbd "s-z") 'undo) ;对应Windows上面的Ctrol-z 撤销
|
2025-12-14 06:09:17 +11:00
|
|
|
|
|
|
|
|
(use-package exec-path-from-shell
|
|
|
|
|
:init
|
|
|
|
|
(exec-path-from-shell-initialize))
|
|
|
|
|
|
2025-12-15 00:26:46 +11:00
|
|
|
(global-set-key (kbd "C-x b") 'ibuffer)
|
2025-12-14 04:51:24 +11:00
|
|
|
|
2025-12-14 09:04:11 +11:00
|
|
|
(use-package ultra-scroll
|
|
|
|
|
:init
|
|
|
|
|
(setq scroll-conservatively 3
|
|
|
|
|
scroll-margin 0)
|
|
|
|
|
:config
|
|
|
|
|
(ultra-scroll-mode 1))
|
|
|
|
|
|
2025-12-14 21:09:42 +11:00
|
|
|
(use-package benchmark-init
|
|
|
|
|
:ensure t
|
|
|
|
|
:demand t
|
|
|
|
|
:config
|
|
|
|
|
;; To disable collection of benchmark data after init is done.
|
|
|
|
|
(add-hook 'after-init-hook 'benchmark-init/deactivate))
|
|
|
|
|
|
2025-12-14 04:51:24 +11:00
|
|
|
(provide 'init-better-default)
|