1 ;;; A simple rc to customize Emacs' UI to my tastes.
4 (setq default-frame-alist
7 (vertical-scroll-bars . right
)))
9 (setq inhibit-startup-screen t
)
11 ;;; By default Emacs rings the bell on end of buffer.
12 (setq ring-bell-function
'ignore
)
14 ;;; If nil, input (keyboard or mouse) interrupts redisplay.
15 (setq redisplay-dont-pause t
)
17 ;;; Line highlighting.
18 (global-hl-line-mode t
)
20 ;;; By default, only the row number is shown in the modeline.
21 (column-number-mode t
)
23 ;;; Edit visual, not logical lines.
24 ;; (global-visual-line-mode t)
26 ;;; Quick keystroke prompt.
27 (setq echo-keystrokes
0.0166)
31 ;;; Paren highlighting on cursor.
34 ;;; Use S-<arrow keys> to change windows.
35 (windmove-default-keybindings)
37 ;;; Richer completion and selection behavior for switching buffers and
44 ;;; Likewise for executing commands.
45 (when (condition-case nil
48 (global-set-key (kbd "M-x") 'smex
)
49 (global-set-key (kbd "M-X") 'smex-major-mode-commands
))
51 (setq focus-follows-mouse t
)
52 (setq mouse-autoselect-window t
)
54 (global-set-key (kbd "C-c b") 'bury-buffer
)
55 (global-set-key (kbd "C-c p") 'proced
)
56 (global-set-key (kbd "C-c f") 'find-function
)
57 (global-set-key (kbd "C-c d") 'yard-toggle-window-dedication
)
58 (define-key emacs-lisp-mode-map
(kbd "M-.") 'find-function-at-point
)
60 (when (require 'switch-window nil t
)
61 (global-set-key (kbd "C-x o") 'switch-window
)
62 ;; Less finger travel this way.
63 (setq switch-window-shortcut-style
'qwerty
))
65 ;;; The default escape character is C-c, but C-c is also the usual
66 ;;; control sequence for SIGINT. C-x, by contrast, is just a shell
67 ;;; prefix. Furthermore term-mode "helpfully" treats term-escape-char
70 (term-set-escape-char ?\C-x
)
72 ;;; Multiple terminal buffers in the same Emacs session.
73 (ad-enable-advice 'term
'after
'yard-rename-term-buffer
)
76 ;;; Many programs (including grml zsh) assume this behavior.
77 (setq term-scroll-to-bottom-on-output
'this
)
78 (setq term-scroll-show-maximum-output t
)
80 ;;; Empirically, Emacs on Windows and OS X has a very nice default
81 ;;; font. Likewise, the systems which feature a GTK Emacs are unlikely
82 ;;; to have a very servicable default. However GNU's FreeMono is a
83 ;;; nice Courier clone with good unicode coverage, and is usually
86 (set-face-attribute 'default nil
92 ;; (load-theme `anti-zenburn t)
93 ;; (load-theme `solarized-dark t)
95 ;;; Make sure, no matter what, ediff uses one frame.
96 (setq ediff-window-setup-function
'ediff-setup-windows-plain
)
98 ;;; Typing in "yes" and "no" gets tiresome.
99 (defalias 'yes-or-no-p
'y-or-n-p
)
101 ;;; As does being asked for confirmation when opening large files.
102 (setq large-file-warning-threshold
100000000)
104 ;;; ElDoc uses the minibuffer to prompt parameter lists and docstrings
105 ;;; for Emacs Lisp objects, and also generally (e.g. Clojure's nrepl
107 (add-hook 'emacs-lisp-mode-hook
'turn-on-eldoc-mode
)
108 (add-hook 'lisp-interaction-mode-hook
'turn-on-eldoc-mode
)
109 (add-hook 'ielm-mode-hook
'turn-on-eldoc-mode
)
110 (add-hook 'nrepl-interaction-mode-hook
'nrepl-turn-on-eldoc-mode
)
112 ;;; Follow compile errors with tab.
113 (add-hook 'compilation-mode-hook
'next-error-follow-minor-mode
)
115 ;;; By default, moving the point past the bottom of a page in docview
116 ;;; does not jump to next page.
117 (setq doc-view-continuous t
)
119 (setq-default doc-view-resolution
300)
121 ;;; Different sized fonts when editing LaTeX can be disorienting.
122 (setq font-latex-fontify-sectioning
'color
)
124 ;;; Assume Postgres syntax for highlighting SQL.
125 (add-hook 'sql-mode-hook
'sql-highlight-postgres-keywords
)