You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
dotfiles/emacs_home.el

177 lines
5.9 KiB

(setq org-agenda-files (list "~/Documents/home-org-mode/tweaking.org"
"~/Documents/org-mode/school.org"
"~/Documents/home-org-mode/untitled_project.org"
"~/Documents/home-org-mode/personal.org"))
(set-frame-font "Iosevka:size=16" nil t)
(ensure-package-installed 'rustic)
(use-package rustic
:config
(setq rustic-lsp-client 'eglot)
(setq rustic-cargo-clippy-trigger-fix 'on-compile))
(push 'rustic-clippy flycheck-checkers)
;;(add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1)))
(eval-after-load 'gnus-group
'(progn
(defhydra hydra-gnus-group (:color blue)
"
[_A_] Remote groups (A A) [_g_] Refresh
[_L_] Local groups [_\\^_] List servers
[_c_] Mark all read [_m_] Compose new mail
[_G_] Search mails (G G) [_#_] Mark mail
"
("A" gnus-group-list-active)
("L" gnus-group-list-all-groups)
("c" gnus-topic-catchup-articles)
("G" dianyou-group-make-nnir-group)
("g" gnus-group-get-new-news)
("^" gnus-group-enter-server-mode)
("m" gnus-group-new-mail)
("#" gnus-topic-mark-topic)
("q" nil))
;; y is not used by default
(define-key gnus-group-mode-map "y" 'hydra-gnus-group/body)))
;; gnus-summary-mode
(eval-after-load 'gnus-sum
'(progn
(defhydra hydra-gnus-summary (:color blue)
"
[_s_] Show thread [_F_] Forward (C-c C-f)
[_h_] Hide thread [_e_] Resend (S D e)
[_n_] Refresh (/ N) [_r_] Reply
[_!_] Mail -> disk [_R_] Reply with original
[_d_] Disk -> mail [_w_] Reply all (S w)
[_c_] Read all [_W_] Reply all with original (S W)
[_#_] Mark [_G_] Search mails
"
("s" gnus-summary-show-thread)
("h" gnus-summary-hide-thread)
("n" gnus-summary-insert-new-articles)
("F" gnus-summary-mail-forward)
("!" gnus-summary-tick-article-forward)
("d" gnus-summary-put-mark-as-read-next)
("c" gnus-summary-catchup-and-exit)
("e" gnus-summary-resend-message-edit)
("R" gnus-summary-reply-with-original)
("r" gnus-summary-reply)
("W" gnus-summary-wide-reply-with-original)
("w" gnus-summary-wide-reply)
("#" gnus-topic-mark-topic)
("G" dianyou-group-make-nnir-group)
("q" nil))
;; y is not used by default
(define-key gnus-summary-mode-map "y" 'hydra-gnus-summary/body)))
;; gnus-article-mode
(eval-after-load 'gnus-art
'(progn
(defhydra hydra-gnus-article (:color blue)
"
[_o_] Save attachment [_F_] Forward
[_v_] Play video/audio [_r_] Reply
[_d_] CLI to download stream [_R_] Reply with original
[_b_] Open external browser [_w_] Reply all (S w)
[_f_] Click link/button [_W_] Reply all with original (S W)
[_g_] Focus link/button
"
("F" gnus-summary-mail-forward)
("r" gnus-article-reply)
("R" gnus-article-reply-with-original)
("w" gnus-article-wide-reply)
("W" gnus-article-wide-reply-with-original)
("o" gnus-mime-save-part)
("v" w3mext-open-with-mplayer)
("d" w3mext-download-rss-stream)
("b" w3mext-open-link-or-image-or-url)
("f" w3m-lnum-follow)
("g" w3m-lnum-goto)
("q" nil))
;; y is not used by default
(define-key gnus-article-mode-map "y" 'hydra-gnus-article/body)))
;; message-mode
(eval-after-load 'message
'(progn
(defhydra hydra-message (:color blue)
"
[_c_] Complete mail address
[_a_] Attach file
[_s_] Send mail (C-c C-c)
"
("c" counsel-bbdb-complete-mail)
("a" mml-attach-file)
("s" message-send-and-exit)
("i" dianyou-insert-email-address-from-received-mails)
("q" nil))))
(defun message-mode-hook-hydra-setup ()
(local-set-key (kbd "C-c C-y") 'hydra-message/body))
(add-hook 'message-mode-hook 'message-mode-hook-hydra-setup)
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd"))
(use-package all-the-icons)
(use-package org-roam
:ensure t
:init
(setq org-roam-v2-ack t)
:custom
(org-roam-directory "~/Documents/slipbox")
(org-roam-capture-templates
'(("d" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("e" "encrypted" plain "%?"
:target (file+head "${slug}.org.gpg"
"#+title: ${title}\n")
:unnarrowed t)
("b" "book notes" plain
"\n* Source\n\nAuthor: %^{Author}\nTitle: ${title}\nYear: %^{Year}\n\n %?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)))
(org-roam-completion-everywhere t)
(org-roam-completion-system 'default)
(org-roam-dailies-directory "daily/")
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert)
("C-c n d" . org-roam-dailies-find-date)
("C-c n c" . org-roam-dailies-capture-today)
("C-c n C r" . org-roam-dailies-capture-tomorrow)
("C-c n t" . org-roam-dailies-find-today)
("C-c n y" . org-roam-dailies-find-yesterday)
("C-c n r" . org-roam-dailies-find-tomorrow)
:map org-mode-map
("C-M-i" . completion-at-point))
:config
(require 'org-roam-dailies)
(org-roam-setup)
(org-roam-db-autosync-mode))
(add-to-list 'auto-mode-alist '("neomutt" . mail-mode))
(setq appt-message-warning-time 15
appt-audible nil
appt-visible t
appt-display-format 'window)
(appt-activate 1)
(defun notify-send (title msg)
(interactive)
;; only the first line of the message is returned
;; (subseq msg 0 (search msg "\n"))
(shell-command (concat "notify-send '" title "' '" msg "'")))
(defun facade-notify-appt (min-to-app new-time msg)
(notify-send (format "Appointment in %s minute(s)" min-to-app) msg))
(add-hook 'mail-mode-hook 'flyspell-mode 1)
(add-hook 'org-mode-hook 'flyspell-mode 1)
(setq appt-disp-window-function (function facade-notify-appt))
(provide 'emacs_home)
;;;emacs_home.el ends here