]> git.rkrishnan.org Git - .emacs.d.git/blob - init.el
remove toolbar and menubar
[.emacs.d.git] / init.el
1 (tool-bar-mode 0)
2 (menu-bar-mode 0)
3
4 (setq load-path (cons "~/.emacs.d/emacs" load-path))
5
6 ;; color themes
7 (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
8 ;(load-theme 'zenburn t)
9
10 (require 'package)
11 (add-to-list 'package-archives 
12     '("marmalade" .
13       "http://marmalade-repo.org/packages/"))
14 (package-initialize)
15
16 (load "my-c-mode.el")
17 (load "my-generic-stuff.el")
18 (load "my-search.el")
19 (load "my-erc.el")
20 ;; (load "my-org-mode.el")
21 ;; (load "my-slime.el")
22 ;; (load "my-twitter.el")
23 ;; (load "my-python.el")
24 ;; (load "my-haskell.el")
25 ;; (load "my-swank-js.el")
26
27 (defun match-paren (arg)
28   "Go to the matching paren if on a paren; otherwise insert %."
29   (interactive "p")
30   (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
31         ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
32         (t (self-insert-command (or arg 1)))))
33
34 ;; highlight parentheses mode
35 (require 'highlight-parentheses)
36
37
38 ;; paredit
39 (autoload 'paredit-mode "paredit"
40   "Minor mode for pseudo-structurally editing Lisp code." t)
41
42 (dolist (hook '(emacs-lisp-mode-hook
43                 lisp-mode-hook
44                 lisp-interaction-mode-hook
45                 clojure-mode-hook
46                 scheme-mode-hook))
47   (add-hook hook #'(lambda ()
48                      (highlight-parentheses-mode t)
49                      (paredit-mode +1))))
50
51 ;; flyspell
52 (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
53
54 ;; handle trailing whitespaces
55 ;(add-hook 'before-save-hook 'delete-trailing-whitespace)
56
57 ;; update copyright years before saving.
58 ;(add-hook 'before-save-hook 'copyright-update)
59
60 ;; sending email
61 (setq message-send-mail-function 'message-send-mail-with-sendmail
62       mail-specify-envelope-from t      ; Settings to work with msmtp
63       message-sendmail-f-is-evil nil  
64       mail-envelope-from 'header
65       message-sendmail-envelope-from 'header
66       sendmail-program "/usr/bin/msmtp"
67       user-full-name "Ramakrishnan Muthukrishnan")
68
69 (setq message-kill-buffer-on-exit t) ; kill buffer after sending mail)
70
71 ;; notmuch
72 (setq gnus-inhibit-images nil)
73 (add-to-list 'load-path "~/.emacs.d/emacs/notmuch")
74 (setq notmuch-command "~/bin/remote-notmuch.sh")
75 (require 'notmuch)
76 (when (memq window-system '(mac ns))
77   (exec-path-from-shell-initialize)
78   (setq starttls-use-gnutls t)
79   (setq starttls-gnutls-program "gnutls-cli")
80   (setq starttls-extra-arguments nil)
81   )
82 (setq smtpmail-starttls-credentials '(("rkrishnan.org" 587 nil nil))
83       smtpmail-auth-credentials (expand-file-name "~/.authinfo")
84       smtpmail-default-smtp-server "rkrishnan.org"
85       smtpmail-smtp-server "rkrishnan.org"
86       smtpmail-smtp-service 587)
87
88 (setq notmuch-fcc-dirs nil)
89 (add-hook 'message-header-setup-hook
90     (lambda () (insert (format "Bcc: %s <%s>\n"
91                 (notmuch-user-name)
92                 (notmuch-user-primary-email)))))
93
94 ;; addressbook
95 (require 'notmuch-address)
96 (setq notmuch-address-command "~/bin/addrlookup")
97 (notmuch-address-message-insinuate)
98
99 (require 'smtpmail)
100 (setq message-send-mail-function 'smtpmail-send-it)
101 (require 'starttls)
102
103 ;; sign all emails
104 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
105
106 (set-default-font "Inconsolata-11")
107
108 ;; spell check
109 (setq ispell-program-name "aspell"
110   ispell-extra-args '("--sug-mode=ultra"))
111
112 (setq ispell-list-command "--list")
113
114 (dolist (hook '(text-mode-hook))
115   (add-hook hook (lambda () (flyspell-mode 1))))
116 (dolist (hook '(change-log-mode-hook log-edit-mode-hook))
117   (add-hook hook (lambda () (flyspell-mode -1))))
118
119 ;; new wonderful theme monokai
120 (load-theme 'monokai t)
121