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" "#tahoe-lafs")
69 (".*\\.oftc.net" "#debian-uk" "#debian-gnupg")
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 ;; (add-hook 'haskell-mode-hook 'intero-mode)
116 (add-to-list 'load-path "~/.emacs.d/hs-lint")
118 (defun my-haskell-mode-hook ()
119 (local-set-key "\C-cl" 'hs-lint))
121 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
124 (add-hook 'before-save-hook #'gofmt-before-save)
125 (add-hook 'go-mode-hook (lambda ()
126 (local-set-key (kbd "C-c C-r")
127 'go-remove-unused-imports)))
128 (add-hook 'go-mode-hook (lambda ()
129 (local-set-key (kbd "C-c i")
133 (add-to-list 'load-path "~/.emacs.d/asp-mode")
134 (autoload 'asp-mode "asp-mode")
135 (setq auto-mode-alist
136 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
139 (global-linum-mode t)
140 (global-hl-line-mode 0)
142 ;; fci -- fill-column-indicator
143 (setq fci-rule-column 81)
144 (setq fci-rule-width 1)
145 (setq fci-rule-color "darkblue")
147 ;; turn off electric-indent-mode
148 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
151 (setq mail-user-agent 'message-user-agent)
152 (setq user-mail-address "ram@rkrishnan.org"
153 user-full-name "Ramakrishnan Muthukrishnan")
156 (setq smtpmail-stream-type 'ssl
157 smtpmail-smtp-server "mail.messagingengine.com"
158 smtpmail-smtp-service 465)
161 (require 'notmuch-address)
162 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
163 ;;(notmuch-address-message-insinuate)
166 (setq message-send-mail-function 'smtpmail-send-it)
170 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
173 ;; custom-set-faces was added by Custom.
174 ;; If you edit it by hand, you could mess it up, so be careful.
175 ;; Your init file should contain only one such instance.
176 ;; If there is more than one, they won't work right.
179 ;; company mode for auto completion
180 (add-hook 'after-init-hook 'global-company-mode)
182 ;; Reduce the time after which the company auto completion popup opens
183 (setq company-idle-delay 0.2)
185 ;; Reduce the number of characters before company kicks in
186 (setq company-minimum-prefix-length 1)
188 ;; Set path to racer binary
189 (setq racer-cmd "/home/ram/.cargo/bin/racer")
191 (add-hook 'rust-mode-hook
194 (racer-turn-on-eldoc)
195 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
196 (set (make-local-variable 'company-backends) '(company-racer))
197 (local-set-key (kbd "M-.") #'racer-find-definition)
198 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
201 ;; (add-hook 'prog-mode-hook 'highlight-todos)
204 (setq ledger-binary-path "~/.cabal/bin/hledger")
207 (setq exec-path (cons "/usr/local/go/bin" exec-path))
208 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
210 (defun go-mode-setup ()
212 (setq gofmt-command "goimports")
213 (add-hook 'before-save-hook 'gofmt-before-save))
215 (add-hook 'go-mode-hook 'go-mode-setup)
217 ;; alias man to w.o.man
218 (defalias 'man 'woman)
221 (defun eshell/emacs (&rest args)
222 "open a file in emacs"
225 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
227 ;(desktop-save-mode 1)
231 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
234 (add-hook 'after-init-hook #'global-flycheck-mode)