3 ;; y-or-n instead of yes-or-no
4 (defalias 'yes-or-no-p 'y-or-n-p)
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)
11 ;; turn OFF syntax highlighting
12 (global-font-lock-mode 0)
15 (setq-default cursor-type '(bar . 2))
18 (column-number-mode 1)
21 ;; (set-default-font "Inconsolata-12")
22 ;; (set-default-font "InconsolataGo-12")
24 (when (member "DejaVu Sans Mono" (font-family-list))
25 (set-face-attribute 'default nil :font "DejaVu Sans Mono-11"))
27 ;; Don't let Emacs hurt your ears
30 ;; This is bound to f11 in Emacs 24.4
31 ;; (toggle-frame-fullscreen)
33 ;; custom-set-variables was added by Custom.
34 ;; If you edit it by hand, you could mess it up, so be careful.
35 ;; Your init file should contain only one such instance.
36 ;; If there is more than one, they won't work right.
37 '(initial-frame-alist (quote ((fullscreen . maximized))))
38 '(send-mail-function (quote smtpmail-send-it)))
40 ;; Who use the bar to scroll?
41 (when (display-graphic-p)
49 ;; (load-theme 'tangotango t)
50 ;; (load-theme 'railscasts t)
51 ;; (load-theme 'leuven t)
56 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
59 (setq erc-autojoin-channels-alist
60 '((".*\\.freenode.net" "#tahoe-lafs")
61 (".*\\.oftc.net" "#debian-uk" "#debian-gnupg")
62 ;; (".*\\.mozilla.org" "#rust-beginners")
67 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
68 "324" "329" "332" "333" "353" "477"))
69 ;; don't show any of this
70 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
75 (when (y-or-n-p "Do you want to start IRC? ")
76 ;; (erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
77 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
78 (erc-tls :server "irc.debian.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
80 ;; switch to ERC with Ctrl+c e
81 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
84 (setq ido-enable-flex-matching t)
85 (setq ido-everywhere t)
88 ;; disable tabs for indentation
89 (setq-default indent-tabs-mode nil)
91 ;; (require 'whitespace)
92 ;; (setq whitespace-style '(face lines-tail))
93 ;; (setq whitespace-line-column 80)
94 ;; (global-whitespace-mode t)
96 ;; ;; show trailing whitespaces
97 ;; (setq-default show-trailing-whitespace t)
98 ;; (setq-default indicate-empty-lines t)
101 (setq c-default-style "k&r"
105 (add-hook 'haskell-mode-hook 'intero-mode)
108 (add-to-list 'load-path "~/.emacs.d/hs-lint")
110 (defun my-haskell-mode-hook ()
111 (local-set-key "\C-cl" 'hs-lint))
113 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
116 (add-hook 'before-save-hook #'gofmt-before-save)
117 (add-hook 'go-mode-hook (lambda ()
118 (local-set-key (kbd "C-c C-r")
119 'go-remove-unused-imports)))
120 (add-hook 'go-mode-hook (lambda ()
121 (local-set-key (kbd "C-c i")
125 (add-to-list 'load-path "~/.emacs.d/asp-mode")
126 (autoload 'asp-mode "asp-mode")
127 (setq auto-mode-alist
128 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
131 (global-linum-mode t)
132 (global-hl-line-mode 0)
134 ;; fci -- fill-column-indicator
135 (setq fci-rule-column 81)
136 (setq fci-rule-width 1)
137 (setq fci-rule-color "darkblue")
139 ;; turn off electric-indent-mode
140 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
143 (setq mail-user-agent 'message-user-agent)
144 (setq user-mail-address "ram@rkrishnan.org"
145 user-full-name "Ramakrishnan Muthukrishnan")
148 (setq smtpmail-stream-type 'ssl
149 smtpmail-smtp-server "mail.messagingengine.com"
150 smtpmail-smtp-service 465)
153 (require 'notmuch-address)
154 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
155 ;;(notmuch-address-message-insinuate)
158 (setq message-send-mail-function 'smtpmail-send-it)
162 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
165 ;; custom-set-faces was added by Custom.
166 ;; If you edit it by hand, you could mess it up, so be careful.
167 ;; Your init file should contain only one such instance.
168 ;; If there is more than one, they won't work right.
171 ;; company mode for auto completion
172 (add-hook 'after-init-hook 'global-company-mode)
174 ;; Reduce the time after which the company auto completion popup opens
175 (setq company-idle-delay 0.2)
177 ;; Reduce the number of characters before company kicks in
178 (setq company-minimum-prefix-length 1)
180 ;; Set path to racer binary
181 (setq racer-cmd "/home/ram/.cargo/bin/racer")
183 (add-hook 'rust-mode-hook
186 (racer-turn-on-eldoc)
187 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
188 (set (make-local-variable 'company-backends) '(company-racer))
189 (local-set-key (kbd "M-.") #'racer-find-definition)
190 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
193 ;; (add-hook 'prog-mode-hook 'highlight-todos)
196 (setq ledger-binary-path "~/.cabal/bin/hledger")
199 (setq exec-path (cons "/usr/local/go/bin" exec-path))
200 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
202 (defun go-mode-setup ()
204 (setq gofmt-command "goimports")
205 (add-hook 'before-save-hook 'gofmt-before-save))
207 (add-hook 'go-mode-hook 'go-mode-setup)
209 ;; alias man to w.o.man
210 (defalias 'man 'woman)
213 (defun eshell/emacs (&rest args)
214 "open a file in emacs"
217 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
219 ;(desktop-save-mode 1)
223 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
226 (add-hook 'after-init-hook #'global-flycheck-mode)