3 ;; y-or-n instead of yes-or-no
4 (defalias 'yes-or-no-p 'y-or-n-p)
7 (require 'color-theme-sanityinc-tomorrow)
9 ;; Don't show startup msg, don't store tilde files
10 (setq make-backup-files nil)
11 (setq initial-scratch-message "")
12 (setq inhibit-startup-message t)
14 ;; turn OFF syntax highlighting
15 ; (global-font-lock-mode 0)
18 (setq-default cursor-type '(bar . 2))
21 (column-number-mode 1)
24 ;; (set-default-font "Inconsolata-12")
25 ;; (set-default-font "InconsolataGo-12")
27 (when (member "DejaVu Sans Mono" (font-family-list))
28 (set-face-attribute 'default nil :font "DejaVu Sans Mono-11"))
30 ;; Don't let Emacs hurt your ears
33 ;; This is bound to f11 in Emacs 24.4
34 ;; (toggle-frame-fullscreen)
36 ;; custom-set-variables was added by Custom.
37 ;; If you edit it by hand, you could mess it up, so be careful.
38 ;; Your init file should contain only one such instance.
39 ;; If there is more than one, they won't work right.
40 '(initial-frame-alist (quote ((fullscreen . maximized))))
43 ((sequence "TODO(t)" "INPROGRESS(p)" "WAIT(w)" "|" "DONE(d)" "CANCELLED(c)" "REVISIT(r)"))))
44 '(send-mail-function (quote smtpmail-send-it)))
46 (setq org-agenda-files '("~/notes/"))
48 ;; Who use the bar to scroll?
49 (when (display-graphic-p)
57 ;; (load-theme 'tangotango t)
58 ;; (load-theme 'railscasts t)
59 ;; (load-theme 'leuven t)
64 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
67 (setq erc-autojoin-channels-alist
68 '((".*\\.freenode.net" "#hackage" "#tahoe-lafs")
69 (".*\\.oftc.net" "#debian-uk" "#debian-in")
70 ;; (".*\\.mozilla.org" "#rust-beginners")
75 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
76 "324" "329" "332" "333" "353" "477"))
77 ;; don't show any of this
78 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
83 (when (y-or-n-p "Do you want to start IRC? ")
84 ;; (erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
85 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
86 (erc-tls :server "irc.debian.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
88 ;; switch to ERC with Ctrl+c e
89 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
92 (setq ido-enable-flex-matching t)
93 (setq ido-everywhere t)
96 ;; disable tabs for indentation
97 (setq-default indent-tabs-mode nil)
99 ;; (require 'whitespace)
100 ;; (setq whitespace-style '(face lines-tail))
101 ;; (setq whitespace-line-column 80)
102 ;; (global-whitespace-mode t)
104 ;; ;; show trailing whitespaces
105 ;; (setq-default show-trailing-whitespace t)
106 ;; (setq-default indicate-empty-lines t)
109 (setq c-default-style "k&r"
113 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
114 (add-to-list 'exec-path "~/.cabal/bin")
115 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
118 (require 'haskell-process)
119 (require 'haskell-interactive-mode)
120 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
122 (custom-set-variables
123 '(haskell-process-suggest-remove-import-lines t)
124 '(haskell-process-auto-import-loaded-modules t)
125 '(haskell-process-log t))
127 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
128 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
129 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
130 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
131 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
132 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
133 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
136 ;;(autoload 'ghc-init "ghc" nil t)
137 ;;(autoload 'ghc-debug "ghc" nil t)
139 ;;(add-hook 'haskell-mode-hook (lambda () (ghc-init)))
142 (add-to-list 'load-path "~/.emacs.d/hs-lint")
144 (defun my-haskell-mode-hook ()
145 (local-set-key "\C-cl" 'hs-lint))
147 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
150 (add-hook 'haskell-mode-hook #'hindent-mode)
153 (add-hook 'before-save-hook #'gofmt-before-save)
154 (add-hook 'go-mode-hook (lambda ()
155 (local-set-key (kbd "C-c C-r")
156 'go-remove-unused-imports)))
157 (add-hook 'go-mode-hook (lambda ()
158 (local-set-key (kbd "C-c i")
162 (add-to-list 'load-path "~/.emacs.d/asp-mode")
163 (autoload 'asp-mode "asp-mode")
164 (setq auto-mode-alist
165 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
168 (global-linum-mode t)
169 (global-hl-line-mode 0)
171 ;; fci -- fill-column-indicator
172 (setq fci-rule-column 81)
173 (setq fci-rule-width 1)
174 (setq fci-rule-color "darkblue")
176 ;; turn off electric-indent-mode
177 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
180 (setq mail-user-agent 'message-user-agent)
181 (setq user-mail-address "ram@rkrishnan.org"
182 user-full-name "Ramakrishnan Muthukrishnan")
185 (setq smtpmail-stream-type 'ssl
186 smtpmail-smtp-server "mail.messagingengine.com"
187 smtpmail-smtp-service 465)
190 (require 'notmuch-address)
191 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
192 ;;(notmuch-address-message-insinuate)
195 (setq message-send-mail-function 'smtpmail-send-it)
199 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
202 ;; custom-set-faces was added by Custom.
203 ;; If you edit it by hand, you could mess it up, so be careful.
204 ;; Your init file should contain only one such instance.
205 ;; If there is more than one, they won't work right.
208 ;; company mode for auto completion
209 (add-hook 'after-init-hook 'global-company-mode)
211 ;; Reduce the time after which the company auto completion popup opens
212 (setq company-idle-delay 0.2)
214 ;; Reduce the number of characters before company kicks in
215 (setq company-minimum-prefix-length 1)
217 ;; Set path to racer binary
218 (setq racer-cmd "/home/ram/.cargo/bin/racer")
220 (add-hook 'rust-mode-hook
223 (racer-turn-on-eldoc)
224 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
225 (set (make-local-variable 'company-backends) '(company-racer))
226 (local-set-key (kbd "M-.") #'racer-find-definition)
227 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
230 ;; (add-hook 'prog-mode-hook 'highlight-todos)
233 (setq ledger-binary-path "~/.cabal/bin/hledger")
236 (setq exec-path (cons "/usr/local/go/bin" exec-path))
237 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
239 (defun go-mode-setup ()
241 (setq gofmt-command "goimports")
242 (add-hook 'before-save-hook 'gofmt-before-save))
244 (add-hook 'go-mode-hook 'go-mode-setup)
246 ;; alias man to w.o.man
247 (defalias 'man 'woman)
250 (defun eshell/emacs (&rest args)
251 "open a file in emacs"
254 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
256 ;(desktop-save-mode 1)
260 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
263 (add-hook 'after-init-hook #'global-flycheck-mode)