X-Git-Url: http://git.vanrenterghem.biz/Dotty.git/blobdiff_plain/22c7b5d659e1dc66aac094456af47ed5445c2075..a296bb8875b5c47556ddfc451a3def0ee54a0f25:/emacs/.emacs.d/init.el diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 0e6bd9d..2ed0e60 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -10,7 +10,8 @@ ;; Configure printing using CUPS network printer (setq lpr-switches - (append '("-o raw") + (append '("-o raw" + "-o media=A4") lpr-switches)) ;; Enable the melpa archive for packages @@ -62,34 +63,53 @@ vc-follow-symlinks t ([tab] . company-complete-common) ("TAB" . company-complete-common)) :config + (setq ispell-complete-word-dict + (expand-file-name (concat user-emacs-directory "aspell_words.txt"))) + ;(defun my/text-mode-hook () + ; (setq-local company-backends +; '((company-dabbrev company-ispell :separate) + ; company-files))) + ; (add-hook 'text-mode-hook #'my/text-mode-hook) (global-company-mode 1)) (use-package org :ensure t - :after - denote :bind - (("C-c c" . org-capture) - ("C-c l" . org-store-link)) - :custom - (org-default-notes-file "~/Nextcloud/notes/inbox.org") - (org-capture-bookmark nil) - ;; Capture templates - (org-capture-templates - '(("f" "Fleeting note" item - (file+headline org-default-notes-file "Notes") - "- %?\nEntered on %U\n %i\n %a") - ("p" "Permanent note" plain - (file denote-last-path) - #'denote-org-capture - :no-save t - :immediate-finish nil - :kill-buffer t - :jump-to-captured t) - ("t" "New task" entry - (file+headline org-default-notes-file "Tasks") - "* TODO %i%?"))) + (("C-c c" . org-capture) + ("C-c l" . org-store-link) + ("C-c a" . org-agenda)) + :custom + (org-default-notes-file "~/Nextcloud/notes/inbox.org") + (org-agenda-files `(,org-default-notes-file "~/Nextcloud/notes/calendar.org")) + (org-capture-bookmark nil) + ;; Capture templates + (org-capture-templates + '(("f" "Fleeting note" item + (file+headline org-default-notes-file "Notes") + "* %?\nEntered on %U\n %i\n %a") + ("b" "Tax receipt" item + (file "~/Documents/belastingen/FY24-25.org") + "* %t %a\n") + ("p" "Permanent note" plain + (file denote-last-path) + #'denote-org-capture + :no-save t + :immediate-finish nil + :kill-buffer t + :jump-to-captured t) + ("t" "New task" entry + (file+headline org-default-notes-file "Tasks") + "* TODO %i%?") + ("e" "Email follow-up" entry (file+headline org-default-notes-file "Tasks") + "* TODO %:fromname: %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))"))) + ;; Agenda views + (org-agenda-custom-commands + '(("P" "Expired calendar events" ((tags "TIMESTAMP<=\"\""))) + ("n" "Agenda and all TODOs" ((agenda "") (alltodo ""))))) :config + (setq org-agenda-skip-scheduled-if-done t) + (setq org-agenda-skip-deadline-if-done t) + (setq org-agenda-start-on-weekday nil) ;; Automatically flow lines based on window width and use ;; variable width fonts in org-mode. (add-hook 'org-mode-hook 'visual-line-mode) @@ -98,10 +118,20 @@ vc-follow-symlinks t (org-babel-do-load-languages 'org-babel-load-languages '((R . t) - (latex . t))) - ;; Security risk - This is somewhat ill-advised it appears - (setq org-confirm-babel-evaluate nil)) - + (latex . t)))) + +(use-package org-caldav + :ensure t + :config + (setq org-caldav-url "https://owncloud.vanrenterghem.biz/remote.php/dav/calendars/frederik") + (setq org-caldav-calendar-id "orgmode") + ;; Org filename where new entries from calendar stored + (setq org-caldav-inbox "~/Nextcloud/notes/calendar.org") + ;; Additional Org files to check for calendar events + (setq org-caldav-files nil) + ;; Usually a good idea to set the timezone manually + (setq org-icalendar-timezone "Australia/Perth")) + (use-package tex :ensure auctex :config @@ -220,7 +250,9 @@ vc-follow-symlinks t mu4e-sent-folder "/Sent" mu4e-drafts-folder "/Drafts" mu4e-trash-folder "/Trash" - message-kill-buffer-on-exit t) + message-kill-buffer-on-exit t + ;;Fixing duplicate UID errors when using mbsync and mu4e + mu4e-change-filenames-when-moving t) ;; attach files to mu4e messages by marking the file(s) in dired and pressing C-c RET C-a (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) ;; Define all bookmarks starting with favourite query used in mailcount modeline @@ -288,8 +320,15 @@ vc-follow-symlinks t ;; Denote config (use-package denote :ensure t + :hook (dired-mode . denote-dired-mode) + :bind + (("C-c n n" . denote) + ("C-c n r" . denote-rename-file) + ("C-c n l" . denote-link) + ("C-c n b" . denote-backlinks)) :config - (setq denote-directory "/home/frederik/Nextcloud/notes/")) + (setq denote-directory "/home/frederik/Nextcloud/notes/") + (denote-rename-buffer-mode 1)) (use-package nerd-icons ;; :custom @@ -325,6 +364,11 @@ vc-follow-symlinks t (setq vertico-resize nil) (vertico-mode 1)) +;; Persist history over Emacs restarts. Vertico sorts by history position. +(use-package savehist + :init + (savehist-mode)) + ;; Use `marginalia' package. This will display useful ;; annotations next to entries in the minibuffer. For example, when ;; using M-x it will show a brief description of the command as well @@ -368,6 +412,23 @@ vc-follow-symlinks t ;; Other custom bindings ("M-y" . consult-yank-pop))) ;; orig. yank-pop +(use-package consult-mu + :ensure nil ;; cloned in + :load-path "~/.emacs.d/lisp/consult-mu" + :after (consult mu4e) + :custom + ;;maximum number of results shown in minibuffer + (consult-mu-maxnum 200) + ;;show preview when pressing any keys + (consult-mu-preview-key 'any) + ;;do not mark email as read when previewed + (consult-mu-mark-previewed-as-read nil) + ;;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. + (consult-mu-mark-viewed-as-read nil) + ;; open the message in mu4e-view-buffer when selected. + (consult-mu-action #'consult-mu--view-action) + ) + ;; Configure `world-clock' (use-package time :ensure nil @@ -378,7 +439,8 @@ vc-follow-symlinks t ;; View PDFs in Emacs (pdf-loader-install) ; On demand loading, leads to faster startup time - +(setq pdf-misc-print-programm "/usr/bin/lpr") + (use-package magit :ensure t)