From 3f495e25a7aef5e5e8350ed3690f8c2d4436dc73 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 23 Feb 2016 10:46:35 +0800 Subject: _emacs.d/personal: order configs by adding numeric prefix --- _emacs.d/personal/10-config.el | 23 ++++ _emacs.d/personal/30-fonts.el | 45 ++++++ _emacs.d/personal/40-orgmode.el | 46 +++++++ _emacs.d/personal/50-fcitx.el | 33 +++++ _emacs.d/personal/50-latex.el | 17 +++ _emacs.d/personal/50-mu4e.el | 293 ++++++++++++++++++++++++++++++++++++++++ _emacs.d/personal/config.el | 23 ---- _emacs.d/personal/fcitx.el | 33 ----- _emacs.d/personal/fonts.el | 45 ------ _emacs.d/personal/latex.el | 17 --- _emacs.d/personal/mu4e.el | 293 ---------------------------------------- _emacs.d/personal/orgmode.el | 46 ------- 12 files changed, 457 insertions(+), 457 deletions(-) create mode 100644 _emacs.d/personal/10-config.el create mode 100644 _emacs.d/personal/30-fonts.el create mode 100644 _emacs.d/personal/40-orgmode.el create mode 100644 _emacs.d/personal/50-fcitx.el create mode 100644 _emacs.d/personal/50-latex.el create mode 100644 _emacs.d/personal/50-mu4e.el delete mode 100644 _emacs.d/personal/config.el delete mode 100644 _emacs.d/personal/fcitx.el delete mode 100644 _emacs.d/personal/fonts.el delete mode 100644 _emacs.d/personal/latex.el delete mode 100644 _emacs.d/personal/mu4e.el delete mode 100644 _emacs.d/personal/orgmode.el diff --git a/_emacs.d/personal/10-config.el b/_emacs.d/personal/10-config.el new file mode 100644 index 0000000..440257f --- /dev/null +++ b/_emacs.d/personal/10-config.el @@ -0,0 +1,23 @@ +;;; ~/.emacs.d/personal/config.el --- Custom configurations for Prelude +;; +;; -*- mode: emacs-lisp -*- +;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: +;; +;; Aaron LI +;; 2016-02-21 +;; + +;;; Commentary: +;; Custom configurations for Prelude Emacs kit. + +;;; Code: + +;; Disable `key-chord-mode' for `evil-mode' +;; (or just do not enable the `prelude-key-chord' module) +(key-chord-mode -1) + +;; Do NOT automatically clean whitespaces on save +;(setq prelude-clean-whitespace-on-save nil) + +;; Disable `flyspell-mode': do not spellcheck on the fly +;(setq prelude-flyspell nil) diff --git a/_emacs.d/personal/30-fonts.el b/_emacs.d/personal/30-fonts.el new file mode 100644 index 0000000..d172a92 --- /dev/null +++ b/_emacs.d/personal/30-fonts.el @@ -0,0 +1,45 @@ +;;; ~/.emacs.d/personal/fonts.el --- Fonts configurations for Emacs. +;; +;; -*- mode: emacs-lisp -*- +;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: +;; +;; Credits: +;; [1] http://baohaojun.github.io/perfect-emacs-chinese-font.html +;; [2] http://zhuoqiang.me/a/torture-emacs +;; +;; Aaron LI +;; 2016-02-22 +;; + +;;; Commentary: +;; English and Chinese fonts configurations for Emacs. + +;;; Code: + +;; To increase the Unicode coverage of your favorite programming font +;; https://github.com/cpitclaudel/monospacifier +;(dolist (ft (fontset-list)) +; (set-fontset-font ft 'unicode +; (font-spec :name "Inconsolata")) +; (set-fontset-font ft 'unicode +; (font-spec :name "Symbola monospacified for Inconsolata") +; nil 'append)) + +;; English font +;; change the default font for the current frame, as well as future frames +;(set-face-attribute 'default nil :font "Terminus:pixelsize=16") +(set-face-attribute 'default nil :font "Inconsolata:pixelsize=14") + +;; Chinese font +;; available charset: kana han symbol cjk-misc bopomofo +;; font-spec: +;; `:size': either a non-negative integer that specifies the pixel size, +;; or a floating-point number that specifies the point size. +(dolist (charset '(kana han cjk-misc bopomofo)) + (set-fontset-font (frame-parameter nil 'font) + charset + (font-spec :family "WenQuanYi Zen Hei" :size 14))) +;; rescale chinese font to match: 1 Chinese = 2 English characters +;; (however, this will cause that the Chinese characters are higher) +;(setq face-font-rescale-alist '(("WenQuanYi Bitmap Song" . 1.2))) + diff --git a/_emacs.d/personal/40-orgmode.el b/_emacs.d/personal/40-orgmode.el new file mode 100644 index 0000000..0d609e7 --- /dev/null +++ b/_emacs.d/personal/40-orgmode.el @@ -0,0 +1,46 @@ +;;; ~/.emacs.d/personal/orgmode.el --- Org-mode configurations +;; +;; -*- mode: emacs-lisp -*- +;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: +;; +;; Credit: +;; [1] http://www.john2x.com/emacs.html +;; +;; Aaron LI +;; 2016-02-21 +;; + +;;; Commentary: +;; Org-mode configurations for Emacs + +;;; Code: + +(setq org-directory "~/org") +(setq org-todo-keywords + '((sequence "TODO" "DOING" "WAITING" "LATER" "|" "DONE" "DELEGATED"))) +;; default notes file for `org-capture' +(setq org-default-notes-file (concat org-directory "/notes.org")) +;; set custom `org-capture' templates +(setq org-capture-templates + '(("t" "Todo" entry (file+headline (concat org-directory "/todo.org") "Other") + "* TODO %?\n %i\n %a") + ("n" "Note" entry (file+datetree (concat org-directory "/notes.org")) + "* %?\nEntered on %U\n %i\n %a"))) +;; add custom `org-agenda' to show: +;; * agenda for the week +;; * things currently working on +;; * list of remaining TODO items +(setq org-agenda-custom-commands + '(("z" "Agenda and Tasks" + ((agenda "") + (todo "DOING") + (todo "TODO"))))) +;; enable font-locking for org source blocks +(setq org-src-fontify-natively t) +;; do not evaulate source blocks when exporting +(setq org-export-babel-evaluate nil) +;; +(global-set-key "\C-ca" 'org-agenda) +(global-set-key "\C-cb" 'org-iswitchb) +(global-set-key "\C-cc" 'org-capture) +(global-set-key "\C-cl" 'org-store-link) diff --git a/_emacs.d/personal/50-fcitx.el b/_emacs.d/personal/50-fcitx.el new file mode 100644 index 0000000..7448553 --- /dev/null +++ b/_emacs.d/personal/50-fcitx.el @@ -0,0 +1,33 @@ +;;; ~/.emacs.d/personal/fcitx.el --- Configurations for fcitx.el +;; +;; -*- mode: emacs-lisp -*- +;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: +;; +;; Aaron LI +;; 2016-02-22 +;; + +;;; Commentary: +;; Configurations for fcitx.el (https://github.com/cute-jumper/fcitx.el) + +;;; Code: + +;; fcitx.el: make fcitx better in Emacs. +(prelude-require-package 'fcitx) + +(require 'fcitx) + +;; disable fcitx by prefix keys +(fcitx-prefix-keys-setup) ;; default: `C-x' and `C-c' +(fcitx-prefix-keys-turn-on) + +;; evil support +(fcitx-evil-turn-on) + +;; disable fcitx when use `M-x' +(fcitx-M-x-turn-on) +;; disable fcitx when use `M-!' or `M-&' +(fcitx-shell-command-turn-on) +;; disable fcitx when use `M-:' +(fcitx-eval-expression-turn-on) + diff --git a/_emacs.d/personal/50-latex.el b/_emacs.d/personal/50-latex.el new file mode 100644 index 0000000..4600c03 --- /dev/null +++ b/_emacs.d/personal/50-latex.el @@ -0,0 +1,17 @@ +;;; ~/.emacs.d/personal/latex.el --- LaTeX settings for Prelude Emacs +;; +;; -*- mode: emacs-lisp -*- +;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: +;; +;; Credits: https://github.com/bbatsov/prelude/wiki/LaTeX +;; +;; Aaron LI +;; 2016-02-21 +;; + +;;; Commentary: +;; LaTeX settings for Prelude Emacs. + +;;; Code: + +(setq-default TeX-engine 'xetex) diff --git a/_emacs.d/personal/50-mu4e.el b/_emacs.d/personal/50-mu4e.el new file mode 100644 index 0000000..ad80acb --- /dev/null +++ b/_emacs.d/personal/50-mu4e.el @@ -0,0 +1,293 @@ +;;; ~/.emacs.d/personal/mu4e.el --- mu4e (mu for Emacs) configurations +;; +;; -*- mode: emacs-lisp -*- +;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: +;; +;; Aaron LI +;; 2016-02-21 +;; + +;;; Commentary: +;; mu4e (mu for Emacs) configurations with some extensions. +;; mu (maildir indexer/searcher): https://github.com/djcb/mu + +;;; Code: + +;; mu4e package +;(add-to-list 'load-path "~/local/emacs/site-lisp/mu4e") +(add-to-list 'load-path (expand-file-name "mu4e" prelude-personal-dir)) +(require 'mu4e) + +;; mu4e extensions +(prelude-require-packages '(evil-mu4e mu4e-maildirs-extension mu4e-alert)) +;; evil-mu4e +(require 'evil-mu4e) +;; mu4e-maildirs-extension +(require 'mu4e-maildirs-extension) +(mu4e-maildirs-extension) +;; mu4e-alert +(mu4e-alert-set-default-style 'libnotify) +(add-hook 'after-init-hook #'mu4e-alert-enable-notifications) +(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display) + + +;; turn on debug: log debug information to the *mu4e-log* buffer +(setq mu4e-debug t) + +(setq mu4e-maildir "~/mail") + +;; multiple email accounts: contexts (require mu4e >= 0.9.16) +(setq mu4e-contexts + `( ,(make-mu4e-context + :name "Outlook-aly" + :enter-func (lambda () + (mu4e-message "Switched to context: outlook-aly")) + ;; `leave-func' not defined + ;; `match-func' is invoked just before `mu4e-compose-pre-hook' + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches msg + :to "aaronly.me@outlook.com"))) + :vars '((user-mail-address . "aaronly.me@outlook.com") + (user-full-name . "Aaron LI") + (mu4e-sent-folder . "/outlook-aly/sent") + (mu4e-drafts-folder . "/outlook-aly/drafts") + (mu4e-trash-folder . "/outlook-aly/trash") + (mu4e-refile-folder . "/outlook-aly/archive") + (mu4e-compose-signature . "Aly") + (mu4e-sent-messages-behavior . delete))) + ,(make-mu4e-context + :name "Gmail-aly" + :enter-func (lambda () + (mu4e-message "Switched to context: gmail-aly")) + ;; `leave-func' not defined + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches msg + :to "aaronly.me@gmail.com"))) + :vars '((user-mail-address . "aaronly.me@gmail.com") + (user-full-name . "Aaron LI") + ;; special folders + (mu4e-sent-folder . "/sent") + (mu4e-drafts-folder . "/gmail-aly/drafts") + (mu4e-trash-folder . "/gmail-aly/trash") + (mu4e-refile-folder . "/gmail-aly/archive") + (mu4e-compose-signature . "Aly") + ;; do NOT save message to 'sent-folder' + (mu4e-sent-messages-behavior . delete))) + ,(make-mu4e-context + :name "outlook-li" + :enter-func (lambda () + (mu4e-message "Switched to context: outlook-li")) + ;; `leave-func' not defined + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches msg + :to '("liweitianux@live.com" + "liweitianux@outlook.com")))) + :vars '((user-mail-address . "liweitianux@live.com") + (user-full-name . "Weitian LI") + (mu4e-sent-folder . "/outlook-li/sent") + (mu4e-drafts-folder . "/outlook-li/drafts") + (mu4e-trash-folder . "/outlook-li/trash") + (mu4e-refile-folder . "/outlook-li/archive") + (mu4e-compose-signature . "Weitian LI") + (mu4e-sent-messages-behavior . delete))) + ,(make-mu4e-context + :name "gmail-li" + :enter-func (lambda () + (mu4e-message "Switched to context: gmail-li")) + ;; `leave-func' not defined + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches msg + :to "liweitianux@gmail.com"))) + :vars '((user-mail-address . "liweitianux@gmail.com") + (user-full-name . "Weitian LI") + (mu4e-sent-folder . "/sent") + (mu4e-drafts-folder . "/gmail-li/drafts") + (mu4e-trash-folder . "/gmail-li/trash") + (mu4e-refile-folder . "/gmail-li/archive") + (mu4e-compose-signature . "Weitian LI") + (mu4e-sent-messages-behavior . delete))) + ,(make-mu4e-context + :name "sjtu" + :enter-func (lambda () + (mu4e-message "Switched to context: sjtu")) + ;; `leave-func' not defined + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches msg + :to "liweitianux@sjtu.edu.cn"))) + :vars '((user-mail-address . "liweitianux@sjtu.edu.cn") + (user-full-name . "Weitian LI") + (mu4e-sent-folder . "/sjtu/sent") + (mu4e-drafts-folder . "/sjtu/drafts") + (mu4e-trash-folder . "/sjtu/trash") + (mu4e-refile-folder . "/sjtu/archive") + (mu4e-compose-signature . + (concat "Weitian LI\n" + "Department of Physics and Astronomy\n" + "Shanghai Jiao Tong University")) + ;; copy message to sent folder + (mu4e-sent-messages-behavior . sent))) + ,(make-mu4e-context + :name "autistici" + :enter-func (lambda () + (mu4e-message "Switched to context: autistici")) + ;; `leave-func' not defined + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches msg + :to "liweitianux@autistici.org"))) + :vars '((user-mail-address . "liweitianux@autistici.org") + (user-full-name . "Weitian LI") + (mu4e-sent-folder . "/autistici/sent") + (mu4e-drafts-folder . "/autistici/drafts") + (mu4e-trash-folder . "/autistici/trash") + (mu4e-refile-folder . "/autistici/archive") + (mu4e-compose-signature . "Weitian LI") + ;; copy message to sent folder + (mu4e-sent-messages-behavior . sent))) + ,(make-mu4e-context + :name "foxmail" + :enter-func (lambda () + (mu4e-message "Switched to context: foxmail")) + ;; `leave-func' not defined + :match-func (lambda (msg) + (when msg + (mu4e-message-contact-field-matches msg + :to '("liweitianux@foxmail.com" + "527922216@qq.com")))) + :vars '((user-mail-address . "liweitianux@foxmail.com") + (user-full-name . "Weitian LI") + (mu4e-sent-folder . "/foxmail/sent") + (mu4e-drafts-folder . "/foxmail/drafts") + (mu4e-trash-folder . "/foxmail/trash") + (mu4e-refile-folder . "/foxmail/archive") + (mu4e-compose-signature . "Weitian LI") + (mu4e-sent-messages-behavior . delete))))) + +;; start with the first (default) context +;; default: `ask-if-none' (ask when there's no context yet, and none match) +(setq mu4e-context-policy 'pick-first) +;; compose with the current context if no context matches +;; default: `ask' +(setq mu4e-compose-context-policy nil) + +;; auto construct addresses list by extracting addresses from contexts +(setq mu4e-user-mail-address-list + (delq nil + (mapcar (lambda (context) + (when (mu4e-context-vars context) + (cdr (assq 'user-mail-address + (mu4e-context-vars context))))) + mu4e-contexts))) + +;; send mail using `msmtp' +(setq message-send-mail-function 'message-send-mail-with-sendmail + message-sendmail-f-is-evil t + ;; choose the account according to the `From' header + message-sendmail-extra-arguments '("--read-envelope-from") + sendmail-program "msmtp") + +;; allow for fetch mail and update index using 'U' in the main view +(setq mu4e-get-mail-command "offlineimap -o -1") +;(setq mu4e-get-mail-command "true" nil nil +; "Disable fetching mail as it is done by a daemon") +;; get mail and update index periodically in the background (unit: seconds) +(setq mu4e-update-interval 900) + +;; frequent mail folders, with shortcuts +;; do not use shortcut `o' as it is used for `[o]ther' +(setq mu4e-maildir-shortcuts + '(("/important" . ?i) + ("/archive" . ?a) + ("/gmail-aly/archive" . ?G) + ("/gmail-li/archive" . ?g) + ("/outlook-aly/inbox" . ?l) + ("/outlook-li/inbox" . ?L) + ("/sjtu/inbox" . ?s))) + +;; do not keep message buffers around +(setq message-kill-buffer-on-exit t) + +;; enable inline images +(setq mu4e-view-show-images t) +;; use imagemagick if available +(when (fboundp 'imagemagick-register-types) + (imagemagick-register-types)) + +;; display rich-text messages +(require 'mu4e-contrib) +;; use `shr' html renderer; reqiure emacs >= 24.4 +(setq mu4e-html2text-command 'mu4e-shr2text) +(add-hook 'mu4e-view-mode-hook + (lambda () + ;; try to emulate some of the `eww' key-bindings + (local-set-key (kbd "") 'shr-next-link) + (local-set-key (kbd "") 'shr-previous-link))) +;; change the luminosity form dark theme +(setq shr-color-visible-luminance-min 70) + +;; customize bookmarks +(defvar mu4e-bookmarks + '(("flag:unread AND NOT flag:trashed" "Unread messages" ?u) + ("date:today..now" "Today's messages" ?t) + ("date:7d..now" "Last 7 days" ?w) + ("flag:flagged" "Flagged messages" ?f) + ("tag:astro" "Astro" ?a) + ("tag:arxiv" "arXiv" ?x) + ("mime:image/*" "Messages with images" ?p))) + +;; headers list appearance +(setq mu4e-headers-date-format "%Y-%m-%d %H:%M" + mu4e-headers-fields '((:date . 18) ;; also :human-date + (:flags . 5) + (:from-or-to . 22) + (:subject . nil))) ;; also :thread-subject + +;; use fancy non-ascii characters in various places +;(setq mu4e-use-fancy-chars t) + +;; show full addresses instead of just names when view message +(setq mu4e-view-show-addresses t) + +;; also include messages related to the searched messages +(setq mu4e-headers-include-related t) +;; exclude the duplicate messages with the same `Message-ID' +(setq mu4e-headers-skip-duplicates t) + +;; confirm before sending +(add-hook 'message-send-hook + (lambda () + (unless (yes-or-no-p "Sure you want to send this?") + (signal 'quit nil)))) + +;; apply "format=flowed" to outgoing messages, enabling receiving clients +;; that supports this feature to reflow the paragraphs. (from mu4e FAQ) +(add-hook 'mu4e-compose-mode-hook + (defun cpb-compose-setup () + "Outgoing mails get `format=flowed'." + (use-hard-newlines t 'guess))) + +;; custom actions +;; retag action +(setq mu4e-action-tags-header "X-Keywords") +(add-to-list 'mu4e-headers-actions + '("tRetag message" . mu4e-action-retag-message) t) +(add-to-list 'mu4e-view-actions + '("tRetag message" . mu4e-action-retag-message) t) +;; view in browser +(add-to-list 'mu4e-view-actions + '("bView in browser" . mu4e-action-view-in-browser) t) +;; search for messages by the sender of the opened message +(defun search-for-sender (msg) + "Search for messages sent by the sender of the message at point." + (mu4e-headers-search + (concat "from:" (cdar (mu4e-message-field msg :from))))) +(add-to-list 'mu4e-view-actions + '("xSearch for sender" . search-for-sender) t) + +;; set `mu4e' as emacs' default email program +(setq mail-user-agent 'mu4e-user-agent) diff --git a/_emacs.d/personal/config.el b/_emacs.d/personal/config.el deleted file mode 100644 index 440257f..0000000 --- a/_emacs.d/personal/config.el +++ /dev/null @@ -1,23 +0,0 @@ -;;; ~/.emacs.d/personal/config.el --- Custom configurations for Prelude -;; -;; -*- mode: emacs-lisp -*- -;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: -;; -;; Aaron LI -;; 2016-02-21 -;; - -;;; Commentary: -;; Custom configurations for Prelude Emacs kit. - -;;; Code: - -;; Disable `key-chord-mode' for `evil-mode' -;; (or just do not enable the `prelude-key-chord' module) -(key-chord-mode -1) - -;; Do NOT automatically clean whitespaces on save -;(setq prelude-clean-whitespace-on-save nil) - -;; Disable `flyspell-mode': do not spellcheck on the fly -;(setq prelude-flyspell nil) diff --git a/_emacs.d/personal/fcitx.el b/_emacs.d/personal/fcitx.el deleted file mode 100644 index 7448553..0000000 --- a/_emacs.d/personal/fcitx.el +++ /dev/null @@ -1,33 +0,0 @@ -;;; ~/.emacs.d/personal/fcitx.el --- Configurations for fcitx.el -;; -;; -*- mode: emacs-lisp -*- -;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: -;; -;; Aaron LI -;; 2016-02-22 -;; - -;;; Commentary: -;; Configurations for fcitx.el (https://github.com/cute-jumper/fcitx.el) - -;;; Code: - -;; fcitx.el: make fcitx better in Emacs. -(prelude-require-package 'fcitx) - -(require 'fcitx) - -;; disable fcitx by prefix keys -(fcitx-prefix-keys-setup) ;; default: `C-x' and `C-c' -(fcitx-prefix-keys-turn-on) - -;; evil support -(fcitx-evil-turn-on) - -;; disable fcitx when use `M-x' -(fcitx-M-x-turn-on) -;; disable fcitx when use `M-!' or `M-&' -(fcitx-shell-command-turn-on) -;; disable fcitx when use `M-:' -(fcitx-eval-expression-turn-on) - diff --git a/_emacs.d/personal/fonts.el b/_emacs.d/personal/fonts.el deleted file mode 100644 index d172a92..0000000 --- a/_emacs.d/personal/fonts.el +++ /dev/null @@ -1,45 +0,0 @@ -;;; ~/.emacs.d/personal/fonts.el --- Fonts configurations for Emacs. -;; -;; -*- mode: emacs-lisp -*- -;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: -;; -;; Credits: -;; [1] http://baohaojun.github.io/perfect-emacs-chinese-font.html -;; [2] http://zhuoqiang.me/a/torture-emacs -;; -;; Aaron LI -;; 2016-02-22 -;; - -;;; Commentary: -;; English and Chinese fonts configurations for Emacs. - -;;; Code: - -;; To increase the Unicode coverage of your favorite programming font -;; https://github.com/cpitclaudel/monospacifier -;(dolist (ft (fontset-list)) -; (set-fontset-font ft 'unicode -; (font-spec :name "Inconsolata")) -; (set-fontset-font ft 'unicode -; (font-spec :name "Symbola monospacified for Inconsolata") -; nil 'append)) - -;; English font -;; change the default font for the current frame, as well as future frames -;(set-face-attribute 'default nil :font "Terminus:pixelsize=16") -(set-face-attribute 'default nil :font "Inconsolata:pixelsize=14") - -;; Chinese font -;; available charset: kana han symbol cjk-misc bopomofo -;; font-spec: -;; `:size': either a non-negative integer that specifies the pixel size, -;; or a floating-point number that specifies the point size. -(dolist (charset '(kana han cjk-misc bopomofo)) - (set-fontset-font (frame-parameter nil 'font) - charset - (font-spec :family "WenQuanYi Zen Hei" :size 14))) -;; rescale chinese font to match: 1 Chinese = 2 English characters -;; (however, this will cause that the Chinese characters are higher) -;(setq face-font-rescale-alist '(("WenQuanYi Bitmap Song" . 1.2))) - diff --git a/_emacs.d/personal/latex.el b/_emacs.d/personal/latex.el deleted file mode 100644 index 4600c03..0000000 --- a/_emacs.d/personal/latex.el +++ /dev/null @@ -1,17 +0,0 @@ -;;; ~/.emacs.d/personal/latex.el --- LaTeX settings for Prelude Emacs -;; -;; -*- mode: emacs-lisp -*- -;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: -;; -;; Credits: https://github.com/bbatsov/prelude/wiki/LaTeX -;; -;; Aaron LI -;; 2016-02-21 -;; - -;;; Commentary: -;; LaTeX settings for Prelude Emacs. - -;;; Code: - -(setq-default TeX-engine 'xetex) diff --git a/_emacs.d/personal/mu4e.el b/_emacs.d/personal/mu4e.el deleted file mode 100644 index ad80acb..0000000 --- a/_emacs.d/personal/mu4e.el +++ /dev/null @@ -1,293 +0,0 @@ -;;; ~/.emacs.d/personal/mu4e.el --- mu4e (mu for Emacs) configurations -;; -;; -*- mode: emacs-lisp -*- -;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: -;; -;; Aaron LI -;; 2016-02-21 -;; - -;;; Commentary: -;; mu4e (mu for Emacs) configurations with some extensions. -;; mu (maildir indexer/searcher): https://github.com/djcb/mu - -;;; Code: - -;; mu4e package -;(add-to-list 'load-path "~/local/emacs/site-lisp/mu4e") -(add-to-list 'load-path (expand-file-name "mu4e" prelude-personal-dir)) -(require 'mu4e) - -;; mu4e extensions -(prelude-require-packages '(evil-mu4e mu4e-maildirs-extension mu4e-alert)) -;; evil-mu4e -(require 'evil-mu4e) -;; mu4e-maildirs-extension -(require 'mu4e-maildirs-extension) -(mu4e-maildirs-extension) -;; mu4e-alert -(mu4e-alert-set-default-style 'libnotify) -(add-hook 'after-init-hook #'mu4e-alert-enable-notifications) -(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display) - - -;; turn on debug: log debug information to the *mu4e-log* buffer -(setq mu4e-debug t) - -(setq mu4e-maildir "~/mail") - -;; multiple email accounts: contexts (require mu4e >= 0.9.16) -(setq mu4e-contexts - `( ,(make-mu4e-context - :name "Outlook-aly" - :enter-func (lambda () - (mu4e-message "Switched to context: outlook-aly")) - ;; `leave-func' not defined - ;; `match-func' is invoked just before `mu4e-compose-pre-hook' - :match-func (lambda (msg) - (when msg - (mu4e-message-contact-field-matches msg - :to "aaronly.me@outlook.com"))) - :vars '((user-mail-address . "aaronly.me@outlook.com") - (user-full-name . "Aaron LI") - (mu4e-sent-folder . "/outlook-aly/sent") - (mu4e-drafts-folder . "/outlook-aly/drafts") - (mu4e-trash-folder . "/outlook-aly/trash") - (mu4e-refile-folder . "/outlook-aly/archive") - (mu4e-compose-signature . "Aly") - (mu4e-sent-messages-behavior . delete))) - ,(make-mu4e-context - :name "Gmail-aly" - :enter-func (lambda () - (mu4e-message "Switched to context: gmail-aly")) - ;; `leave-func' not defined - :match-func (lambda (msg) - (when msg - (mu4e-message-contact-field-matches msg - :to "aaronly.me@gmail.com"))) - :vars '((user-mail-address . "aaronly.me@gmail.com") - (user-full-name . "Aaron LI") - ;; special folders - (mu4e-sent-folder . "/sent") - (mu4e-drafts-folder . "/gmail-aly/drafts") - (mu4e-trash-folder . "/gmail-aly/trash") - (mu4e-refile-folder . "/gmail-aly/archive") - (mu4e-compose-signature . "Aly") - ;; do NOT save message to 'sent-folder' - (mu4e-sent-messages-behavior . delete))) - ,(make-mu4e-context - :name "outlook-li" - :enter-func (lambda () - (mu4e-message "Switched to context: outlook-li")) - ;; `leave-func' not defined - :match-func (lambda (msg) - (when msg - (mu4e-message-contact-field-matches msg - :to '("liweitianux@live.com" - "liweitianux@outlook.com")))) - :vars '((user-mail-address . "liweitianux@live.com") - (user-full-name . "Weitian LI") - (mu4e-sent-folder . "/outlook-li/sent") - (mu4e-drafts-folder . "/outlook-li/drafts") - (mu4e-trash-folder . "/outlook-li/trash") - (mu4e-refile-folder . "/outlook-li/archive") - (mu4e-compose-signature . "Weitian LI") - (mu4e-sent-messages-behavior . delete))) - ,(make-mu4e-context - :name "gmail-li" - :enter-func (lambda () - (mu4e-message "Switched to context: gmail-li")) - ;; `leave-func' not defined - :match-func (lambda (msg) - (when msg - (mu4e-message-contact-field-matches msg - :to "liweitianux@gmail.com"))) - :vars '((user-mail-address . "liweitianux@gmail.com") - (user-full-name . "Weitian LI") - (mu4e-sent-folder . "/sent") - (mu4e-drafts-folder . "/gmail-li/drafts") - (mu4e-trash-folder . "/gmail-li/trash") - (mu4e-refile-folder . "/gmail-li/archive") - (mu4e-compose-signature . "Weitian LI") - (mu4e-sent-messages-behavior . delete))) - ,(make-mu4e-context - :name "sjtu" - :enter-func (lambda () - (mu4e-message "Switched to context: sjtu")) - ;; `leave-func' not defined - :match-func (lambda (msg) - (when msg - (mu4e-message-contact-field-matches msg - :to "liweitianux@sjtu.edu.cn"))) - :vars '((user-mail-address . "liweitianux@sjtu.edu.cn") - (user-full-name . "Weitian LI") - (mu4e-sent-folder . "/sjtu/sent") - (mu4e-drafts-folder . "/sjtu/drafts") - (mu4e-trash-folder . "/sjtu/trash") - (mu4e-refile-folder . "/sjtu/archive") - (mu4e-compose-signature . - (concat "Weitian LI\n" - "Department of Physics and Astronomy\n" - "Shanghai Jiao Tong University")) - ;; copy message to sent folder - (mu4e-sent-messages-behavior . sent))) - ,(make-mu4e-context - :name "autistici" - :enter-func (lambda () - (mu4e-message "Switched to context: autistici")) - ;; `leave-func' not defined - :match-func (lambda (msg) - (when msg - (mu4e-message-contact-field-matches msg - :to "liweitianux@autistici.org"))) - :vars '((user-mail-address . "liweitianux@autistici.org") - (user-full-name . "Weitian LI") - (mu4e-sent-folder . "/autistici/sent") - (mu4e-drafts-folder . "/autistici/drafts") - (mu4e-trash-folder . "/autistici/trash") - (mu4e-refile-folder . "/autistici/archive") - (mu4e-compose-signature . "Weitian LI") - ;; copy message to sent folder - (mu4e-sent-messages-behavior . sent))) - ,(make-mu4e-context - :name "foxmail" - :enter-func (lambda () - (mu4e-message "Switched to context: foxmail")) - ;; `leave-func' not defined - :match-func (lambda (msg) - (when msg - (mu4e-message-contact-field-matches msg - :to '("liweitianux@foxmail.com" - "527922216@qq.com")))) - :vars '((user-mail-address . "liweitianux@foxmail.com") - (user-full-name . "Weitian LI") - (mu4e-sent-folder . "/foxmail/sent") - (mu4e-drafts-folder . "/foxmail/drafts") - (mu4e-trash-folder . "/foxmail/trash") - (mu4e-refile-folder . "/foxmail/archive") - (mu4e-compose-signature . "Weitian LI") - (mu4e-sent-messages-behavior . delete))))) - -;; start with the first (default) context -;; default: `ask-if-none' (ask when there's no context yet, and none match) -(setq mu4e-context-policy 'pick-first) -;; compose with the current context if no context matches -;; default: `ask' -(setq mu4e-compose-context-policy nil) - -;; auto construct addresses list by extracting addresses from contexts -(setq mu4e-user-mail-address-list - (delq nil - (mapcar (lambda (context) - (when (mu4e-context-vars context) - (cdr (assq 'user-mail-address - (mu4e-context-vars context))))) - mu4e-contexts))) - -;; send mail using `msmtp' -(setq message-send-mail-function 'message-send-mail-with-sendmail - message-sendmail-f-is-evil t - ;; choose the account according to the `From' header - message-sendmail-extra-arguments '("--read-envelope-from") - sendmail-program "msmtp") - -;; allow for fetch mail and update index using 'U' in the main view -(setq mu4e-get-mail-command "offlineimap -o -1") -;(setq mu4e-get-mail-command "true" nil nil -; "Disable fetching mail as it is done by a daemon") -;; get mail and update index periodically in the background (unit: seconds) -(setq mu4e-update-interval 900) - -;; frequent mail folders, with shortcuts -;; do not use shortcut `o' as it is used for `[o]ther' -(setq mu4e-maildir-shortcuts - '(("/important" . ?i) - ("/archive" . ?a) - ("/gmail-aly/archive" . ?G) - ("/gmail-li/archive" . ?g) - ("/outlook-aly/inbox" . ?l) - ("/outlook-li/inbox" . ?L) - ("/sjtu/inbox" . ?s))) - -;; do not keep message buffers around -(setq message-kill-buffer-on-exit t) - -;; enable inline images -(setq mu4e-view-show-images t) -;; use imagemagick if available -(when (fboundp 'imagemagick-register-types) - (imagemagick-register-types)) - -;; display rich-text messages -(require 'mu4e-contrib) -;; use `shr' html renderer; reqiure emacs >= 24.4 -(setq mu4e-html2text-command 'mu4e-shr2text) -(add-hook 'mu4e-view-mode-hook - (lambda () - ;; try to emulate some of the `eww' key-bindings - (local-set-key (kbd "") 'shr-next-link) - (local-set-key (kbd "") 'shr-previous-link))) -;; change the luminosity form dark theme -(setq shr-color-visible-luminance-min 70) - -;; customize bookmarks -(defvar mu4e-bookmarks - '(("flag:unread AND NOT flag:trashed" "Unread messages" ?u) - ("date:today..now" "Today's messages" ?t) - ("date:7d..now" "Last 7 days" ?w) - ("flag:flagged" "Flagged messages" ?f) - ("tag:astro" "Astro" ?a) - ("tag:arxiv" "arXiv" ?x) - ("mime:image/*" "Messages with images" ?p))) - -;; headers list appearance -(setq mu4e-headers-date-format "%Y-%m-%d %H:%M" - mu4e-headers-fields '((:date . 18) ;; also :human-date - (:flags . 5) - (:from-or-to . 22) - (:subject . nil))) ;; also :thread-subject - -;; use fancy non-ascii characters in various places -;(setq mu4e-use-fancy-chars t) - -;; show full addresses instead of just names when view message -(setq mu4e-view-show-addresses t) - -;; also include messages related to the searched messages -(setq mu4e-headers-include-related t) -;; exclude the duplicate messages with the same `Message-ID' -(setq mu4e-headers-skip-duplicates t) - -;; confirm before sending -(add-hook 'message-send-hook - (lambda () - (unless (yes-or-no-p "Sure you want to send this?") - (signal 'quit nil)))) - -;; apply "format=flowed" to outgoing messages, enabling receiving clients -;; that supports this feature to reflow the paragraphs. (from mu4e FAQ) -(add-hook 'mu4e-compose-mode-hook - (defun cpb-compose-setup () - "Outgoing mails get `format=flowed'." - (use-hard-newlines t 'guess))) - -;; custom actions -;; retag action -(setq mu4e-action-tags-header "X-Keywords") -(add-to-list 'mu4e-headers-actions - '("tRetag message" . mu4e-action-retag-message) t) -(add-to-list 'mu4e-view-actions - '("tRetag message" . mu4e-action-retag-message) t) -;; view in browser -(add-to-list 'mu4e-view-actions - '("bView in browser" . mu4e-action-view-in-browser) t) -;; search for messages by the sender of the opened message -(defun search-for-sender (msg) - "Search for messages sent by the sender of the message at point." - (mu4e-headers-search - (concat "from:" (cdar (mu4e-message-field msg :from))))) -(add-to-list 'mu4e-view-actions - '("xSearch for sender" . search-for-sender) t) - -;; set `mu4e' as emacs' default email program -(setq mail-user-agent 'mu4e-user-agent) diff --git a/_emacs.d/personal/orgmode.el b/_emacs.d/personal/orgmode.el deleted file mode 100644 index 0d609e7..0000000 --- a/_emacs.d/personal/orgmode.el +++ /dev/null @@ -1,46 +0,0 @@ -;;; ~/.emacs.d/personal/orgmode.el --- Org-mode configurations -;; -;; -*- mode: emacs-lisp -*- -;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp: -;; -;; Credit: -;; [1] http://www.john2x.com/emacs.html -;; -;; Aaron LI -;; 2016-02-21 -;; - -;;; Commentary: -;; Org-mode configurations for Emacs - -;;; Code: - -(setq org-directory "~/org") -(setq org-todo-keywords - '((sequence "TODO" "DOING" "WAITING" "LATER" "|" "DONE" "DELEGATED"))) -;; default notes file for `org-capture' -(setq org-default-notes-file (concat org-directory "/notes.org")) -;; set custom `org-capture' templates -(setq org-capture-templates - '(("t" "Todo" entry (file+headline (concat org-directory "/todo.org") "Other") - "* TODO %?\n %i\n %a") - ("n" "Note" entry (file+datetree (concat org-directory "/notes.org")) - "* %?\nEntered on %U\n %i\n %a"))) -;; add custom `org-agenda' to show: -;; * agenda for the week -;; * things currently working on -;; * list of remaining TODO items -(setq org-agenda-custom-commands - '(("z" "Agenda and Tasks" - ((agenda "") - (todo "DOING") - (todo "TODO"))))) -;; enable font-locking for org source blocks -(setq org-src-fontify-natively t) -;; do not evaulate source blocks when exporting -(setq org-export-babel-evaluate nil) -;; -(global-set-key "\C-ca" 'org-agenda) -(global-set-key "\C-cb" 'org-iswitchb) -(global-set-key "\C-cc" 'org-capture) -(global-set-key "\C-cl" 'org-store-link) -- cgit v1.2.2