summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <meyerkya@gmail.com>2013-01-11 11:36:05 -0500
committerKyle Meyer <meyerkya@gmail.com>2013-01-11 17:15:13 -0500
commitd681d6f132665848fac84494fb801719f5fa4013 (patch)
tree98a8311b678deed72748e66b5328484050f9c159
parent89f8a408e3176961d76370a65f7d12f1f0e7bba2 (diff)
downloademacs.d-d681d6f132665848fac84494fb801719f5fa4013.tar.gz
hook for using emacsclient with mutt
-rw-r--r--conf/km-evil.el3
-rw-r--r--conf/km-mail.el15
-rw-r--r--init.el1
3 files changed, 19 insertions, 0 deletions
diff --git a/conf/km-evil.el b/conf/km-evil.el
index d6e0ab8..677b55a 100644
--- a/conf/km-evil.el
+++ b/conf/km-evil.el
@@ -29,6 +29,9 @@
(evil-define-key 'visual lisp-interaction-mode-map
",e" 'eval-region)
+(evil-define-key 'normal mail-mode-map ",q" 'server-edit)
+(evil-define-key 'normal mail-mode-map ",d" 'server-edit)
+
(define-key evil-visual-state-map ",c" 'comment-or-uncomment-region)
(fset 'comment-this-line ;; this depends on evil bindings
"0v$,c")
diff --git a/conf/km-mail.el b/conf/km-mail.el
new file mode 100644
index 0000000..7a48417
--- /dev/null
+++ b/conf/km-mail.el
@@ -0,0 +1,15 @@
+(add-to-list 'auto-mode-alist '("/mutt" . mail-mode))
+
+(defun km/mail-position ()
+ "Move cursor to first blank line
+and position cursor between two blank lines"
+ (interactive)
+ (forward-paragraph)
+ (insert "\n\n")
+ (previous-line))
+
+(defun km/mail-mode-hook ()
+ (auto-fill-mode 1)
+ (km/mail-position))
+
+(add-hook 'mail-mode-hook 'km/mail-mode-hook)
diff --git a/init.el b/init.el
index cf2cfe2..338589e 100644
--- a/init.el
+++ b/init.el
@@ -12,6 +12,7 @@
(load "km-evil.el")
(load "km-ibuffer.el")
(load "km-ido.el")
+(load "km-mail.el")
(load "km-python.el")
(load "km-haskell.el")
(load "km-tex.el")