/
init-basic.el
106 lines (90 loc) · 3.43 KB
/
init-basic.el
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
;; init-basic.el --- Initialize basic configurations. -*- lexical-binding: t -*-
;; Copyright (C) 2018 Vincent Zhang
;; Author: Vincent Zhang <seagle0128@gmail.com>
;; URL: https://github.com/seagle0128/.emacs.d
;; This file is not part of GNU Emacs.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;
;;; Commentary:
;;
;; Basic configuration.
;;
;;; Code:
(eval-when-compile
(require 'init-const)
(require 'init-custom))
;; Personal information
(setq user-full-name centaur-full-name)
(setq user-mail-address centaur-mail-address)
;; Key Modifiers
(when sys/win32p
;; make PC keyboard's Win key or other to type Super or Hyper
;; (setq w32-pass-lwindow-to-system nil)
(setq w32-lwindow-modifier 'super) ; Left Windows key
(setq w32-apps-modifier 'hyper) ; Menu/App key
;; (w32-register-hot-key [s-])
(w32-register-hot-key [s-t]))
;; Environment
(when (or sys/mac-x-p sys/linux-x-p)
(use-package exec-path-from-shell
:init
(setq exec-path-from-shell-check-startup-files nil)
(setq exec-path-from-shell-variables '("PATH" "MANPATH" "PYTHONPATH" "GOPATH"))
(setq exec-path-from-shell-arguments '("-l"))
(exec-path-from-shell-initialize)))
;; Start server
(use-package server
:ensure nil
:hook (after-init . server-mode))
;; History
(use-package saveplace
:ensure nil
:hook (after-init . save-place-mode))
(use-package recentf
:ensure nil
;; lazy load recentf
;; :hook (find-file . (lambda () (unless recentf-mode
;; (recentf-mode)
;; (recentf-track-opened-file))))
:init
(add-hook 'after-init-hook #'recentf-mode)
(setq recentf-max-saved-items 200)
:config
(add-to-list 'recentf-exclude (expand-file-name package-user-dir))
(add-to-list 'recentf-exclude ".cache")
(add-to-list 'recentf-exclude ".cask")
(add-to-list 'recentf-exclude ".elfeed")
(add-to-list 'recentf-exclude "bookmarks")
(add-to-list 'recentf-exclude "cache")
(add-to-list 'recentf-exclude "persp-confs")
(add-to-list 'recentf-exclude "recentf")
(add-to-list 'recentf-exclude "url")
(add-to-list 'recentf-exclude "COMMIT_EDITMSG\\'"))
(use-package savehist
:ensure nil
:hook (after-init . savehist-mode)
:init (setq enable-recursive-minibuffers t ; Allow commands in minibuffers
history-length 1000
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
extended-command-history)
savehist-autosave-interval 300))
(provide 'init-basic)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-basic.el ends here