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