-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathposimacs-style.el
178 lines (153 loc) · 6.58 KB
/
posimacs-style.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
;;; posimacs-doom-themes --- Things are looking up -*- lexical-binding: t -*-
;;; Commentary:
;;
;; Doom has a nice comprehensive theme system and lots of good starting points.
;; Let's adopt!
;;
;;; Code:
(defun pmx--setup-fonts (&rest _)
"Nice fonts for nice people (and robots)."
(set-face-attribute 'default nil
:font (font-spec :family "Roboto Mono"
:size 20))
(set-face-attribute 'fixed-pitch-serif nil
:font (font-spec :family "Roboto Mono"
:size 20)))
(use-package default-text-scale
:delight default-text-scale-mode
:config
(default-text-scale-mode)) ;C-M-= and C-M-- for larger and smaller text
;; Make lambda expressions shorter for easier reading in lisp code
;; Thanks Oleg Pavliv
;; https://unix.stackexchange.com/questions/30039/emacs-how-to-insert-%CE%BB-instead-of-lambda-in-scheme-mode
(defun pmx-greek-lambda ()
(font-lock-add-keywords
nil
`(("\\<lambda\\>"
(0 (progn (compose-region (match-beginning 0) (match-end 0)
,(make-char 'greek-iso8859-7 107))
nil))))))
(add-hook 'emacs-lisp-mode-hook 'pmx-greek-lambda)
(add-hook 'inferior-emacs-lisp-mode-hook 'pmx-greek-lambda)
;; https://github.com/domtronn/all-the-icons.el
;; File & other icons used by ivy, dired, and other packages to
;; give more visual cues about completion options and lists of items
(use-package all-the-icons
:config
(setq ielm-prompt (concat (all-the-icons-fileicon "emacs") ": "))
(setq ielm-dynamic-multiline-inputs nil) ; multi-line expression indent nicely
(setq ielm-header "Inferior Emacs Lisp Mode. M-x `ielm-change-working-buffer' to hack on some live buffer.\n\n")) ; for real
(use-package all-the-icons-dired
:config (add-hook 'dired-mode-hook 'all-the-icons-dired-mode))
(use-package doom-themes
:config
(setq custom-theme-directory (expand-file-name "posimacs" user-emacs-directory))
(load-theme 'posimacs-dark t)
(pmx--setup-fonts)
(let ((pmx-setup-style
(lambda ()
(load-theme 'posimacs-dark t)
(pmx--setup-fonts)
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config))))
(if (daemonp)
(add-hook 'server-after-make-frame-hook pmx-setup-style)
(add-hook 'after-init-hook pmx-setup-style))))
;; nice countdown timers
(use-package champagne
:elpaca (champagne
:type git :host github
:repo "positron-solutions/champagne"))
;; animated parrots and nyancat whenever you finish org todo's or push code
(use-package parrot
:elpaca (parrot :host github :repo "positron-solutions/parrot" :files (:defaults "img"))
:custom
(parrot-animate 'hide-static)
(parrot-rotate-animate-after-rotation nil)
(parrot-num-rotations 10)
(parrot-type 'nyan)
(parrot-animate-on-load t)
(parrot-mode t)) ;; enables the mode
(use-package doom-modeline
:init
(doom-modeline-mode 1)
(add-hook 'after-make-frame-functions #'graphical-frame-icons)
:custom
(doom-modeline-buffer-encoding nil "Nobody reads encoding.")
(doom-modeline-major-mode-icon t "This is probably default.")
(doom-modeline-env-version nil "Rust 1.45.whocares."))
(defun graphical-frame-icons (frame)
"Activate doom-modeline icons if FRAME has graphics."
(select-frame frame)
(setq doom-modeline-icon (display-graphic-p frame)))
;; A slightly more informative scratch buffer
(setq initial-scratch-message nil)
;; https://github.com/Malabarba/beacon
;; When you scroll, the cursor highlights very loudly
(use-package beacon
:delight beacon-mode
:custom
(beacon-color "#33DB12")
(beacon-blink-duration 0.5)
(beacon-size 60)
(beacon-blink-when-point-moves-vertically t)
(beacon-blink-when-window-changes t)
(beacon-blink-when-focused t)
:config
(beacon-mode)
;; blink after switching windows.
(if window-selection-change-functions
(push (lambda (_) (beacon-blink-automated)) 'window-selection-change-functions)
(setq window-selection-change-functions '((lambda (_) (beacon-blink-automated))))))
;; https://github.com/tarsius/hl-todo
;; highlight TODO keywords in code
(use-package hl-todo
:config
(global-hl-todo-mode))
;; Gotta keep up with everyone else and their cool dashboards
(use-package dashboard
:after all-the-icons
:config
;; top stuff
(setq dashboard-startup-banner (concat user-emacs-directory "posimacs/graphics/posimacs-banner.png"))
(setq dashboard-set-navigator t)
(setq dashboard-set-init-info t)
(setq dashboard-banner-logo-title nil)
(setq dashboard-navigator-buttons
`(((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0)
"Github"
"View Public Repository"
(lambda (&rest _) (browse-url "https://github.com/positron-solutions/posimacs")))
(,(all-the-icons-octicon "flame" :height 1.1 :v-adjust 0.0)
"Bugs"
"Report an Issue or Request Feature"
(lambda (&rest _) (browse-url "https://github.com/positron-solutions/posimacs/issues")))
(,(all-the-icons-faicon "reddit-alien" :height 1.1 :v-adjust 0.0)
"Reddit"
"Come to Emacs Subreddit!"
(lambda (&rest _) (browse-url "https://www.reddit.com/r/emacs/top/?t=month"))))))
;; items
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons nil) ; the icons for agenda are not great
(setq dashboard-items '((projects . 5)
(agenda . 5)))
(setq dashboard-show-shortcuts nil)
(dashboard-modify-heading-icons '((projects . "star")
(agenda . "milestone")))
(setq dashboard-item-names '(("Projects:" .
(concat (all-the-icons-octicon "star") " Projects:"))
("Agenda for the coming week:" .
(concat " This week's agenda:" (all-the-icons-fileicon "org")))))
;; footer
(setq dashboard-set-footer t)
(setq dashboard-footer-messages '("Next year we're adding a text editor!"))
(setq dashboard-footer-icon (all-the-icons-octicon "dashboard"
:height 1.1
:v-adjust -0.05
:face 'font-lock-keyword-face))
;; other
(setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name)
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
(add-hook 'elpaca-after-init-hook #'dashboard-open))
(provide 'posimacs-style)
;;; posimacs-style.el ends here.