-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.el
95 lines (82 loc) · 2.93 KB
/
init.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
;;; -*- lexical-binding: t -*-
;; https://github.com/hlissner/doom-emacs/wiki/FAQ#how-is-dooms-startup-so-fast
(setq undo-limit 40000
undo-outer-limit 8000000
undo-strong-limit 100000)
(setq gc-cons-threshold 402653184
gc-cons-percentage 0.6)
(setq file-name-handler-alist nil)
(defun unset-bg-color-sometimes ()
(unless (display-graphic-p)
(set-face-background 'default "unspecified-bg" (selected-frame))))
(unless (display-graphic-p)
(advice-add #'tty-run-terminal-initialization :override #'ignore)
(add-hook 'window-setup-hook
(lambda ()
(advice-remove #'tty-run-terminal-initialization #'ignore)
(tty-run-terminal-initialization (selected-frame) nil t))))
(when (memq window-system '(mac ns))
(scroll-bar-mode -1)
(tool-bar-mode -1))
(tooltip-mode -1)
(menu-bar-mode -1)
(fset 'yes-or-no-p 'y-or-n-p)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(use-package no-littering
:straight t
:demand t)
(defvar dotfiles-dir (file-name-directory
(or (buffer-file-name) load-file-name)))
(load (concat dotfiles-dir "hao/pkgs.el"))
(progn (define-key key-translation-map (kbd ";") (kbd ":"))
(define-key key-translation-map (kbd ":") (kbd ";")))
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))
;; Bring sanity into the world
(setq-default
frame-inhibit-implied-resize t
initial-major-mode 'fundamental-mode
ns-use-proxy-icon nil
frame-title-format nil
mac-option-key-is-meta nil
mac-command-key-is-meta t
mac-command-modifier 'meta
mac-option-modifier nil
ns-pop-up-frames nil
auto-save-default nil
c-basic-offset 4
custom-file (concat dotfiles-dir "custom.el")
delete-old-versions t ;; Old backups that is.
disabled-command-function nil ;; Unhide the power functions.
enable-local-variables :all
indent-tabs-mode nil
indicate-empty-lines t
inhibit-startup-message t
initial-scratch-message nil
kill-do-not-save-duplicates t
major-mode 'text-mode
require-final-newline t
scroll-preserve-screen-position t
sgml-basic-offset 2
tab-width 4
truncate-lines t
vc-handled-backends '(Git)
visible-bell nil
x-stretch-cursor t ;; Stretch cursor for tab characters.
auto-window-vscroll t ;; https://emacs.stackexchange.com/questions/28736/emacs-pointcursor-movement-lag/28746
)
(load (concat dotfiles-dir "hao/here.el"))
(defun restore-default-settings ()
(setq gc-cons-threshold 16777216
gc-cons-percentage 0.1))
(add-hook 'emacs-startup-hook #'restore-default-settings)