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