-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
executable file
·115 lines (99 loc) · 3.28 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
(add-hook 'emacs-lisp-mode-hook
(lambda nil
(setq lexical-binding t)))
(setq-default lexical-binding t)
(setq straight-use-package-by-default t)
;; NECESSARY
(straight-use-package 'evil)
(straight-use-package 's)
(straight-use-package 'dash)
(straight-use-package 'ht)
(straight-use-package 'f)
(straight-use-package 'ts)
(straight-use-package 'general)
(straight-use-package 'smartparens)
;; when popwin does not help with evil-mode
(require 'evil)
(require 'general)
;; (evil-set-initial-state 'messages-buffer-mode 'emacs)
(evil-set-initial-state 'dired-mode 'emacs)
(evil-set-initial-state 'term-mode 'insert)
(evil-set-initial-state 'ansi-term-mode 'insert)
(setq temp-buffer-patterns (list "\\*ansi-term"
"\\*messages\\*"
"\\*scratch\\*"
"temp-buffer-*"))
(defun temp-buffer-map-q ()
(when-let* ((buf (current-buffer))
(bufname (buffer-name buf))
(has-local-map? (keymapp evil-normal-state-local-map))
(matches? (cl-loop for pat in temp-buffer-patterns
when (string-match-p pat bufname)
return t)))
(with-current-buffer buf
(define-key evil-normal-state-local-map (kbd "q") 'delete-window))))
(add-hook 'buffer-list-update-hook 'temp-buffer-map-q)
;; require all the libs
(require 'eieio)
(require 'f)
(require 'dash)
(require 'ts)
(require 'ht)
(require 'smartparens-config)
(smartparens-global-mode)
(defalias 'kbd! 'general-define-key)
;; basic config API
(load-file "~/.emacs.d/lisp/utils.el")
(setq LaTeX-item-indent 0)
(setq warning-minimum-level :emergency)
(setq evil-want-keybinding nil)
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq evil-move-beyond-eol t)
(setq evil-undo-system 'undo-fu)
(setq recentf-max-menu-items 25)
(setq display-line-numbers-type 'relative)
(setq inhibit-startup-screen t)
(setq select-enable-clipboard nil)
(setq doom-themes-enable-bold t
doom-themes-enable-italic t
doom-themes-treemacs-enable-variable-pitch nil)
(setq org-element-use-cache nil)
(setq x-alt-keysym 'meta)
(setq backup-by-copying t
backup-directory-alist '(("." . "~/.emacs.d/backup"))
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t)
(setq auto-save-file-name-transforms `((".*" "~/.emacs.d/backup")))
(setq undo-tree-history-directory-alist (list '(".*" . "~/.emacs.d/cache")))
(evil-mode t)
(recentf-mode 1)
(winner-mode t)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(global-display-line-numbers-mode)
(set-frame-font "Fira Code 13" nil t)
(set-language-environment "utf-8")
(set-frame-parameter nil 'alpha-background 100)
(add-to-list 'default-frame-alist '(alpha-background . 100))
(pixel-scroll-precision-mode t)
(global-auto-revert-mode 1)
(auto-insert-mode 1)
(setq
auto-insert-directory "~/.emacs.d/templates"
auto-insert-alist '((ess-r-mode . "template.R")))
(add-hook 'find-file-hook 'auto-insert)
(load-file "~/.emacs.d/lisp/buffer.el")
(load-file "~/.emacs.d/lisp/modes.el")
(load-file "~/.emacs.d/lisp/repl.el")
(load-file "~/.emacs.d/lisp/compiler.el")
(load-file "~/.emacs.d/lisp/async-process.el")
(load-file "~/.emacs.d/lisp/async-formatter.el")
(load-file "~/.emacs.d/config/mappings.el")
(load-file "~/.emacs.d/config/hooks.el")
(load-file "~/.emacs.d/packages.el")
(mode-config-load-directory)
; (global-undo-tree-mode t)