Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 166 lines (147 sloc) 5.47 kB
a19d74b @emanchado Reorganised, add ido mode
authored
1 ;; Do this first to avoid annoying flickering
220ee83 @emanchado Add initial .emacs file
authored
2 ; (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
3 (if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
f5ada93 @emanchado Hide menu bar. Haven't used it a single time.
authored
4 (if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
220ee83 @emanchado Add initial .emacs file
authored
5
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
6 ;; Library load paths
7 (add-to-list 'load-path "~/.emacs.d/emacs-color-theme-solarized")
c9b09ff @emanchado Move extra files in so they're always available
authored
8 (add-to-list 'load-path "~/src/Emacs-directory")
9 (add-to-list 'load-path "~/src/Emacs-directory/extra")
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
10 (add-to-list 'load-path "~/.emacs.d/rainbow/")
11 (add-to-list 'load-path "~/.emacs.d/scala")
12 (add-to-list 'load-path "~/lib/scala/ensime_2.8.1-0.4.4/elisp/")
13 (add-to-list 'load-path "~/.emacs.d/js2-mode")
14 (add-to-list 'load-path "~/.emacs.d/less-css-mode")
15 ; Load own functions, bound to shortcuts below
16 (load-library "editing-functions")
17
18
a19d74b @emanchado Reorganised, add ido mode
authored
19 ;; Font and color theme
20 (set-default-font "Inconsolata-12")
21 (require 'color-theme)
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
22 (eval-after-load "color-theme"
23 '(progn
24 (color-theme-initialize)
25 (color-theme-hober)))
26 ; If exists, load this one instead
072cdec @emanchado Load some extra, neat extensions
authored
27 (ignore-errors
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
28 (require 'color-theme-solarized)
29 ;(color-theme-solarized-dark)
30 )
7303a1b @emanchado Add new shortcut for removing whitespace in front of cursor
authored
31
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
32 ;; Indentation, whitespace...
220ee83 @emanchado Add initial .emacs file
authored
33 (setq c-basic-offset 4)
34 (setq tab-width 4)
35 (setq indent-tabs-mode nil)
36 (setq-default indent-tabs-mode nil)
a19d74b @emanchado Reorganised, add ido mode
authored
37 ; Indent new lines automatically
38 (global-set-key "\r" 'newline-and-indent)
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
39 ; Whitespace
40 (global-whitespace-mode)
41 (setq whitespace-line-column 80)
42 (setq whitespace-style '(tabs lines-tail trailing indentation::space))
a19d74b @emanchado Reorganised, add ido mode
authored
43
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
44 ;; Other options
45 ; Ido mode for the mini-buffer, see
46 ; http://www.emacswiki.org/emacs-en/InteractivelyDoThings
47 (require 'ido)
48 (ido-mode t)
49 ; Don't make me type the whole word 'yes' or 'no'
50 (defalias 'yes-or-no-p 'y-or-n-p)
51 ; Automatic crap handling
a19d74b @emanchado Reorganised, add ido mode
authored
52 (setq custom-file "~/.emacs.d/custom.el")
53 (load custom-file 'noerror)
6f2b2cd @emanchado Avoid backup files. I hate them.
authored
54 (setq make-backup-files nil)
220ee83 @emanchado Add initial .emacs file
authored
55
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
56 ;; Minor modes
57 ; Show-paren mode
58 (show-paren-mode 1)
59 ; Rainbow
60 (ignore-errors
61 (require 'rainbow-mode)
62 (rainbow-mode))
63 ; Volatile highlights
c9b09ff @emanchado Move extra files in so they're always available
authored
64 (require 'volatile-highlights)
65 (volatile-highlights-mode t)
e9047e3 @emanchado Add flyspell for text-mode
authored
66 ; Flyspell
67 (dolist (hook '(text-mode-hook))
68 (add-hook hook (lambda () (flyspell-mode 1)))
69 (add-hook hook 'turn-on-auto-fill))
9aee453 @emanchado Add unto-tree
authored
70 ; Undo tree
c9b09ff @emanchado Move extra files in so they're always available
authored
71 (require 'undo-tree)
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
72
a19d74b @emanchado Reorganised, add ido mode
authored
73 ;; Common shortcuts
6127e67 @emanchado Recover the help shortcuts
authored
74 (global-set-key "\C-ch" help-map)
f87dc04 @emanchado Make sure ^H works properly
authored
75 (global-set-key "\C-h" 'backward-delete-char)
6a04a12 @emanchado Try to fix the backward-kill-word
authored
76 (global-set-key "\M-\C-h" 'backward-kill-word)
220ee83 @emanchado Add initial .emacs file
authored
77 (global-set-key "\C-x\C-k" 'kill-region)
78 (global-set-key "\C-c\C-k" 'kill-region)
d58410f @emanchado Add C-M-t to transpose lines
authored
79 (global-set-key "\C-xj" '(lambda () (interactive) (join-line -1)))
80 (global-set-key "\C-x\C-j" '(lambda () (interactive) (join-line -1)))
81 (global-set-key "\C-\M-t" 'transpose-lines)
1535fdf @estebanm Add C-u as kill until the start of the line (ie. M-0 C-k)
estebanm authored
82 ; Add C-u as in bash
83 (global-set-key "\C-u" 'kill-until-start-of-line)
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
84 ; Add C-c c t
85 (global-set-key "\C-cct" 'clone-current-test)
7303a1b @emanchado Add new shortcut for removing whitespace in front of cursor
authored
86 ; Add C-M-d, w to removing the whitespace following the cursor
87 (global-unset-key "\C-\M-d")
88 (global-set-key "\C-\M-dw" 'kill-following-whitespace)
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
89 ; From Steve Yegge: make it super-comfortable to call M-x
90 (global-set-key "\C-x\C-m" 'execute-extended-command)
91 (global-set-key "\C-c\C-m" 'execute-extended-command)
92 ; Search for the word under the cursor (like * in VIM)
93 (global-set-key [?\C-8] 'isearch-forward-at-point)
94 ; Use iy-go-to-char to gain some VIM POWA
c9b09ff @emanchado Move extra files in so they're always available
authored
95 (require 'iy-go-to-char)
96 (global-set-key (kbd "C-M-f") 'iy-go-to-char)
97 (global-set-key (kbd "C-M-S-f") 'iy-go-to-char-backward)
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
98 (global-set-key (kbd "C-%") 'goto-match-paren)
d759124 @emanchado Add key-chords O M G
authored
99 ; Key chords
c9b09ff @emanchado Move extra files in so they're always available
authored
100 (require 'key-chord)
101 (key-chord-mode 1)
102 (key-chord-define-global "qq" 'iy-go-to-char)
103 (key-chord-define-global "QQ" 'iy-go-to-char-backward)
2242567 @emanchado Switch window with C-TAB
authored
104 ; Change window with Ctrl-TAB
105 (global-set-key [\C-tab] 'other-window)
69b7fd1 @estebanm Add nXML and Markdown mode configuration
estebanm authored
106
a19d74b @emanchado Reorganised, add ido mode
authored
107 ;; Expansion
516f675 @emanchado Change *-style search, tweak autocompletions
authored
108 ; Complete lines like VIM
109 (global-set-key "\C-x\C-o" (make-hippie-expand-function
110 '(try-expand-line) t))
111 ; Complete file names like VIM
112 (global-set-key "\C-x\C-t" (make-hippie-expand-function
113 '(try-complete-file-name
114 try-complete-file-name-partially) t))
115
a19d74b @emanchado Reorganised, add ido mode
authored
116
44b019e @emanchado Add yasnippet
authored
117 ;; yasnippet
118 (setq yas/root-directory "~/src/Emacs-directory/snippets")
119 (yas/load-directory yas/root-directory)
120
8191882 @emanchado Load Scala mode (ensime) and Raindbow minor mode
authored
121
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
122 ;;; Major mode shenanigans ---------------------------------------------
123
124 ;; Markdown mode for .text files
125 (autoload 'markdown-mode "markdown-mode.el"
126 "Major mode for editing Markdown files" t)
127 (setq auto-mode-alist
128 (cons '("\\.\\(text\\|markdown\\)" . markdown-mode) auto-mode-alist))
8191882 @emanchado Load Scala mode (ensime) and Raindbow minor mode
authored
129
21d6c55 @emanchado Merge branch 'master' of https://github.com/estebanm/Emacs-directory
authored
130 ;; nXML configuration
131 (require `nxml-mode)
132 (setq auto-mode-alist
133 (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
134 auto-mode-alist))
135 (add-hook 'nxml-mode-hook '(lambda nil
136 (local-set-key [M-end] 'nxml-finish-element)))
137 ; Autoclose tag on </
138 (setq nxml-slash-auto-complete-flag t)
139
8191882 @emanchado Load Scala mode (ensime) and Raindbow minor mode
authored
140 ;; Scala
9854d35 @estebanm Ignore errors when loading optional libraries
estebanm authored
141 (ignore-errors (require 'scala-mode-auto))
8191882 @emanchado Load Scala mode (ensime) and Raindbow minor mode
authored
142 ; Ensime
9854d35 @estebanm Ignore errors when loading optional libraries
estebanm authored
143 (ignore-errors (require 'ensime))
8191882 @emanchado Load Scala mode (ensime) and Raindbow minor mode
authored
144 ; This step causes the ensime-mode to be started whenever
145 ; scala-mode is started for a buffer. You may have to customize this step
146 ; if you're not using the standard scala mode.
147 (add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
148 ; MINI HOWTO:
149 ; Open .scala file. M-x ensime (once per project)
150
12c906d @estebanm Use cperl mode, not the standard Perl mode
estebanm authored
151 ;;; cperl-mode is preferred to perl-mode
152 ;;; "Brevity is the soul of wit" <foo at acm.org>
153 (defalias 'perl-mode 'cperl-mode)
21d6c55 @emanchado Merge branch 'master' of https://github.com/estebanm/Emacs-directory
authored
154 (setq cperl-indent-level 4)
1f99d3c @emanchado Use a decent JS mode for fuck's sake
authored
155
156 ;; Javascript
157 (autoload 'js2-mode "js2-mode" nil t)
158 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
159 (setq js2-consistent-level-indent-inner-bracket-p t)
160 (setq js2-pretty-multiline-decl-indentation-p t)
dbdb56e @emanchado Reorganise init.el, add some stuff
authored
161 (put 'narrow-to-region 'disabled nil)
162
163 ;; LESS CSS
164 (ignore-errors
165 (require 'less-css-mode))
Something went wrong with that request. Please try again.