annotate .elisp/settings/50.preferences.el @ 207:c965d5dbd868

emacs localfuncs: add list rotation and string-joining functions I sometimes use
author Augie Fackler <durin42@gmail.com>
date Tue, 11 May 2010 15:32:19 -0500
parents cf3ba8f57434
children e4842709368a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
77
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
1 ;; All lines should end in a newline
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
2 (setq require-final-newline t)
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
3
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
4 ;; disable tabs
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
5 (setq tab-width 4)
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
6 (setq-default indent-tabs-mode nil)
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
7
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
8 ;; Cleanup whitespace before saves.
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
9 (add-hook 'before-save-hook '(lambda ()
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
10 (if af-cleanup-whitespace (whitespace-cleanup))))
139
6b57bb47de2e emacs settings: Fix whitespace cleanup to be slightly less invasive.
Augie Fackler <durin42@gmail.com>
parents: 126
diff changeset
11 (setq whitespace-chars (quote (tabs spaces trailing lines newline empty)))
77
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
12
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
13 ;; Disable that startup screen
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
14 (setq inhibit-startup-message t)
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
15
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
16 ;; Basically everything I do is in version control, stop saving backup files
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
17 (setq make-backup-files nil)
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
18
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
19 ;; Set some pretty colors that are gentler on my eyes
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
20 (setq default-frame-alist
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
21 '((width . 80)
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
22 (cursor-color . "white")
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
23 (cursor-type . box)
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
24 (foreground-color . "white")
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
25 (background-color . "black")
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
26 )
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
27 )
194
cf3ba8f57434 emacs: let ipython know we have a dark background
Augie Fackler <durin42@gmail.com>
parents: 193
diff changeset
28
cf3ba8f57434 emacs: let ipython know we have a dark background
Augie Fackler <durin42@gmail.com>
parents: 193
diff changeset
29 ;; tell ipython we have a dark background
cf3ba8f57434 emacs: let ipython know we have a dark background
Augie Fackler <durin42@gmail.com>
parents: 193
diff changeset
30 (setq py-python-command-args (quote ("-i")))
cf3ba8f57434 emacs: let ipython know we have a dark background
Augie Fackler <durin42@gmail.com>
parents: 193
diff changeset
31
77
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
32 ; always highlight matching paren
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
33 (show-paren-mode 1)
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
34
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
35 ;; Automatically revert unedited files that change on the underlying
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
36 ;; system.
45d7441d0cf2 Modularize .emacs
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
37 (global-auto-revert-mode)
84
f013f40e7b63 Import latest nosemacs, set nose to output dots instead of verbose output.
Augie Fackler <durin42@gmail.com>
parents: 77
diff changeset
38
f013f40e7b63 Import latest nosemacs, set nose to output dots instead of verbose output.
Augie Fackler <durin42@gmail.com>
parents: 77
diff changeset
39 ;; I like dots in my nose output
97
5f7b673008b5 Disable toolbar, really use dots.
Augie Fackler <durin42@gmail.com>
parents: 84
diff changeset
40 (setq nose-use-verbose nil)
5f7b673008b5 Disable toolbar, really use dots.
Augie Fackler <durin42@gmail.com>
parents: 84
diff changeset
41
5f7b673008b5 Disable toolbar, really use dots.
Augie Fackler <durin42@gmail.com>
parents: 84
diff changeset
42 ;; no toolbar
114
d4845549ed7c No toolbar, but mean it this time.
Augie Fackler <durin42@gmail.com>
parents: 106
diff changeset
43 (setq tool-bar-mode nil)
165
a8e5d4b0913d emacs: Really hide the toolbar.
Augie Fackler <durin42@gmail.com>
parents: 161
diff changeset
44 (tool-bar-mode 0)
105
11fa0420b392 New settings for emacs 23 nightlies.
Augie Fackler <durin42@gmail.com>
parents: 97
diff changeset
45
166
1f6d35a7a197 emacs: scrollbars on the right
Augie Fackler <durin42@gmail.com>
parents: 165
diff changeset
46 ;; scrollbars, but on the right, not the left
1f6d35a7a197 emacs: scrollbars on the right
Augie Fackler <durin42@gmail.com>
parents: 165
diff changeset
47 (set-scroll-bar-mode 'right)
1f6d35a7a197 emacs: scrollbars on the right
Augie Fackler <durin42@gmail.com>
parents: 165
diff changeset
48
105
11fa0420b392 New settings for emacs 23 nightlies.
Augie Fackler <durin42@gmail.com>
parents: 97
diff changeset
49 ;; Command is meta in OS X.
11fa0420b392 New settings for emacs 23 nightlies.
Augie Fackler <durin42@gmail.com>
parents: 97
diff changeset
50 (setq ns-command-modifier (quote meta))
11fa0420b392 New settings for emacs 23 nightlies.
Augie Fackler <durin42@gmail.com>
parents: 97
diff changeset
51
11fa0420b392 New settings for emacs 23 nightlies.
Augie Fackler <durin42@gmail.com>
parents: 97
diff changeset
52 ;; Don't popup new frames for opened files
11fa0420b392 New settings for emacs 23 nightlies.
Augie Fackler <durin42@gmail.com>
parents: 97
diff changeset
53 (setq ns-pop-up-frames nil)
106
398b9c3a3a0b Better buffer name uniquify rules.
Augie Fackler <durin42@gmail.com>
parents: 105
diff changeset
54
151
bf6b5a0dc1f3 .elisp: Make textmate-goto-symbol always recompute function locations.
Augie Fackler <durin42@gmail.com>
parents: 139
diff changeset
55 ; cause imenu to always rescan the buffer (for textmate-goto-symbol)
bf6b5a0dc1f3 .elisp: Make textmate-goto-symbol always recompute function locations.
Augie Fackler <durin42@gmail.com>
parents: 139
diff changeset
56 (setq imenu-auto-rescan t)
106
398b9c3a3a0b Better buffer name uniquify rules.
Augie Fackler <durin42@gmail.com>
parents: 105
diff changeset
57 ;; better uniquify from http://metapundit.net/sections/blog/emacs_and_django
398b9c3a3a0b Better buffer name uniquify rules.
Augie Fackler <durin42@gmail.com>
parents: 105
diff changeset
58 (require 'uniquify)
398b9c3a3a0b Better buffer name uniquify rules.
Augie Fackler <durin42@gmail.com>
parents: 105
diff changeset
59 (setq uniquify-buffer-name-style 'reverse)
398b9c3a3a0b Better buffer name uniquify rules.
Augie Fackler <durin42@gmail.com>
parents: 105
diff changeset
60 (setq uniquify-separator "/")
398b9c3a3a0b Better buffer name uniquify rules.
Augie Fackler <durin42@gmail.com>
parents: 105
diff changeset
61 (setq uniquify-after-kill-buffer-p t)
398b9c3a3a0b Better buffer name uniquify rules.
Augie Fackler <durin42@gmail.com>
parents: 105
diff changeset
62 (setq uniquify-ignore-buffers-re "^\\*")
123
b2a07050b430 Allow mercurial.el to default to default or default-push as needed.
Augie Fackler <durin42@gmail.com>
parents: 114
diff changeset
63 (setq hg-outgoing-repository "")
b2a07050b430 Allow mercurial.el to default to default or default-push as needed.
Augie Fackler <durin42@gmail.com>
parents: 114
diff changeset
64 (setq hg-incoming-repository "")
154
b67c5a3b98f3 emacs preferences: set a text height so linux doesn't get ideas.
Augie Fackler <durin42@gmail.com>
parents: 139
diff changeset
65 ; so that Cmd+H won't activate Hide Current
b67c5a3b98f3 emacs preferences: set a text height so linux doesn't get ideas.
Augie Fackler <durin42@gmail.com>
parents: 139
diff changeset
66 ; App and Cmd+Shift+q won't logout user.
b67c5a3b98f3 emacs preferences: set a text height so linux doesn't get ideas.
Augie Fackler <durin42@gmail.com>
parents: 139
diff changeset
67 (setq mac-pass-command-to-system nil)
b67c5a3b98f3 emacs preferences: set a text height so linux doesn't get ideas.
Augie Fackler <durin42@gmail.com>
parents: 139
diff changeset
68
172
593b5263291d emacs: different font height on OS X
Augie Fackler <durin42@gmail.com>
parents: 161
diff changeset
69 (cond
593b5263291d emacs: different font height on OS X
Augie Fackler <durin42@gmail.com>
parents: 161
diff changeset
70 ((eq window-system 'ns) ;; OS X
593b5263291d emacs: different font height on OS X
Augie Fackler <durin42@gmail.com>
parents: 161
diff changeset
71 (set-face-attribute 'default nil :height 120))
593b5263291d emacs: different font height on OS X
Augie Fackler <durin42@gmail.com>
parents: 161
diff changeset
72 (t ;; everywhere else
593b5263291d emacs: different font height on OS X
Augie Fackler <durin42@gmail.com>
parents: 161
diff changeset
73 (set-face-attribute 'default nil :height 100)))
159
362d19c732a8 preferences: use y-or-n-p instead of yes-or-no-p
Augie Fackler <durin42@gmail.com>
parents: 154
diff changeset
74
362d19c732a8 preferences: use y-or-n-p instead of yes-or-no-p
Augie Fackler <durin42@gmail.com>
parents: 154
diff changeset
75 ;; use y or n instead of yes or no
362d19c732a8 preferences: use y-or-n-p instead of yes-or-no-p
Augie Fackler <durin42@gmail.com>
parents: 154
diff changeset
76 (fset 'yes-or-no-p 'y-or-n-p)
193
0ab568ab2b1b emacs: better magit diff faces
Augie Fackler <durin42@gmail.com>
parents: 173
diff changeset
77
0ab568ab2b1b emacs: better magit diff faces
Augie Fackler <durin42@gmail.com>
parents: 173
diff changeset
78 ;; customized theme faces
0ab568ab2b1b emacs: better magit diff faces
Augie Fackler <durin42@gmail.com>
parents: 173
diff changeset
79 (custom-set-faces
0ab568ab2b1b emacs: better magit diff faces
Augie Fackler <durin42@gmail.com>
parents: 173
diff changeset
80 '(magit-diff-add ((t (:foreground "DarkGreen"))) 'now)
0ab568ab2b1b emacs: better magit diff faces
Augie Fackler <durin42@gmail.com>
parents: 173
diff changeset
81 '(magit-item-highlight ((t (:background "grey19"))) 'now))