From 58b037d9c28719447031060339ef9fdbc9b240d7 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 26 Apr 2018 19:08:04 +0100 Subject: Adding mail support --- emacs/loader.org | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- install.sh | 37 ++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 install.sh diff --git a/emacs/loader.org b/emacs/loader.org index b7104f7..af2525f 100644 --- a/emacs/loader.org +++ b/emacs/loader.org @@ -132,7 +132,70 @@ using the emacsclient. #+BEGIN_SRC emacs-lisp (require 'mu4e) - (setq mu4e-maildir (expand-file-name "~/.mail/gmail")) + ;; use mu4e for e-mail in emacs + (setq mail-user-agent 'mu4e-user-agent) + + ;; default + (setq mu4e-maildir "~/.mail") + + (setq mu4e-headers-skip-duplicates t) + + (setq mu4e-drafts-folder "/gmail/[Gmail]/Drafts") + (setq mu4e-sent-folder "/gmail/[Gmail]/Sent Mail") + (setq mu4e-trash-folder "/gmail/[Gmail]/Trash") + + ;; don't save message to Sent Messages, Gmail/IMAP takes care of this + (setq mu4e-sent-messages-behavior 'delete) + + ;; (See the documentation for `mu4e-sent-messages-behavior' if you have + ;; additional non-Gmail addresses and want assign them different + ;; behavior.) + + ;; setup some handy shortcuts + ;; you can quickly switch to your Inbox -- press ``ji'' + ;; then, when you want archive some messages, move them to + ;; the 'All Mail' folder by pressing ``ma''. + + (setq mu4e-maildir-shortcuts + '( ("/gmail/Inbox" . ?i) + ("/gmail/[Gmail]/Sent Mail" . ?s) + ("/gmail/[Gmail]/Trash" . ?t) + ("/gmail/[Gmail]/All Mail" . ?a))) + + ;; allow for updating mail using 'U' in the main view: + (setq mu4e-get-mail-command "mbsync -a") + + ;; something about ourselves + (setq + user-mail-address "ymherklotz@gmail.com" + user-full-name "Yann Herklotz" + mu4e-compose-signature + (concat + "Yann Herklotz\n")) + + ;; sending mail -- replace USERNAME with your gmail username + ;; also, make sure the gnutls command line utils are installed + ;; package 'gnutls-bin' in Debian/Ubuntu + + (require 'smtpmail) + (setq message-send-mail-function 'smtpmail-send-it + starttls-use-gnutls t + smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) + smtpmail-auth-credentials + '(("smtp.gmail.com" 587 "ymherklotz@gmail.com" nil)) + smtpmail-default-smtp-server "smtp.gmail.com" + smtpmail-smtp-server "smtp.gmail.com" + smtpmail-smtp-service 587) + + ;; alternatively, for emacs-24 you can use: + ;;(setq message-send-mail-function 'smtpmail-send-it + ;; smtpmail-stream-type 'starttls + ;; smtpmail-default-smtp-server "smtp.gmail.com" + ;; smtpmail-smtp-server "smtp.gmail.com" + ;; smtpmail-smtp-service 587) + + ;; don't keep message buffers around + (setq message-kill-buffer-on-exit t) #+END_SRC @@ -415,6 +478,7 @@ language support. (counsel-projectile-mode t)) #+END_SRC + ** Language Support *** C++ @@ -672,6 +736,13 @@ language support. #+BEGIN_SRC emacs-lisp (add-to-list 'auto-mode-alist '("\\.json\\'" . js-mode)) #+END_SRC +*** Shell + +#+BEGIN_SRC emacs-lisp + (setq sh-basic-offset 2) + (setq sh-indentation 2) +#+END_SRC + *** Rust Rust mode for rust development. @@ -854,6 +925,7 @@ Setting the gc-cons threshold back to what it was at the beginning. #+END_SRC + * Not used anymore ** Ivy / Swiper / Counsel diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..f28cf59 --- /dev/null +++ b/install.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +current_dir=$(pwd) + +extra_opts=" -s " + +for i in "$@"; do + case $i in + + -f | --force) + extra_opts+=" -f " + ;; + + esac +done + +function ln_configs { + ln $extra_opts ${current_dir}/${1} $2 +} + +echo "installing emacs config..." +cp ${current_dir}/emacs/init.el ~/.emacs.d/init.el +ln_configs emacs/loader.org ~/.emacs.d/loader.org + +echo "installing X config" +ln_configs X/.Xmodmap ~/.Xmodmap +ln_configs X/.Xresources ~/.Xresources +ln_configs X/.xinitrc ~/.xinitrc + +echo "installing tmux config" +ln_configs tmux/.tmux.conf ~/.tmux.conf + +echo "installing i3 config" +ln_configs i3/config ~/.config/i3/config + +echo "installing zsh config" +ln_configs zsh/.zshrc ~/.zshrc -- cgit