]> git.vanrenterghem.biz Git - Dotty.git/blob - emacs/.emacs.d/init.el
Use Tempel for templates in Emacs.
[Dotty.git] / emacs / .emacs.d / init.el
1 ;; Added by Package.el.  This must come before configurations of
2 ;; installed packages.  Don't delete this line.  If you don't want it,
3 ;; just comment it out by adding a semicolon to the start of the line.
4 ;; You may delete these explanatory comments.
5 (package-initialize)
7 (add-to-list 'load-path "~/.emacs.d/lisp/")
9 (tool-bar-mode -1)
10 (scroll-bar-mode -1)
12 (setopt custom-file "~/.emacs.d/custom.el")
13 (load custom-file)
15 ;; Configure printing using CUPS network printer
16 (setq lpr-switches
17       (append '("-o raw"
18                 "-o media=A4")
19               lpr-switches))
21 ;; Enable the melpa archive for packages
22 (use-package package
23   :config
24   (setq package-enable-at-startup nil)
25   (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
26   (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
27   (add-to-list 'package-archives
28                '("elpy" . "http://jorgenschaefer.github.io/packages/")))
30 (use-package system-packages
31   :ensure t)
33 (use-package modus-themes
34   :ensure t
35   :demand t ;; Without this, the theme load is deferred due to the
36             ;; bind keyword below
37   :init
38   ;; Add all customisation prior to loading the themes
39   (setq modus-themes-mixed-fonts t)
40   :config
41   (modus-themes-select 'modus-vivendi-tinted)
42   (variable-pitch-mode)
43   :bind ("<f5>" . modus-themes-toggle))
45 (use-package orderless
46   :ensure t
47   :config
48   (setq completion-styles '(orderless basic)
49         completion-category-overrides '((file (styles basic partial-completion)))))
51 ;; follow links to version-controlled files without confirming
52 vc-follow-symlinks t
54 ;; ESS - for working in R
55 (autoload 'R-mode "ess-site.el" "Major mode for editing R source." t)
56 (setq load-path (cons "/usr/share/emacs/site-lisp/ess" load-path))
57 (load "/usr/share/emacs/site-lisp/ess/lisp/ess-site")
58 (setq inferior-julia-program-name "/usr/bin/julia")
60 (use-package ess-view-data
61   :ensure t)
63 ;; Configure Tempel
64 (use-package tempel
65   :ensure t
66   ;; Require trigger prefix before template name when completing.
67   ;; :custom
68   ;; (tempel-trigger-prefix "<")
70   :bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
71          ("M-*" . tempel-insert))
73   :init
75   ;; Setup completion at point
76   (defun tempel-setup-capf ()
77     ;; Add the Tempel Capf to `completion-at-point-functions'.
78     ;; `tempel-expand' only triggers on exact matches. Alternatively use
79     ;; `tempel-complete' if you want to see all matches, but then you
80     ;; should also configure `tempel-trigger-prefix', such that Tempel
81     ;; does not trigger too often when you don't expect it. NOTE: We add
82     ;; `tempel-expand' *before* the main programming mode Capf, such
83     ;; that it will be tried first.
84     (setq-local completion-at-point-functions
85                 (cons #'tempel-expand
86                       completion-at-point-functions)))
88   (add-hook 'conf-mode-hook 'tempel-setup-capf)
89   (add-hook 'prog-mode-hook 'tempel-setup-capf)
90   (add-hook 'text-mode-hook 'tempel-setup-capf)
92   ;; Optionally make the Tempel templates available to Abbrev,
93   ;; either locally or globally. `expand-abbrev' is bound to C-x '.
94   ;; (add-hook 'prog-mode-hook #'tempel-abbrev-mode)
95   ;; (global-tempel-abbrev-mode)
96 )
98 ;; Optional: Add tempel-collection.
99 ;; The package is young and doesn't have comprehensive coverage.
100 (use-package tempel-collection
101   :ensure t
102   :after tempel)
104 ;; enable autocomplete
105 (use-package corfu
106   :ensure t
107   ;; Optional customizations
108   :custom
109   (corfu-cycle t)                ;; Enable cycling for `corfu-next/previous'
110   (corfu-auto t)                 ;; Enable auto completion
111   ;; (corfu-separator ?\s)          ;; Orderless field separator
112   ;; (corfu-quit-at-boundary nil)   ;; Never quit at completion boundary
113   ;; (corfu-quit-no-match nil)      ;; Never quit, even if there is no match
114   ;; (corfu-preview-current nil)    ;; Disable current candidate preview
115   ;; (corfu-preselect 'prompt)      ;; Preselect the prompt
116   ;; (corfu-on-exact-match nil)     ;; Configure handling of exact matches
117   ;; (corfu-scroll-margin 5)        ;; Use scroll margin
119   ;; Enable Corfu only for certain modes. See also `global-corfu-modes'.
120   ;; :hook ((prog-mode . corfu-mode)
121   ;;        (shell-mode . corfu-mode)
122   ;;        (eshell-mode . corfu-mode))
124   ;; Recommended: Enable Corfu globally.  This is recommended since Dabbrev can
125   ;; be used globally (M-/).  See also the customization variable
126   ;; `global-corfu-modes' to exclude certain modes.
127   :init
128   (global-corfu-mode)
129   (corfu-history-mode))
131 (use-package cape
132   :ensure t
133   ;; Bind prefix keymap providing all Cape commands under a mnemonic key.
134   ;; Press C-c p ? to for help.
135   :bind ("C-c p" . cape-prefix-map) ;; Alternative keys: M-p, M-+, ...
136   ;; Alternatively bind Cape commands individually.
137   ;; :bind (("C-c p d" . cape-dabbrev)
138   ;;        ("C-c p h" . cape-history)
139   ;;        ("C-c p f" . cape-file)
140   ;;        ...)
141   :init
142   ;; Add to the global default value of `completion-at-point-functions' which is
143   ;; used by `completion-at-point'.  The order of the functions matters, the
144   ;; first function returning a result wins.  Note that the list of buffer-local
145   ;; completion functions takes precedence over the global list.
146   (add-hook 'completion-at-point-functions #'cape-dict) ;; requires words package to be installed on Arch to provide /usr/share/dict/words
147   (add-hook 'completion-at-point-functions #'cape-dabbrev)
148   (add-hook 'completion-at-point-functions #'cape-file) 
149   (add-hook 'completion-at-point-functions #'cape-elisp-block)
150   ;; (add-hook 'completion-at-point-functions #'cape-history)
151   ;; ...
152   )
154 (use-package org
155   :ensure t
156   :bind
157   (("C-c c" . org-capture)
158    ("C-c l" . org-store-link)
159    ("C-c a" . org-agenda))
160   :custom
161   (org-default-notes-file "~/Nextcloud/notes/inbox.org")
162   (org-agenda-files `(,org-default-notes-file "~/Nextcloud/notes/calendar-nextcloud.org"))
163   (org-capture-bookmark nil)
164   ;; Capture templates
165   (org-capture-templates
166    '(("f" "Fleeting note" entry
167       (file+headline org-default-notes-file "Notes")
168       "* %?\nEntered on %U\n  %i\n  %a")
169      ("b" "Tax receipt" item
170       (file "~/Documents/belastingen/FY24-25.org")
171       "* %t %a\n")
172      ("a" "Appointment" entry
173            (file+olp+datetree "~/Nextcloud/notes/calendar-nextcloud.org")
174            "* %?\n :PROPERTIES:\n :location: %^{Location}\n :END:\n%(fv/org-capture-appointment-timestamp)\n\n"
175            :jump-to-captured t
176            :empty-lines 1
177            :tree-type month
178            :time-prompt t)
179      ("p" "Permanent note" plain
180       (file denote-last-path)
181       #'denote-org-capture
182       :no-save t
183       :immediate-finish nil
184       :kill-buffer t
185       :jump-to-captured t)
186      ("t" "New task" entry
187       (file+headline org-default-notes-file "Tasks")
188       "* TODO %i%?")
189      ("e" "Email follow-up" entry (file+headline org-default-notes-file "Tasks")
190       "* TODO %:fromname: %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\") t)")))
191   ;; Agenda views
192   (org-agenda-custom-commands
193    '(("P" "Expired calendar events" ((tags "TIMESTAMP<=\"<now>\"")))
194      ("n" "Agenda and all TODOs"  ((agenda "") (alltodo "")))))
195   :config
196   ;; Configure refile
197   (defun my/opened-buffer-files ()
198     "Return the list of org files currently opened in emacs"
199     (delq nil
200           (mapcar (lambda (x)
201                     (if (and (buffer-file-name x)
202                              (string-match "\\.org$"
203                                            (buffer-file-name x)))
204                         (buffer-file-name x)))
205                   (buffer-list))))
206   (setq org-refile-targets `((my/opened-buffer-files :maxlevel . 9)
207                              (,(file-expand-wildcards  "~/Nextcloud/notes/*.org") :maxlevel . 1)))
208   (setq org-agenda-skip-scheduled-if-done t)
209   (setq org-agenda-skip-deadline-if-done t)
210   (setq org-agenda-start-on-weekday nil)
211   (setq org-log-done 'time)
212   ;; Automatically flow lines based on window width and use
213   ;; variable width fonts in org-mode.
214   (add-hook 'org-mode-hook 'visual-line-mode)
215   (add-hook 'org-mode-hook 'variable-pitch-mode)
216   ;; org-mode support for R and LaTeX
217   (org-babel-do-load-languages
218    'org-babel-load-languages
219    '((R . t)
220      (latex . t))))
222 (defun fv/org-capture-appointment-timestamp (&optional duration)
223   "Get an Org timestamp for an appointment.
224 Prompt for a start time, calculate the end time by adding DURATION (default 30
225 minutes), and return a formatted Org timestamp with start and end times."
226   (let* ((duration (or duration 30))
227          (start-time (org-read-date t t nil "From:"))
228          (end-time (time-add start-time (seconds-to-time (* duration 60)))))
229     (concat (format-time-string (org-time-stamp-format t) start-time)
230             "--"
231             (format-time-string (org-time-stamp-format t) end-time))))
233 (use-package org-caldav
234   :ensure t
235   :config
236   (setq org-caldav-url "https://owncloud.vanrenterghem.biz/remote.php/dav/calendars/frederik")
237   (setq org-caldav-calendar-id "default%20calendar")
238   ;; Org filename where new entries from calendar stored
239   (setq org-caldav-inbox '(file+olp+datetree "~/Nextcloud/notes/calendar-nextcloud.org"))
240   ;; Additional Org files to check for calendar events
241   (setq org-caldav-files nil)
242   ;; Usually a good idea to set the timezone manually
243   (setq org-icalendar-timezone "Australia/Perth")
244   (setq org-caldav-delete-calendar-entries 'ask))
246 (use-package org-protocol)
248 (use-package tex
249   :ensure auctex
250   :config
251   (setq TeX-auto-save t
252         TeX-parse-self t
253         TeX-view-program-selection
254    '(((output-dvi has-no-display-manager)
255       "dvi2tty")
256      ((output-dvi style-pstricks)
257       "dvips and gv")
258      (output-dvi "xdvi")
259      (output-pdf "PDF Tools")
260      (output-html "xdg-open"))))
261 ;; (load "preview-latex.el" nil t t)
264 ;; Automatically switch to various modes
265 (setq auto-mode-alist
266     '(("\\.mdwn\\'" . markdown-mode)
267       ("\\.md\\'" . markdown-mode)
268       ("\\.yarn\\'" . markdown-mode)
269       ("\\.cpp\\'" . c++-mode)
270       ("\\.js\\'" . js-mode)
271       ("\\.json\\'" . js-mode)
272       ("Makefile" . makefile-mode)
273       ("README" . markdown-mode)
274       ("NEWS" . markdown-mode)
275       ("COMMIT_EDITMSG\\'" . text-mode)
276       ("\\.html\\'" . html-mode)
277       ("\\.css\\'" . css-mode)
278       ("\\.yaml\\'" . yaml-mode)
279       ("\\.yml\\'" . yaml-mode)
280       ("\\.ick\\'" . yaml-mode)
281       ("\\.py\\'" . python-mode)
282       ("\\.R\\'" . R-mode)
283       ("\\.org\\'" . org-mode)
284       ("\\.tex\\'" . latex-mode)
285       ("\\.sh\\'" . shell-script-mode)
286       ("\\.hs\\'" . haskell-mode)
287       ("\\.el\\'" . emacs-lisp-mode)))
289 ;; Send mail using SMTP via mail.vanrenterghem.io.
290 (setq send-mail-function    'smtpmail-send-it)
291 (setq smtpmail-smtp-server "mail.vanrenterghem.io"
292       smtpmail-smtp-service 587
293       smtpmail-stream-type 'starttls)
294 (setq user-full-name "Frederik Vanrenterghem"
295       smtpmail-local-domain "vanrenterghem.io"
296       user-mail-address (concat "frederik@" smtpmail-local-domain))
297 ;; Ignored in mu4e as it sets user-agent
298 (setq mail-default-headers
299       (concat "X-Mailer: GNU Emacs " (symbol-value 'emacs-version))) 
300 (setq w3m-pop-up-frames t)
302 (setq gnus-select-method '(nntp "news.eternal-september.org"
303                                 (nntp-open-connection-function nntp-open-tls-stream)
304                                 (nntp-port-number 563)
305                                 (nntp-authinfo-user "frederikv")
306                                 (nntp-authinfo-force t)))
308 (global-set-key [remap list-buffers] 'ibuffer)
310 ;;; use pass (~/.password-store)
311 ;;; (see The Unix password store)
312 (use-package pass
313   :ensure t
314   :config
315   (auth-source-pass-enable)
316   (setq pass-username-field "Username"))
318 ;; Elfeed news reader from Nextcloud
319 (use-package elfeed
320   :ensure t
321   :config
322   (setq elfeed-use-curl nil)
323   (elfeed-set-timeout 36000)
324   (define-key elfeed-search-mode-map (kbd "*") (lambda () (interactive) (apply 'elfeed-search-toggle-all '(star))))
325   (define-key elfeed-show-mode-map (kbd "*") (lambda () (interactive) (apply 'elfeed-show-tag '(star))))
326   (add-hook 'elfeed-show-mode 'variable-pitch-mode))
328 (use-package elfeed-protocol
329   :ensure t
330   :after elfeed
331   :config
332   (setq elfeed-protocol-feeds '(
333                                 ("owncloud+https://frederik@owncloud.vanrenterghem.biz" :use-authinfo t)
334         ))
335   (elfeed-protocol-enable))
338 ;; Read and write email using mu4e
339 (use-package mu4e
340   :ensure nil
341   ;; :ensure-system-package mu ;; Install from aur
342   :config
343   (setq mail-user-agent 'mu4e-user-agent)
344   ;; Also use mu4e when called from gnus-dired-attach
345   (setq gnus-dired-mail-mode 'mu4e-user-agent
346         mu4e-get-mail-command "mbsync io"
347         mu4e-update-interval 600
348         mu4e-use-fancy-chars t
349         mu4e-view-show-images t
350         mu4e-sent-folder   "/Sent"
351         mu4e-drafts-folder "/Drafts"
352         mu4e-trash-folder  "/Trash"
353         message-kill-buffer-on-exit t
354         ;;Fixing duplicate UID errors when using mbsync and mu4e
355         mu4e-change-filenames-when-moving t)
356   ;; attach files to mu4e messages by marking the file(s) in dired and pressing C-c RET C-a
357   (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)
358   ;; Define all bookmarks starting with favourite query used in mailcount modeline
359   (setq mu4e-bookmarks
360         '(( :name "Last 24h's messages"
361           :key ?l
362           :favorite y
363           :query "date:24h..now AND NOT flag:trashed")
364         ( :name "Unread messages"
365           :query "flag:unread AND NOT flag:trashed"
366           :key ?u)
367         ( :name "Today's messages"
368           :query "date:today..now AND NOT flag:trashed"
369           :key ?t)
370         ( :name "Last 7 days"
371           :query "date:7d..now AND NOT flag:trashed"
372           :hide-unread t
373           :key ?w)
374         ( :name "Messages with images"
375           :query "mime:image/* AND NOT flag:trashed"
376           :key ?p)))
377   ;; Create custom spam status header and show in message view
378   (add-to-list 'mu4e-header-info-custom
379                '(:spam-status .
380                               ( :name "Spam-Status"     ;; long name, as seen in the message-view
381                                 :shortname "Spam"      ;; short name, as seen in the headers view
382                                 :help "The Spam status" ;; tooltip
383                                 ;; uses mu4e-fetch-field which is rel. slow, so only appropriate
384                                 ;; for mu4e-view-fields, and _not_ mu4e-headers-fields
385                                 :function (lambda (msg)
386                                             (or (string-join (seq-take (split-string (or (mu4e-fetch-field msg "X-Spam-Status") "") " ") 2) " ") "")))))
387   (add-to-list 'mu4e-view-fields :spam-status)
388   ;; Resize image attachments when sending email
389   (defvar mu4e-resize-image-types '("jpg" "png" "svg" "jpeg")
390     "List of attached image types to resize.")
391   (defvar mu4e-inhibit-resize nil)
392   (defun mu4e-resize-image-attachments ()
393     (unless mu4e-inhibit-resize
394       (let (cmds
395             (image-types
396              (mapconcat #'identity mu4e-resize-image-types "\\|")))
397         (save-excursion
398           (message-goto-body-1)
399           (while (re-search-forward 
400                   (format "<#part.+\\(filename=\"\\)\\(.+\\(\\.%s\\)\\)\""
401                           image-types)
402                   nil t)
403             (let* ((infile (match-string-no-properties 2))
404                    (outfile (concat (temporary-file-directory)
405                                     (file-name-nondirectory infile))))
406               (push (format "magick convert %s -resize 1200x1200\\> %s"
407                             (shell-quote-argument infile)
408                             (shell-quote-argument outfile))
409                     cmds)
410               (replace-match outfile t t nil 2)))
411           (mapcar #'shell-command cmds)))))
412   (add-hook 'message-send-hook 'mu4e-resize-image-attachments)
413   (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) ;; Attach files to messages using dired C-c RET C-a
414   (defun mu4e-inhibit-resize()
415     (interactive)
416     (set (make-local-variable 'mu4e-inhibit-resize) t)))
418 ;; Load configuration for website
419 ;(load "mustache-html")
421 ;; Denote config
422 (use-package denote
423   :ensure t
424   :hook (dired-mode . denote-dired-mode)
425   :bind
426   (("C-c n n" . denote)
427    ("C-c n r" . denote-rename-file)
428    ("C-c n l" . denote-link)
429    ("C-c n b" . denote-backlinks))
430   :config
431   (setq denote-directory "/home/frederik/Nextcloud/notes/")
432   (denote-rename-buffer-mode 1))
434 (use-package nerd-icons
435   ;; :custom
436   ;; The Nerd Font you want to use in GUI
437   ;; "Symbols Nerd Font Mono" is the default and is recommended
438   ;; but you can use any other Nerd Font if you want
439   ;; (nerd-icons-font-family "Symbols Nerd Font Mono")
440   )
442 ;; Dired configuration
443 (with-eval-after-load 'dired
444   (require 'dired-x)
445   ;; Set dired-x global variables here.  For example:
446   ;; (setq dired-x-hands-off-my-keys nil)
447   )
448 (add-hook 'dired-mode-hook
449           (lambda ()
450             ;; Set dired-x buffer-local variables here.
451             (dired-omit-mode 1)
452             (dired-hide-details-mode 1)
453             (nerd-icons-dired-mode 1)
454             ))
455 (setq delete-by-moving-to-trash t)
456 (setq dired-guess-shell-alist-user
457       '(("\\.\\(png\\|jpe?g\\|tiff\\)" "feh" "xdg-open")
458         ("\\.\\(mp[34]\\|m4a\\|ogg\\|flac\\|webm\\|mkv\\)" "mpv" "xdg-open")
459                 (".*" "xdg-open")))
461 ;; Use `vertico' package to get a vertical view of the minibuffer.
462 (use-package vertico
463   :ensure t
464   :config
465   (setq vertico-resize nil)
466   (vertico-mode 1))
468 ;; Persist history over Emacs restarts. Vertico sorts by history position.
469 (use-package savehist
470   :init
471   (savehist-mode))
473 ;; Use `marginalia' package.  This will display useful
474 ;; annotations next to entries in the minibuffer.  For example, when
475 ;; using M-x it will show a brief description of the command as well
476 ;; as the keybinding associated with it (if any).
477 (use-package marginalia
478   :ensure t
479   :config
480   (marginalia-mode 1))
482 ;; Use 'winner' mode to undo and redo windows changes
483 ;; using C-c <left> and C-c <right>.
484 (use-package winner
485   :ensure t
486   :config
487   (winner-mode 1))
489 ;; Use a different spell checker, always
490 (use-package jinx
491   :ensure t
492   :config
493   (keymap-global-set "M-$" #'jinx-correct)
494   :hook (emacs-startup . global-jinx-mode))
496 (use-package powerthesaurus
497   :ensure t
498   :init
499   (require 'transient)
500   (transient-define-prefix my/transient-spelling ()
501     "Spelling commands"
502     ["Spelling"
503       ["Lookups"
504         ("y" "Synonyms" powerthesaurus-lookup-synonyms-dwim)
505         ("a" "Antonyms" powerthesaurus-lookup-antonyms-dwim)]
506       ["Spelling Tools"
507         ("x" "Jinx" jinx-mode)
508         ("c" "Jinx correct" jinx-correct)]
509       ["Dictionary"
510         ("d" "Lookup" dictionary-lookup-definition)]
511       ["Miscellaneous"
512         ("q" "Quit" transient-quit-one)]])
513   :bind
514   ("C-c s" . my/transient-spelling))
516 ;; Bind embark
517 (use-package embark
518   :ensure t
519   :config
520   (keymap-global-set "C-." #'embark-act)
521   (keymap-global-set "C-;" #'embark-dwim))
523 (use-package consult
524   :ensure t
525   :config
526   ;; Change default bindings to consult- ones
527   :bind
528   (;; C-x bindings in `ctl-x-map'
529    ("C-x b" . consult-buffer)                ;; orig. switch-to-buffer
530    ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
531    ("C-x r b" . consult-bookmark)            ;; orig. bookmark-jump
532    ;; Other custom bindings
533    ("M-y" . consult-yank-pop)))              ;; orig. yank-pop
535 (use-package consult-mu
536   :ensure nil ;; cloned in
537   :load-path "~/.emacs.d/lisp/consult-mu"
538   :after (consult mu4e)
539   :custom
540   ;;maximum number of results shown in minibuffer
541   (consult-mu-maxnum 200)
542   ;;show preview when pressing any keys
543   (consult-mu-preview-key 'any)
544   ;;do not mark email as read when previewed
545   (consult-mu-mark-previewed-as-read nil)
546   ;;do not amrk email as read when selected. This is a good starting point to ensure you would not miss important emails marked as read by mistake especially when trying this package out. Later you can change this to t.
547   (consult-mu-mark-viewed-as-read nil)
548   ;; open the message in mu4e-view-buffer when selected.
549   (consult-mu-action #'consult-mu--view-action)
550   )
552 (use-package consult-denote
553   :ensure t)
555 ;; Configure `world-clock'
556 (use-package time
557   :ensure nil
558   :config
559   (setq zoneinfo-style-world-list '(("Europe/Brussels" "Leuven")))
560   (add-to-list 'zoneinfo-style-world-list '("Australia/Perth" "Perth")))
563 ;; View PDFs in Emacs
564 (pdf-loader-install) ; On demand loading, leads to faster startup time
565 (setq pdf-misc-print-programm "/usr/bin/lpr")
566   
567 (use-package magit
568   :ensure t)
570 (use-package eat
571   :ensure t
572   :config
573    ;; For `eat-eshell-mode'.
574   (add-hook 'eshell-load-hook #'eat-eshell-mode)
575   (setq eshell-visual-commands '()))
577 ;; Read ePub files
578 (use-package nov
579   :ensure t
580   :init
581   (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
582   :config
583   (add-hook 'nov-mode-hook #'variable-pitch-mode))
585 ;; Set some preset fonts
586 (use-package fontaine
587   :ensure t
588   :config
589   (setq fontaine-presets
590       '((regular-1
591          :default-family "Iosevka Nerd Font"
592          :default-height 120
593          :variable-pitch-family "Linux Biolinum O"
594          :variable-pitch-weight normal
595          :variable-pitch-height 1.1
596          :italic-family "Iosevka Etoile"
597          :line-spacing 1)
598         (large-1
599          :default-family "Iosevka Nerd Font"
600          :default-height 150
601          :variable-pitch-family "Literata"
602          :variable-pitch-weight normal
603          :variable-pitch-height 1.0
604          :line-spacing 1)
605         (regular-2
606          :default-family "Fira Mono Nerd Font"
607          :default-height 140
608          :variable-pitch-family "Fira Sans Book"
609          :variable-pitch-weight normal
610          :variable-pitch-height 1.0
611          :line-spacing 1)
612         (large-2
613          :default-family "Fira Mono Nerd Font"
614          :default-height 140
615          :variable-pitch-family "Fira Sans Book"
616          :variable-pitch-weight normal
617          :variable-pitch-height 1.0
618          :line-spacing 1)
619         (ereader-Baskerville
620          :variable-pitch-family "Libre Baskerville"
621          :variable-pitch-weight normal
622          :variable-pitch-height 1.0
623          :line-spacing 1)
624         (ereader-Noto-Serif
625          :variable-pitch-family "Noto Serif"
626          :variable-pitch-weight normal
627          :variable-pitch-height 1.0
628          :line-spacing 1)
629         (ereader-Bembo-Tufte
630          :variable-pitch-family "ETBembo"
631          :variable-pitch-weight normal
632          :variable-pitch-height 1.1
633          :line-spacing 1)
634         (ereader-Literata
635          :variable-pitch-family "Literata"
636          :variable-pitch-weight normal
637          :variable-pitch-height 1.0
638          :line-spacing 1))))
640 (use-package devdocs
641   :ensure t
642   :bind
643   ("C-h D" . devdocs-lookup))
645 (use-package emms
646   :ensure t
647   :config
648   (require 'emms-setup)
649   (require 'emms-player-mpd)
650   (emms-all) ; don't change this to values you see on stackoverflow questions if you expect emms to work
651   (setq emms-player-list '(emms-player-mpd))
652   (add-to-list 'emms-info-functions 'emms-info-mpd)
653   (add-to-list 'emms-player-list 'emms-player-mpd)
654   
655   ;; Socket is not supported
656   (setq emms-player-mpd-server-name "mea-hookani-pila")
657   (setq emms-player-mpd-server-port "6600")
658   (emms-player-mpd-connect))
660 ;; Custom functions
662 ;; Might want to run this automatically
663 ;; using variable after-focus-change-function
664 (defun my/adjust-font-size-based-on-display ()
665   "Change size of fonts based on monitor."
666   (interactive)
667   (let* ((display-name (cdr (assq 'name (frame-monitor-attributes))))
668          (font-height (cond ((string-equal display-name "eDP-1") 140) 
669                             (t 120) ;; default
670                             )))
671     (set-face-attribute 'default (selected-frame) :height font-height)))