-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.el
More file actions
92 lines (68 loc) · 2.26 KB
/
init.el
File metadata and controls
92 lines (68 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
;; -*- lexical-binding: t -*-
;; Change M-h to help-command prefix
(global-set-key (kbd "M-h") 'help-command)
(setq inhibit-startup-screen t)
(setq make-backup-files nil)
(menu-bar-mode -1)
(when window-system
(scroll-bar-mode -1)
(tool-bar-mode -1))
;; (toggle-frame-maximized)
(toggle-frame-fullscreen)
(global-display-line-numbers-mode 1)
(setq tab-always-indent 'complete)
;; (icomplete-mode) -> vertico
(electric-pair-mode)
;; Quickly open the init.el file
(defun open-init-file()
(interactive)
(find-file "~/.emacs.d/init.el"))
(global-set-key (kbd "M-h ;") 'open-init-file)
;; Emacs Lisp Package Archive
;;(require 'package)
(setq package-archives
'(
("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
;;防止反复调用 package-refresh-contents 会影响加载速度
(when (not package-archive-contents)
(package-refresh-contents))
(package-install 'company)
(global-company-mode 1)
(package-install 'vertico)
(vertico-mode t)
(package-install 'orderless)
(setq completion-styles '(orderless))
(package-install 'marginalia)
(marginalia-mode t)
(package-install 'embark)
(global-set-key (kbd "C-;") 'embark-act)
;; C-x C-h
(setq prefix-help-command 'embark-prefix-help-command)
(package-install 'consult)
(global-set-key (kbd "C-s") 'consult-line)
(global-set-key (kbd "M-s i") 'consult-imenu)
(require 'recentf)
(recentf-mode t)
(setq recentf-max-menu-items 10)
;; 增强 C-x b
(global-set-key (kbd "C-x b") 'consult-buffer)
(delete-selection-mode t)
(setq company-minimum-prefix-length 1)
(setq company-idle-delay 0.2)
(global-set-key (kbd "M-h M-f") 'find-function)
(global-set-key (kbd "M-h M-v") 'find-variable)
(global-set-key (kbd "M-h M-k") 'find-function-on-key)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)