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 ;; Don't let Emacs hurt your ears
27 ;; This is bound to f11 in Emacs 24.4
28 ;; (toggle-frame-fullscreen)
30 ;; custom-set-variables was added by Custom.
31 ;; If you edit it by hand, you could mess it up, so be careful.
32 ;; Your init file should contain only one such instance.
33 ;; If there is more than one, they won't work right.
34 '(initial-frame-alist (quote ((fullscreen . maximized))))
35 '(send-mail-function (quote smtpmail-send-it)))
37 ;; Who use the bar to scroll?
38 (when (display-graphic-p)
46 ;; (load-theme 'tangotango t)
47 ;; (load-theme 'railscasts t)
48 ;; (load-theme 'leuven t)
53 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
56 (setq erc-autojoin-channels-alist
57 '((".*\\.freenode.net" "#tahoe-lafs")
58 (".*\\.oftc.net" "#LeastAuthority")
59 ;; (".*\\.mozilla.org" "#rust-beginners")
64 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
65 "324" "329" "332" "333" "353" "477"))
66 ;; don't show any of this
67 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
72 (when (y-or-n-p "Do you want to start IRC? ")
73 ;; (erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
74 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
75 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
77 ;; switch to ERC with Ctrl+c e
78 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
81 (setq ido-enable-flex-matching t)
82 (setq ido-everywhere t)
85 ;; disable tabs for indentation
86 (setq-default indent-tabs-mode nil)
88 ;; (require 'whitespace)
89 ;; (setq whitespace-style '(face lines-tail))
90 ;; (setq whitespace-line-column 80)
91 ;; (global-whitespace-mode t)
93 ;; ;; show trailing whitespaces
94 ;; (setq-default show-trailing-whitespace t)
95 ;; (setq-default indicate-empty-lines t)
98 (setq c-default-style "k&r"
102 (add-hook 'haskell-mode-hook #'hindent-mode)
104 (eval-after-load 'haskell-mode
105 '(define-key haskell-mode-map [f8] 'haskell-navigate-imports))
108 (let ((my-cabal-path (expand-file-name "~/.cabal/bin")))
109 (setenv "PATH" (concat my-cabal-path ":" (getenv "PATH")))
110 (add-to-list 'exec-path my-cabal-path))
112 (autoload 'ghc-init "ghc" nil t)
113 (autoload 'ghc-debug "ghc" nil t)
114 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
117 (add-to-list 'load-path "~/.emacs.d/hs-lint")
119 (defun my-haskell-mode-hook ()
120 (local-set-key "\C-cl" 'hs-lint))
122 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
125 (add-hook 'before-save-hook #'gofmt-before-save)
126 (add-hook 'go-mode-hook (lambda ()
127 (local-set-key (kbd "C-c C-r")
128 'go-remove-unused-imports)))
129 (add-hook 'go-mode-hook (lambda ()
130 (local-set-key (kbd "C-c i")
134 (add-to-list 'load-path "~/.emacs.d/asp-mode")
135 (autoload 'asp-mode "asp-mode")
136 (setq auto-mode-alist
137 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
140 (global-linum-mode t)
141 (global-hl-line-mode 0)
143 ;; fci -- fill-column-indicator
144 (setq fci-rule-column 81)
145 (setq fci-rule-width 1)
146 (setq fci-rule-color "darkblue")
148 ;; turn off electric-indent-mode
149 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
152 (setq mail-user-agent 'message-user-agent)
153 (setq user-mail-address "ram@rkrishnan.org"
154 user-full-name "Ramakrishnan Muthukrishnan")
157 (setq smtpmail-stream-type 'ssl
158 smtpmail-smtp-server "mail.messagingengine.com"
159 smtpmail-smtp-service 465)
162 (require 'notmuch-address)
163 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
164 ;;(notmuch-address-message-insinuate)
167 (setq message-send-mail-function 'smtpmail-send-it)
171 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
174 ;; custom-set-faces was added by Custom.
175 ;; If you edit it by hand, you could mess it up, so be careful.
176 ;; Your init file should contain only one such instance.
177 ;; If there is more than one, they won't work right.
180 ;; company mode for auto completion
181 (add-hook 'after-init-hook 'global-company-mode)
183 ;; Reduce the time after which the company auto completion popup opens
184 (setq company-idle-delay 0.2)
186 ;; Reduce the number of characters before company kicks in
187 (setq company-minimum-prefix-length 1)
189 ;; Set path to racer binary
190 (setq racer-cmd "/home/ram/.cargo/bin/racer")
192 (add-hook 'rust-mode-hook
195 (racer-turn-on-eldoc)
196 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
197 (set (make-local-variable 'company-backends) '(company-racer))
198 (local-set-key (kbd "M-.") #'racer-find-definition)
199 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
202 ;; (add-hook 'prog-mode-hook 'highlight-todos)
205 (setq ledger-binary-path "~/.cabal/bin/hledger")
208 (setq exec-path (cons "/usr/local/go/bin" exec-path))
209 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
211 (defun go-mode-setup ()
213 (setq gofmt-command "goimports")
214 (add-hook 'before-save-hook 'gofmt-before-save))
216 (add-hook 'go-mode-hook 'go-mode-setup)
218 ;; alias man to w.o.man
219 (defalias 'man 'woman)
222 (defun eshell/emacs (&rest args)
223 "open a file in emacs"
226 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
228 ;(desktop-save-mode 1)
232 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
235 ;; (add-hook 'after-init-hook #'global-flycheck-mode)