-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclient.org~
176 lines (139 loc) · 7.72 KB
/
client.org~
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
#+TITLE: Emacs Client Configuration File
#+AUTHOR: Timo Lassmann
#+LATEX_CLASS: report
#+OPTIONS: toc:nil
#+OPTIONS: H:4
#+LATEX_CMD: xelatex
#+PROPERTY: header-args:emacs-lisp :tangle elisp/init-client.el
#+PROPERTY: header-args :results silent :eval no-export :comments org
\Author{Timo La\ss mann}
\DocumentID{src_sh[:value verbatim]{shasum -a 256 config.org | awk '{print $1}' }}
* Font Settings
** Set default font size..
#+BEGIN_SRC emacs-lisp
(set-face-attribute 'default nil :height 140)
#+END_SRC
** I love syntax highlighting.
#+BEGIN_SRC emacs-lisp
(global-font-lock-mode 1)
#+END_SRC
** I think so. I keep changing my
font based on the monospace du jour... While I [[http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/download/index.html][M+]] because it is
thinner and has more white space between lines, but [[http://blogs.adobe.com/typblography/2012/09/source-code-pro.html][Source Code Pro]]
is so attractive, oh, and then there is Anonymous Pro...
While thicker, [[https://github.com/tonsky/FiraCode][Fira]] does symbol ligatures. However, [[https://github.com/i-tu/Hasklig][Hasklig]] is a
nice font that is thinner and easier to read, with /some/ symbolic
ligatures that doesn't interfere with my org-mode header bullets.
#+BEGIN_SRC emacs-lisp
(defvar tl/fixed-font-family
(cond ((x-list-fonts "Hasklig") "Hasklig")
((x-list-fonts "Source Code Pro") "Source Code Pro")
((x-list-fonts "Anonymous Pro") "Anonymous Pro")
((x-list-fonts "M+ 1mn") "M+ 1mn"))
"My fixed width font based on what is installed, `nil' if not defined.")
#+END_SRC
** Since the headers are based on Adobe’s open source font pair of the
proportional font, [[https://github.com/adobe-fonts/source-sans-pro/releases/tag/2.010R-ro/1.065R-it][Source Sans Pro]], will match the non-proportional
font, [[https://github.com/adobe-fonts/source-code-pro/][Source Code Pro]].
#+BEGIN_SRC emacs-lisp
(defvar tl/variable-font-tuple
(cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
((x-list-fonts "Verdana") '(:font "Verdana"))
((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
(nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro.")))
"My variable width font available to org-mode files and whatnot.")
#+END_SRC
** Resizing
According to [[http://emacsninja.com/posts/making-emacs-more-presentable.html][this article]], we can update the =text-scale-XYZ=
functions to work on a frame instead of just a buffer:
#+BEGIN_SRC emacs-lisp
(defun tl/text-scale-frame-change (fn)
(let* ((current-font-name (frame-parameter nil 'font))
(decomposed-font-name (x-decompose-font-name current-font-name))
(font-size (string-to-number (aref decomposed-font-name 5))))
(aset decomposed-font-name 5 (int-to-string (funcall fn font-size)))
(set-frame-font (x-compose-font-name decomposed-font-name))))
(defun tl/text-scale-frame-increase ()
(interactive)
(tl/text-scale-frame-change '1+))
(defun tl/text-scale-frame-decrease ()
(interactive)
(tl/text-scale-frame-change '1-))
(global-set-key (kbd "C-+") 'tl/text-scale-frame-increase)
(global-set-key (kbd "C-=") 'tl/text-scale-frame-increase)
(global-set-key (kbd "C--") 'tl/text-scale-frame-decrease)
#+END_SRC
* Color Theme
Use the color theme project by following [[http://www.nongnu.org/color-theme/][these instructions]].
We now can do =M-x color-theme-<TAB> RET=
#+BEGIN_SRC emacs-lisp
(use-package gotham-theme
:ensure t
)
#+END_SRC
Make dark blocks...
#+BEGIN_SRC emacs-lisp
(defun org-src-color-blocks-dark ()
"Colors the block headers and footers to make them stand out more for dark themes"
(interactive)
(custom-set-faces
'(org-block-begin-line
((t (:foreground "#008ED1" :background "#002E41"))))
'(org-block-background
((t (:background "#000000"))))
'(org-block
((t (:background "#122028"))))
'(org-block-end-line
((t (:foreground "#008ED1" :background "#002E41"))))))
#+END_SRC
New theme.
#+BEGIN_SRC emacs-lisp
(deftheme tl/org-theme "Sub-theme to beautify org mode")
#+END_SRC
#+BEGIN_SRC emacs-lisp
(defun tl/change-theme (theme org-block-style)
"Changes the color scheme and reset the mode line."
(load-theme theme t)
(funcall org-block-style)
(let* ((tl/fixed-font-tuple (list :font tl/fixed-font-family))
; (ha/varible-font-tuple (list :font ha/variable-font-family))
(base-font-color (face-foreground 'default nil 'default))
(background-color (face-background 'default nil 'default))
(primary-color (face-foreground 'mode-line nil))
(secondary-color (face-background 'secondary-selection nil 'region))
(base-height (face-attribute 'default :height))
(headline `(:inherit default :weight bold :foreground ,base-font-color)))
(when tl/fixed-font-family
(set-frame-font tl/fixed-font-family)
(set-face-attribute 'default nil :font tl/fixed-font-family :height 140)
(set-face-font 'default tl/fixed-font-family))
(custom-theme-set-faces 'tl/org-theme
`(org-agenda-structure ((t (:inherit default :height 2.0 :underline nil))))
`(org-verbatim ((t (:inherit 'fixed-pitched :foreground "#aef"))))
`(org-table ((t (:inherit 'fixed-pitched))))
`(org-block ((t (:inherit 'fixed-pitched))))
`(org-block-background ((t (:inherit 'fixed-pitched))))
`(org-block-begin-line ((t (:inherit 'fixed-pitched))))
`(org-block-end-line ((t (:inherit 'fixed-pitched))))
`(org-level-8 ((t (,@headline ,@tl/variable-font-tuple))))
`(org-level-7 ((t (,@headline ,@tl/variable-font-tuple))))
`(org-level-6 ((t (,@headline ,@tl/variable-font-tuple))))
`(org-level-5 ((t (,@headline ,@tl/variable-font-tuple))))
`(org-level-4 ((t (,@headline ,@tl/variable-font-tuple
:height 1.1))))
`(org-level-3 ((t (,@headline ,@tl/variable-font-tuple
:height 1.1))))
`(org-level-2 ((t (,@headline ,@tl/variable-font-tuple
:height 1.1))))
`(org-level-1 ((t (,@headline ,@tl/variable-font-tuple
:height 2.1))))
`(org-document-title ((t (,@headline ,@tl/variable-font-tuple :height 1.5 :underline nil)))))))
#+END_SRC
And the default startup goes to…night…
#+BEGIN_SRC emacs-lisp
(tl/change-theme 'gotham 'org-src-color-blocks-dark)
#+END_SRC
#+BEGIN_SRC emacs-lisp
(provide 'init-client)
#+END_SRC