2 ;; y-or-n instead of yes-or-no
3 (defalias 'yes-or-no-p 'y-or-n-p)
5 ;; Don't use messages that you don't rea
6 (setq make-backup-files nil)
7 (setq initial-scratch-message "")
8 (setq inhibit-startup-message t)
11 (setq-default cursor-type '(bar . 2))
14 (column-number-mode 1)
17 (set-default-font "Inconsolata-12")
19 ;; Don't let Emacs hurt your ears
22 ;; This is bound to f11 in Emacs 24.4
23 ;; (toggle-frame-fullscreen)
25 '(initial-frame-alist (quote ((fullscreen . maximized)))))
26 ;; Who use the bar to scroll?
27 (when (display-graphic-p)
36 (add-to-list 'package-archives
37 '("melpa" . "http://melpa.milkbox.net/packages/") t)
38 (add-to-list 'package-archives
39 '("marmalade" . "http://marmalade-repo.org/packages/") t)
42 ; fetch the list of packages available
43 (unless package-archive-contents
44 (package-refresh-contents))
46 ;; make sure my list of packages are installed
47 (setq package-list '(go-mode
57 ; install the missing packages
58 (dolist (package package-list)
59 (unless (package-installed-p package)
60 (package-install package)))
63 (load-theme 'tangotango t)
64 ;; (load-theme 'leuven t)
69 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
72 (setq erc-autojoin-channels-alist
73 '((".*\\.freenode.net" "#tahoe-lafs" "#plan9chan" "#inferno" "#cat-v" "#9front")
74 (".*\\.oftc.net" "#LeastAuthority")))
78 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
80 "324" "329" "332" "333" "353" "477"))
81 ;; don't show any of this
82 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
87 (when (y-or-n-p "Do you want to start IRC? ")
88 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
89 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
91 ;; switch to ERC with Ctrl+c e
92 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
95 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
96 (add-to-list 'exec-path "~/.cabal/bin")
97 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
98 ;; (add-hook 'haskell-mode-hook 'haskell-indent-mode)
99 ;; (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
100 ;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
101 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
104 (require 'haskell-interactive-mode)
105 (require 'haskell-process)
106 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
108 (custom-set-variables
109 '(haskell-process-suggest-remove-import-lines t)
110 '(haskell-process-auto-import-loaded-modules t)
111 '(haskell-process-log t))
113 (eval-after-load "haskell-mode"
115 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
116 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
117 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
118 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
119 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
120 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
121 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
122 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)
124 (define-key haskell-cabal-mode-map (kbd "C-`") 'haskell-interactive-bring)
125 (define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
126 (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
127 (define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal)))
130 (autoload 'ghc-init "ghc" nil t)
131 (autoload 'ghc-debug "ghc" nil t)
133 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
134 (custom-set-variables
135 '(haskell-process-type 'cabal-repl))
138 (setq ido-enable-flex-matching t)
139 (setq ido-everywhere t)
142 ;; disable tabs for indentation
143 (setq-default indent-tabs-mode nil)
145 ;; (require 'whitespace)
146 ;; (setq whitespace-style '(face lines-tail))
147 ;; (setq whitespace-line-column 80)
148 ;; (global-whitespace-mode t)
150 ;; ;; show trailing whitespaces
151 ;; (setq-default show-trailing-whitespace t)
152 ;; (setq-default indicate-empty-lines t)
155 (setq c-default-style "k&r"
159 (add-to-list 'load-path "~/.emacs.d/hs-lint")
161 (defun my-haskell-mode-hook ()
162 (local-set-key "\C-cl" 'hs-lint))
163 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
166 (add-hook 'before-save-hook #'gofmt-before-save)
167 (add-hook 'go-mode-hook (lambda ()
168 (local-set-key (kbd "C-c C-r")
169 'go-remove-unused-imports)))
170 (add-hook 'go-mode-hook (lambda ()
171 (local-set-key (kbd "C-c i")
175 (add-to-list 'load-path "~/.emacs.d/asp-mode")
176 (autoload 'asp-mode "asp-mode")
177 (setq auto-mode-alist
178 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
181 (global-linum-mode t)
182 (global-hl-line-mode 0)
184 ;; fci -- fill-column-indicator
185 (setq fci-rule-column 81)
186 (setq fci-rule-width 1)
187 (setq fci-rule-color "darkblue")
189 ;; turn off electric-indent-mode
190 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))