|
1 ;; ~/.emacs - Luke Hoersten - v4.0 |
|
2 |
|
3 ;; general |
|
4 (setq-default load-path (cons "~/.emacs.d" load-path)) ; set default emacs load path |
|
5 |
|
6 (setq-default ediff-split-window-function 'split-window-horizontally) ; diff horizontally |
|
7 (setq-default x-select-enable-clipboard t) ; paste from X buffer |
|
8 (setq-default inhibit-splash-screen t) ; disable splash screen |
|
9 (setq-default indicate-empty-lines t) ; show empty lines |
|
10 (setq-default show-trailing-whitespace t) ; show trailing whitespace |
|
11 (put 'set-goal-column 'disabled nil) ; enable goal column setting |
|
12 (put 'narrow-to-region 'disabled nil) ; enable hiding |
|
13 |
|
14 (display-time-mode t) ; show clock |
|
15 (column-number-mode t) ; show column numbers |
|
16 (delete-selection-mode t) ; replace highlighted text |
|
17 (windmove-default-keybindings) ; move between windows with shift-arrow |
|
18 |
|
19 (ido-mode t) ; file/buffer selector |
|
20 (setq-default ido-enable-flex-matching t) ; fuzzy matching is a must have |
|
21 (add-hook 'text-mode-hook 'flyspell-mode t) ; spellcheck text |
|
22 |
|
23 ;; coding |
|
24 (which-func-mode t) ; show current function |
|
25 (show-paren-mode t) ; show matching paren |
|
26 (global-font-lock-mode t) ; syntax highlighting |
|
27 (transient-mark-mode t) ; show highlighting |
|
28 (add-hook 'before-save-hook 'whitespace-cleanup) ; cleanup whitespace on exit |
|
29 (load "hoersten-pastebin-region") ; send selected text to pastebin |
|
30 (load "mercurial") ; load mercurial mode |
|
31 (load "ahg") ; load suplimental mercurial mode |
|
32 (load "hoersten-c-style") ; load c specific lisp |
|
33 (global-set-key (kbd "C-c c") 'compile) |
|
34 |
|
35 ;; gdb settings |
|
36 (setq-default gdb-many-windows t) ; gdb many windows |
|
37 (setq-default gdb-use-separate-io-buffer t) ; gdb stdio output |
|
38 (setq-default gud-tooltip-mode t) ; mouse hover variables |
|
39 (global-set-key (kbd "C-c g") 'gdb) ; gdb |
|
40 |
|
41 ;; haskell |
|
42 (setq haskell-font-lock-symbols 'unicode) |
|
43 |
|
44 ;; indentation |
|
45 (setq-default tab-width 3) |
|
46 (setq-default c-basic-offset 3) |
|
47 (setq-default indent-tabs-mode t) |
|
48 |
|
49 ;; use only spaces for alignment |
|
50 (global-set-key (kbd "C-c a") 'align-with-spaces) ; align |
|
51 (defun align-with-spaces (beg end) |
|
52 "Align selected using only spaces for whitespace." |
|
53 (interactive "r") |
|
54 (let ((indent-tabs-mode nil)) |
|
55 (align beg end))) |
|
56 |
|
57 ;; shell |
|
58 (global-set-key (kbd "C-c s") 'shell) ; start shell |
|
59 (ansi-color-for-comint-mode-on) ; color in shell buffer |
|
60 (setq-default comint-scroll-to-bottom-on-input t) ; only type on prompt |
|
61 (setq-default comint-scroll-show-maximum-output t) ; place text at bottom |
|
62 |
|
63 ;; map file extensions to modes |
|
64 (setq-default auto-mode-alist |
|
65 (append |
|
66 '(("\\.ipp$" . c++-mode) |
|
67 ("\\.inl$" . c++-mode) |
|
68 ("SCons" . python-mode) |
|
69 ("\\.jj$" . java-mode)) |
|
70 auto-mode-alist)) |
|
71 |
|
72 ;; x stuff |
|
73 (if (not window-system) |
|
74 (menu-bar-mode nil) ; remove menu bar in no-x mode |
|
75 (tool-bar-mode nil) ; remove tool bar |
|
76 (scroll-bar-mode nil) ; remove scroll bar |
|
77 (custom-set-faces '(default ((t (:background "#000000" :foreground "#ffffff" :height 100 :family "DejaVu Sans Mono"))))) |
|
78 (setq default-frame-alist '((width . 100) (height . 50) (menu-bar-lines . 1))) |
|
79 |
|
80 ;; twilight theme |
|
81 (require 'color-theme) |
|
82 (load "color-theme-twilight") |
|
83 (color-theme-twilight) |
|
84 (global-hl-line-mode t)) |