-
Notifications
You must be signed in to change notification settings - Fork 31
/
config.el
69 lines (56 loc) · 2.44 KB
/
config.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
;;; private/my/config.el -*- lexical-binding: t; -*-
(load! "+os")
(load! "+git")
(load! "+misc")
(load! "+text")
(load! "+prog")
(load! "+ui")
(load! "+keys")
(cond
((modulep! :tools lsp +eglot) (load! "+eglot"))
((modulep! :tools lsp) (load! "+lsp")))
(setq user-full-name "Ting Zhou"
user-mail-address "ztlevi.work@gmail.com")
(setq doom-scratch-buffer-major-mode 'emacs-lisp-mode
confirm-kill-emacs nil)
(setq-default fill-column 120
delete-trailing-lines t)
;; Delete the selection when pasting
(delete-selection-mode 1)
;; disable risky local variables warning
(advice-add 'risky-local-variable-p :override #'ignore)
(add-hook! 'find-file-hook #'+my/find-file-check-make-large-file-read-only-hook)
;; Use xclip if not in SSH
(let ((env (getenv "SSH_TTY")))
(if (or (null env) (string-empty-p env))
(progn (require 'xclip nil t)
(with-demoted-errors "%s" (xclip-mode +1)))
(setq clipetty-tmux-ssh-tty "tmux show-environment -g SSH_TTY")))
;; check minified-file
(add-to-list 'magic-mode-alist (cons #'+my/check-minified-file 'fundamental-mode))
(set-popup-rules! '(("^\\*helpful" :size 0.35)
("^\\*Ibuffer\\*$" :size 0.35)
("^\\*info.*" :size 80 :side right)
("^\\*Man.*" :size 80 :side right)
("^\\*keycast.*" :size 50 :side right)
("^\\*Customize" :actions display-buffer)
("^\\*edit-indirect" :size 0.6)
("^\\*YASnippet Tables\\*$" :size 0.35)
("^\\*grep\\*$" :size 0.35)
("^\\*pytest\\*" :size 0.35)
("^\\*Anaconda\\*$" :size 0.35)
("\\*.*server log\\*$" :side top :size 0.20 :select nil)
((lambda (buf _) (with-current-buffer buf (eq major-mode 'forge-topic-mode))) :size 0.35)
))
;; Manually edit .local/custom.el will break doom updates
(when (file-directory-p custom-file)
(message (concat "Please delete " custom-file ". And customization in config.el and +ui.el.")))
(custom-set-variables
'(warning-suppress-log-types '((lsp-mode) (iedit)))
'(warning-suppress-types '((iedit))))
;; Load system profile for different machines and work config
(dolist (config '("~/.config/doom/local.el"
"~/dev/work/dots/local.el"))
(let ((config-file (file-truename config)))
(when (file-exists-p config-file)
(load-file config-file))))