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 (setq initial-frame-alist (quote ((fullscreen . maximized))))
12 (setq send-mail-function (quote smtpmail-send-it))
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 ;; Who use the bar to scroll?
34 (when (display-graphic-p)
42 ;;(load-theme 'tangotango t)
43 ;; (load-theme 'railscasts t)
44 (load-theme 'leuven t)
49 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
52 (setq erc-autojoin-channels-alist
53 '((".*\\.freenode.net" "#tahoe-lafs")
54 (".*\\.oftc.net" "#leastauthority")
55 ;;(".*\\.mozilla.org" "#rust-beginners")
60 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
61 "324" "329" "332" "333" "353" "477"))
62 ;; don't show any of this
63 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
68 (when (y-or-n-p "Do you want to start IRC? ")
69 ;; (erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
70 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
71 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
73 ;; switch to ERC with Ctrl+c e
74 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
77 (setq ido-enable-flex-matching t)
78 (setq ido-everywhere t)
81 ;; disable tabs for indentation
82 (setq-default indent-tabs-mode nil)
84 ;; (require 'whitespace)
85 ;; (setq whitespace-style '(face lines-tail))
86 ;; (setq whitespace-line-column 80)
87 ;; (global-whitespace-mode t)
89 ;; ;; show trailing whitespaces
90 ;; (setq-default show-trailing-whitespace t)
91 ;; (setq-default indicate-empty-lines t)
94 (setq c-default-style "k&r"
98 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
99 (add-to-list 'exec-path "~/.cabal/bin")
100 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
103 (require 'haskell-process)
104 (require 'haskell-interactive-mode)
105 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
107 (setq haskell-process-suggest-remove-import-lines t)
108 (setq haskell-process-auto-import-loaded-modules t)
109 (setq haskell-process-log t)
111 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
112 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
113 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
114 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
115 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
116 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
117 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
120 ;;(autoload 'ghc-init "ghc" nil t)
121 ;;(autoload 'ghc-debug "ghc" nil t)
123 ;;(add-hook 'haskell-mode-hook (lambda () (ghc-init)))
126 (add-to-list 'load-path "~/.emacs.d/hs-lint")
128 (defun my-haskell-mode-hook ()
129 (local-set-key "\C-cl" 'hs-lint))
131 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
134 (add-hook 'haskell-mode-hook #'hindent-mode)
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")
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))
152 (global-linum-mode t)
153 (global-hl-line-mode 0)
155 ;; fci -- fill-column-indicator
156 (setq fci-rule-column 81)
157 (setq fci-rule-width 1)
158 (setq fci-rule-color "darkblue")
160 ;; turn off electric-indent-mode
161 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
164 (setq mail-user-agent 'message-user-agent)
165 (setq user-mail-address "ram@rkrishnan.org"
166 user-full-name "Ramakrishnan Muthukrishnan")
169 (setq smtpmail-stream-type 'ssl
170 smtpmail-smtp-server "mail.messagingengine.com"
171 smtpmail-smtp-service 465)
174 (require 'notmuch-address)
175 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
176 ;;(notmuch-address-message-insinuate)
179 (setq message-send-mail-function 'smtpmail-send-it)
183 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
185 ;; company mode for auto completion
186 (add-hook 'after-init-hook 'global-company-mode)
188 ;; Reduce the time after which the company auto completion popup opens
189 (setq company-idle-delay 0.2)
191 ;; Reduce the number of characters before company kicks in
192 (setq company-minimum-prefix-length 1)
194 ;; Set path to racer binary
195 (setq racer-cmd "/home/ram/.cargo/bin/racer")
197 (add-hook 'rust-mode-hook
200 (racer-turn-on-eldoc)
201 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
202 (set (make-local-variable 'company-backends) '(company-racer))
203 (local-set-key (kbd "M-.") #'racer-find-definition)
204 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
207 ;; (add-hook 'prog-mode-hook 'highlight-todos)
210 (setq ledger-binary-path "~/.cabal/bin/hledger")
213 (setq exec-path (cons "/usr/local/go/bin" exec-path))
214 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
216 (defun go-mode-setup ()
218 (setq gofmt-command "goimports")
219 (add-hook 'before-save-hook 'gofmt-before-save))
221 (add-hook 'go-mode-hook 'go-mode-setup)
223 ;; alias man to w.o.man
224 (defalias 'man 'woman)
227 (defun eshell/emacs (&rest args)
228 "open a file in emacs"
231 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
233 ;(desktop-save-mode 1)
237 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
240 (add-hook 'after-init-hook #'global-flycheck-mode)
243 (setq org-todo-keywords
244 '((sequence "TODO(t)" "INPROGRESS(p)" "WAITING(w)" "|" "DONE" "CANCELLED")))
246 (setq org-agenda-files '("~/src/org/"))
247 (add-to-list 'load-path "~/.emacs.d/elisp")
249 (require 'org-bullets)
250 (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
252 ;; key shortcut for org-agenda
253 (global-set-key (kbd "C-c a") 'org-agenda)
255 (custom-set-variables
256 ;; custom-set-variables was added by Custom.
257 ;; If you edit it by hand, you could mess it up, so be careful.
258 ;; Your init file should contain only one such instance.
259 ;; If there is more than one, they won't work right.
260 '(package-selected-packages
262 (dumb-jump tangotango-theme restclient railscasts-theme racket-mode racer paredit notmuch markdown-mode magit leuven-theme ledger-mode hindent go-mode flycheck-rust flycheck-haskell fill-column-indicator company-racer color-theme-sanityinc-tomorrow auto-complete))))
264 ;; custom-set-faces was added by Custom.
265 ;; If you edit it by hand, you could mess it up, so be careful.
266 ;; Your init file should contain only one such instance.
267 ;; If there is more than one, they won't work right.