-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el.old
276 lines (196 loc) · 7.23 KB
/
init.el.old
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
(setq inhibit-startup-message t)
(scroll-bar-mode -1) ;Disable visible scrollbar
(tool-bar-mode -1) ;DIsable toolbar
(tooltip-mode -1) ;disable tooltips11
(set-fringe-mode 10) ;give some breathing room
(menu-bar-mode -1) ;disable menu bar
; setup the visible bell
(setq visible-bell t)
;set font
(set-face-attribute 'default nil :font "Fira Code Retina" :height 140)
; load theme note this passes an object denoted by a leading `
(load-theme 'tango-dark)
; keybind mode specific example
(define-key emacs-lisp-mode-map (kbd "C-x M-t") 'counsel-load-theme)
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/")))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
; programming mode
(defun my-display-numbers-hook ()
(display-line-numbers-mode t)
)
(add-hook 'prog-mode-hook 'my-display-numbers-hook)
(add-hook 'text-mode-hook 'my-display-numbers-hook)
(dolist (mode '(org-mode-hook))
(add-hook mode (lambda () (display-line-numbers-mode 0))))
; setup command log mode which shows typed commands in a window to the right
(use-package command-log-mode)
;setup swiper ( better buffer)
(use-package swiper)
;setup ivy which is fuzzy search
(use-package ivy
:diminish
:bind (("C-s" . swiper))
:config
(ivy-mode 1))
;counsel setup
(use-package counsel
:bind (("M-x" . counsel-M-x)
("C-x b" . counsel-ibuffer)
("C-x C-f" . counsel-find-file)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history)))
(use-package ivy-rich
:init
(ivy-rich-mode 1))
; doom mode line ( imporve the mode line)
(use-package doom-themes
:ensure t
:config
(load-theme 'doom-gruvbox t))
(use-package doom-modeline
:ensure t
:init (doom-modeline-mode 1)
:config
(setq doom-modeline-height 15))
;setup rainbow delims for nesting
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package which-key
:init (which-key-mode)
:diminish (which-key-mode)
:config
(setq which-key-idle-delay 1))
(use-package helpful
:custom
(counsel-describe-function-function #'helpful-callable)
(counsel-describe-variable-function #'helpful-variable)
:bind
([remap describe-function] . counsel-describe-function)
([remap describe-command] . helpful-command)
([remap describe-variable] . counsel-describe-variable)
([remap describe-key] . helpful-key))
; Projectile - helps to manage projects in emacs
(use-package projectile
:diminish projectile-mode
:config (projectile-mode)
:custom ((projectile-completion-system 'ivy))
:bind-keymap
("C-c p" . projectile-command-map)
:init
(when (file-directory-p "~/Projects/Code")
(setq projectile-project-search-path '("~/Projects/Code")))
(setq projectile-switch-project-action #'projectile-dired))
(use-package counsel-projectile
:config (counsel-projectile-mode))
(use-package magit
:commands (magit-status magit-get-current-branch)
:custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
;TODO (setup Forge)
;https://magit.vc/manual/ghub/Getting-Started.html#Getting-Started
;https://youtu.be/INTu30BHZGk?t=3221
;(use-package forge)
;;;;; Org mode setup ;;;;;
;require tempo
(defun org-mode-setup()
(org-indent-mode)
(variable-pitch-mode 1)
(auto-fill-mode 0)
(visual-line-mode 1))
(use-package org
:hook (org-mode . org-mode-setup)
:config
(setq org-agenda-files
'("~/Projects/emacsone/OrgFiles/tasks.org"
"~/Projects/emacsone/OrgFiles/habits.org"))
(setq org-agenda-start-with-log-mode t)
(setq org-log-done 'time)
(setq org-log-into-drawer t)
(setq org-ellipsis " ▾"
org-hide-emphasis-markers t)
(setq org-capture-babel-evaluate t)
; org capture
(setq org-capture-templates
'(("t" "Tasks / Projects")
("tt" "Task" entry (file+olp "~/Projects/emacsone/OrgFiles/tasks.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
("ts" "Clockked Entry Subtask" entry (clock)
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
("j" "Journal Entries")
("jj" "Journal" entry
(file+olp+datetree "~/Projects/emacsone/OrgFiles/journal.org")
"\n* %<%I:%M %p> - Journal :journal:\n\n%?\n\n"
;;
:clock-in :clock-resume
:empty-lines 1)
("jm" "Meeting" entry
(file+olp+datetree "~/Projects/emacsone/OrgFiles/journal.org")
"* %<%I:%M %P> - %a :meetings:\n\n%?\n\n"
:clock-in :clock-resume
:empty-lines 1)
("w" "Workflows")
("we" "Checking Email" entry (file+olp+datetree "~/Projects/emacsone/OrgFiles/journal.org")
"* Checking Email :email:\n\n%?" :clockin :clock-resume :empty-lines 1)
("m" "Metrics Capture")
("mw" "Weight" table-line (file+headline "~/Projects/emacsone/OrgFiles/metrics.org" "Weight")
"| %U | %^{Weight} | %^{Notes} |" :kill-buffer t))))
; hotkey bindings
(define-key global-map (kbd "C-c o")
(lambda () (interactive) (org-capture)))
; refile targets
(setq org-refile-targets
'(("archive.org" :maxlevel . 1)
("tasks.org" :maxlevel . 1)))
; load org habits
(require 'org-habit)
(add-to-list 'org-modules 'org-habit)
(setq org-habit-graph-column 60)
;;;;; end org mode setup ;;;;;
(advice-add 'org-refile :after 'org-save-all-org-buffers)
; change bullet art
(use-package org-bullets
:after org
:hook (org-mode . org-bullets-mode)
:custom
(org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●")))
;replace dashes with dots
(font-lock-add-keywords 'org-mode
'(("^ *\\([-]\\) "
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
;change fonts to be more readable
(dolist (face '((org-level-1 . 1.2)
(org-level-2 . 1.1)
(org-level-3 . 1.05)
(org-level-4 . 1.0)
(org-level-5 . 1.1)
(org-level-6 . 1.1)
(org-level-7 . 1.1)
(org-level-8 . 1.1)))
(set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face)))
; keep a few things fixed pitch as they should be for line ups
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-indent nil :inherit '(org-hide fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
; visual fill mode
(defun org-mode-visual-fill()
(setq visual-fill-column-width 175
visual-fill-column-center-text t)
(visual-fill-column-mode 1))
(use-package visual-fill-column
:hook (org-mode . org-mode-visual-fill))