]> git.rkrishnan.org Git - .emacs.d.git/blob - init.el
disable syntax highlighting, other misc changes
[.emacs.d.git] / init.el
1 (package-initialize)
2 (show-paren-mode 1)
3 ;; y-or-n instead of yes-or-no
4 (defalias 'yes-or-no-p 'y-or-n-p)
5
6 ;; Don't show startup msg, don't store tilde files
7 (setq make-backup-files nil)
8 (setq initial-scratch-message "")
9 (setq inhibit-startup-message t)
10
11 ;; turn OFF syntax highlighting
12 (global-font-lock-mode 0)
13
14 ;; cursor bar
15 (setq-default cursor-type '(bar . 2))
16
17 ;; column number
18 (column-number-mode 1)
19
20 ;; font
21 ;; (set-default-font "Inconsolata-12")
22
23 ;; Don't let Emacs hurt your ears
24 (setq visible-bell t)
25
26 ;; This is bound to f11 in Emacs 24.4
27 ;; (toggle-frame-fullscreen)
28 (custom-set-variables
29  ;; custom-set-variables was added by Custom.
30  ;; If you edit it by hand, you could mess it up, so be careful.
31  ;; Your init file should contain only one such instance.
32  ;; If there is more than one, they won't work right.
33  '(initial-frame-alist (quote ((fullscreen . maximized))))
34  '(send-mail-function (quote smtpmail-send-it)))
35
36 ;; Who use the bar to scroll?
37 (when (display-graphic-p)
38   (progn
39     (scroll-bar-mode 0)
40
41     (tool-bar-mode 0)
42     (menu-bar-mode 0)))
43
44 ;; tangotango
45 ;; (load-theme 'tangotango t)
46 ;; (load-theme 'railscasts t)
47 ;; (load-theme 'leuven t)
48
49 ;; erc
50 (require 'erc)
51 (require 'tls)
52 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
53
54 (erc-autojoin-mode t)
55 (setq erc-autojoin-channels-alist
56   '((".*\\.freenode.net" "#tahoe-lafs") ;; #inferno "#plan9chan" "#cat-v")
57     (".*\\.oftc.net" "#LeastAuthority")))
58
59 ;; check channels
60 (erc-track-mode t)
61 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
62                                  "324" "329" "332" "333" "353" "477"))
63 ;; don't show any of this
64 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
65
66 (defun start-erc ()
67   "Connect to IRC."
68   (interactive)
69   (when (y-or-n-p "Do you want to start IRC? ")
70     ;;(erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
71     (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
72     (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
73
74 ;; switch to ERC with Ctrl+c e
75 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
76
77 ;; haskell mode
78 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
79 (add-to-list 'exec-path "~/.cabal/bin")
80 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
81
82 ;; haskell mode
83 (require 'haskell-process)
84 (require 'haskell-interactive-mode)
85 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
86
87 (custom-set-variables
88   '(haskell-process-suggest-remove-import-lines t)
89   '(haskell-process-auto-import-loaded-modules t)
90   '(haskell-process-log t)
91   '(haskell-process-type 'stack-ghci))
92
93 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
94 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
95 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
96 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
97 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
98 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
99 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
100 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)
101
102 ;; ghc-mod
103 (autoload 'ghc-init "ghc" nil t)
104 (autoload 'ghc-debug "ghc" nil t)
105 (setq ghc-debug t)
106 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
107
108 ;; ido
109 (setq ido-enable-flex-matching t)
110 (setq ido-everywhere t)
111 (ido-mode 1)
112
113 ;; disable tabs for indentation
114 (setq-default indent-tabs-mode nil)
115
116 ;; (require 'whitespace)
117 ;; (setq whitespace-style '(face lines-tail))
118 ;; (setq whitespace-line-column 80)
119 ;; (global-whitespace-mode t)
120
121 ;; ;; show trailing whitespaces
122 ;; (setq-default show-trailing-whitespace t)
123 ;; (setq-default indicate-empty-lines t)
124
125 ;; C style
126 (setq c-default-style "k&r"
127       c-basic-offset 4)
128
129 ;; hlint
130 (add-to-list 'load-path "~/.emacs.d/hs-lint")
131 (require 'hs-lint)
132 (defun my-haskell-mode-hook ()
133    (local-set-key "\C-cl" 'hs-lint))
134 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
135
136 ;; gofmt
137 (add-hook 'before-save-hook #'gofmt-before-save)
138 (add-hook 'go-mode-hook (lambda ()
139                           (local-set-key (kbd "C-c C-r")
140                                          'go-remove-unused-imports)))
141 (add-hook 'go-mode-hook (lambda ()
142                           (local-set-key (kbd "C-c i")
143                                          'go-goto-imports)))
144
145 ;; asp
146 (add-to-list 'load-path "~/.emacs.d/asp-mode")
147 (autoload 'asp-mode "asp-mode")
148 (setq auto-mode-alist
149       (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
150
151 ;; line-number-mode
152 (global-linum-mode t)
153 (global-hl-line-mode 0)
154
155 ;; fci -- fill-column-indicator
156 (setq fci-rule-column 81)
157 (setq fci-rule-width 1)
158 (setq fci-rule-color "darkblue")
159
160 ;; turn off electric-indent-mode
161 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
162
163 ;; notmuch
164 (setq mail-user-agent 'message-user-agent)
165 (setq user-mail-address "ram@rkrishnan.org"
166       user-full-name "Ramakrishnan Muthukrishnan")
167
168 ;; smtp
169 (setq smtpmail-stream-type 'ssl
170       smtpmail-smtp-server "mail.messagingengine.com"
171       smtpmail-smtp-service 465)
172
173 ;; addressbook
174 (require 'notmuch-address)
175 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
176 ;;(notmuch-address-message-insinuate)
177
178 (require 'smtpmail)
179 (setq message-send-mail-function 'smtpmail-send-it)
180 (require 'starttls)
181
182 ;; sign all emails
183 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
184
185 (custom-set-faces
186  ;; custom-set-faces was added by Custom.
187  ;; If you edit it by hand, you could mess it up, so be careful.
188  ;; Your init file should contain only one such instance.
189  ;; If there is more than one, they won't work right.
190  )
191
192 ;; company mode for auto completion
193 (add-hook 'after-init-hook 'global-company-mode)
194
195 ;; highlight todo
196 ;; (add-hook 'prog-mode-hook 'highlight-todos)
197
198 ;; Ledger
199 (setq ledger-binary-path "~/.cabal/bin/hledger")
200
201 ;; golang
202 (setq exec-path (cons "/usr/local/go/bin" exec-path))
203 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
204
205 (defun go-mode-setup ()
206   (go-eldoc-setup)
207   (setq gofmt-command "goimports")
208   (add-hook 'before-save-hook 'gofmt-before-save))
209
210 (add-hook 'go-mode-hook 'go-mode-setup)
211
212 ;; alias man to w.o.man
213 (defalias 'man 'woman)
214
215 ;; eshell aliases
216 (defun eshell/emacs (&rest args)
217   "open a file in emacs"
218   (if (null args)
219       (bury-buffer)
220     (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
221
222 ;(desktop-save-mode 1)
223
224 ;; which function?
225 (which-func-mode 1)
226 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
227
228 ;; flysheck
229 (add-hook 'after-init-hook #'global-flycheck-mode)
230
231 ;; coq proof general
232 (load-file "~/.emacs.d/ProofGeneral/generic/proof-site.el") 
233