-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.el
224 lines (165 loc) · 5.92 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
;; default UI configurations
;;; getenv bashrc
(setq disabled-command-function nil)
(setq exec-path (append exec-path '("~/Programs/npm/bin")))
(let ((path (shell-command-to-string ". ~/.bashrc; echo -n $PATH")))
(setenv "PATH" path)
(setq exec-path
(append
(split-string-and-unquote path ":")
exec-path)))
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(delete-selection-mode 1)
;; (scroll-lock-mode 1)
;; (pixel-scroll-precision-mode 1)
(setq show-paren-style 'expression)
(set-fringe-mode 0)
(set-language-environment "UTF-8")
;; (set-face-attribute 'default nil
;; :family "Iosevka Comfy"
;; ;; :height 110
;; :weight 'regular
;; :width 'normal)
(electric-pair-mode t)
;;; Startup
(setq inhibit-startup-message 0)
(setq initial-buffer-choice nil)
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
;; npm error
(setq create-lockfiles nil)
;; (setq powerline-arrow-shape 'curve)
;; (powerline-center-theme)
;; disable backup and things
(setq make-backup-files nil)
(setq auto-save-default nil)
;;display line number / relative line number
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
(setq display-line-numbers-type 'relative)
(setq linum-format "%3d ")
;; make ESC quit prompts
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
;; hs-minor-mode ; code folding
(add-hook 'prog-mode-hook #'hs-minor-mode)
;; sgml work on js-jsx-mode
(add-hook 'js-jsx-mode-hook
(lambda ()
(define-key js-jsx-mode-map (kbd "C-c C-f") 'sgml-skip-tag-forward)
(define-key js-jsx-mode-map (kbd "C-c C-b") 'sgml-skip-tag-backward)
)
)
;; mouse follow
(setq focus-follows-mouse t)
(setq mouse-autoselect-window t)
;;;;modus-vivendi /modus-operandi config
;; change modeline
;;(setq modus-themes-region '(bg-only)) ;I
;; (setq modus-themes-completions '((matches . (extrabold))
;; (selection . (semibold accented))
;; (popup . (accented intense))))
;; (setq modus-themes-bold-constructs t)
;; (setq modus-themes-italic-constructs t)
;; (setq modus-themes-paren-match '(bold intense))
;; (setq modus-themes-syntax '(alt-syntax green-strings))
;; (modus-themes-load-themes)
;;make comments grayish
;; (defun my-modus-themes-custom-faces ()
;; (modus-themes-with-colors
;; (custom-set-faces
;; ;; your custom face overrides here
;; `(font-lock-comment-face ((,class :background ,bg-alt)))
;; )))
;; (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)
;; (modus-themes-load-operandi)
;;;;; enable tab bar mode
;; Don't turn on tab-bar-mode when tabs are created
(tab-bar-mode 1)
;; (setq tab-bar-format '(tab-bar-format-global)
;; tab-bar-mode t)
;; (setq tab-bar-show 2)
(setq tab-bar-close-button-show nil
tab-bar-new-button-show nil)
(defun my/tab-bar-format (tab i)
(propertize
(format
(concat
(if (eq (car tab) 'current-tab)
"😚 " "")
"%s")
(alist-get 'name tab))
'face (list (append
'(:foreground "#FFFFFF")
(if (eq (car tab) 'current-tab)
'(:box t)
'())))))
(setq tab-bar-tab-name-format-function #'my/tab-bar-format)
;; change name tab bar
(defun my/tab-bar-tab-name-function ()
(let ((project (project-current)))
(if project
(project-root project)
(tab-bar-tab-name-current))))
(setq tab-bar-tab-name-function #'my/tab-bar-tab-name-function)
;; switer to tab buffer
;; (defun my/switch-to-tab-buffer ()
;; (interactive)
;; (if (project-current)
;; (call-interactively #'project-switch-to-buffer)
;; (call-interactively #'switch-to-buffer)))
;; (global-set-key (kbd "C-x C-b") #'my/switch-to-tab-buffer)
;; highlight line mode
(global-hl-line-mode)
;; display time
(display-time-mode 1)
;;use spaces instead of tabs
(setq indent-tabs-mode t)
(setq typescript-indent-level 2)
(setq js-indent-level 2)
;; (setq-default c-basic-offset 0)
;; enable date time
(display-time)
(setq display-time-day-and-date t)
;; toggle selective display
(global-set-key (kbd "C-z") 'set-selective-display-dlw)
(defun set-selective-display-dlw (&optional level)
"Fold text indented same of more than the cursor.
If level is set, set the indent level to LEVEL.
If 'selective-display' is already set to LEVEL, clicking
F5 again will unset 'selective-display' by setting it to 0."
(interactive "P")
(if (eq selective-display (1+ (current-column)))
(set-selective-display 0)
(set-selective-display (or level (1+ (current-column))))))
;;; re read from disk (on some external changes)
(global-auto-revert-mode)
;; tab-line-mode
;; (global-tab-line-mode)
;; (setq tab-line-close-button-show nil) ;; do not show close button
;; (setq tab-line-separator "") ;; set it to empty
;;;; scroolling
;; (display-battery-mode 1)
;; (setq
;; scroll-conservatively 1000 ;; only 'jump' when moving this far
;; scroll-margin 4 ;; scroll N lines to screen edge
;; scroll-step 1 ;; keyboard scroll one line at a time
;; mouse-wheel-scroll-amount '(6 ((shift) . 1)) ;; mouse scroll N lines
;; mouse-wheel-progressive-speed nil ;; don't accelerate scrolling
;; redisplay-dont-pause t ;; don't pause display on input
;; ;; Always redraw immediately when scrolling,
;; ;; more responsive and doesn't hang!
;; fast-but-imprecise-scrolling nil
;; jit-lock-defer-time 0
;; )
;; hide emacs customize
(setq custom-file "~/.emacs.d/custom.el")
(when (file-exists-p custom-file)
(load custom-file))
;; ignore \n irritating electric-indent-mode
(setq electric-indent-chars (delq ?\n electric-indent-chars))
;; disable the display of warnings
(setq warning-minimum-level :emergency)
;; dired hide details
(add-hook 'dired-mode-hook 'dired-hide-details-mode)
;; jump to next opposite when end buffer
(setq windmove-wrap-around t)