]> git.rkrishnan.org Git - .emacs.d.git/blob - init.el
tangotango color theme instead of monokai
[.emacs.d.git] / init.el
1 (show-paren-mode 1)
2 ;; y-or-n instead of yes-or-no
3 (defalias 'yes-or-no-p 'y-or-n-p)
4
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)
9
10 ;; column number
11 (column-number-mode 1)
12
13 ;; Don't let Emacs hurt your ears
14 (setq visible-bell t)
15
16 ;; This is bound to f11 in Emacs 24.4
17 ;; (toggle-frame-fullscreen)
18 (custom-set-variables
19  '(initial-frame-alist (quote ((fullscreen . maximized)))))
20 ;; Who use the bar to scroll?
21 (when (display-graphic-p)
22   (progn
23     (scroll-bar-mode 0)
24
25     (tool-bar-mode 0)
26     (menu-bar-mode 0)))
27
28 ; my-packages.el
29 (require 'package)
30 (add-to-list 'package-archives
31              '("melpa" . "http://melpa.milkbox.net/packages/") t)
32 (add-to-list 'package-archives
33              '("marmalade" . "http://marmalade-repo.org/packages/") t)
34 (package-initialize)
35
36 ; fetch the list of packages available
37 (unless package-archive-contents
38   (package-refresh-contents))
39
40 ;; make sure my list of packages are installed
41 (setq package-list '(rust-mode haskell-mode clojure-mode ghc restclient tangotango-theme))
42
43 ; install the missing packages
44 (dolist (package package-list)
45   (unless (package-installed-p package)
46     (package-install package)))
47
48 ;; tangotango
49 (load-theme 'tangotango t)
50
51 ;; erc
52 (require 'erc)
53 (require 'tls)
54 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
55
56 (erc-autojoin-mode t)
57 (setq erc-autojoin-channels-alist
58   '((".*\\.freenode.net" "#tahoe-lafs")
59     (".*\\.oftc.net" "#LeastAuthority")))
60
61 ;; check channels
62 (erc-track-mode t)
63 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
64
65                                  "324" "329" "332" "333" "353" "477"))
66 ;; don't show any of this
67 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
68
69 (defun start-erc ()
70   "Connect to IRC."
71   (interactive)
72   (when (y-or-n-p "Do you want to start IRC? ")
73     (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
74     (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
75
76 ;; switch to ERC with Ctrl+c e
77 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
78
79 ;; haskell mode
80 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
81 (add-to-list 'exec-path "~/.cabal/bin")
82 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
83 ;; (add-hook 'haskell-mode-hook 'haskell-indent-mode)
84 ;; (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
85 ;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
86 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
87
88 ;; ghc-mod
89 (autoload 'ghc-init "ghc" nil t)
90 (autoload 'ghc-debug "ghc" nil t)
91 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
92 (custom-set-variables
93   '(haskell-process-type 'cabal-repl))
94
95 ;; ido
96 (setq ido-enable-flex-matching t)
97 (setq ido-everywhere t)
98 (ido-mode 1)
99
100 ;; disable tabs for indentation
101 (setq-default indent-tabs-mode nil)
102
103 ;; (require 'whitespace)
104 ;; (setq whitespace-style '(face lines-tail))
105 ;; (setq whitespace-line-column 80)
106 ;; (global-whitespace-mode t)
107
108 ;; ;; show trailing whitespaces
109 ;; (setq-default show-trailing-whitespace t)
110 ;; (setq-default indicate-empty-lines t)
111
112 ;; C style
113 (setq c-default-style "k&r"
114       c-basic-offset 4)
115
116 ;; hlint
117 (add-to-list 'load-path "~/.emacs.d/hs-lint")
118 (require 'hs-lint)
119 (defun my-haskell-mode-hook ()
120    (local-set-key "\C-cl" 'hs-lint))
121 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)