Add rc for mouse-copy. Require (only older?) built-in libraries in a
[emacs.d.git] / lisp / ui-rc.el
blob28db94edc3bfed8ee169fb7da0bf9951dd74dedd
1 ;;; A simple rc to customize Emacs' UI to my tastes.
3 ;;; Declutter the GUI.
4 (setq default-frame-alist
5 '((tool-bar-lines . 0)
6 (menu-bar-lines . 0)
7 (vertical-scroll-bars . nil)
8 (left-fringe . 0)
9 (right-fringe . 0)))
11 (setq inhibit-startup-screen t)
13 ;;; Empirically, Emacs on Windows and OS X has a very nice default
14 ;;; font. On the other hand, the systems which feature a GTK Emacs are
15 ;;; unlikely to have a very servicable default. GNU's FreeMono is a
16 ;;; nice Courier clone with good unicode coverage, and is usually
17 ;;; installed.
18 (when (featurep 'gtk)
19 (set-face-attribute 'default nil
20 :family "FreeMono"
21 :height 120
22 :weight 'normal))
24 ;;; If nil, input (keyboard or mouse) interrupts redisplay.
25 (setq redisplay-dont-pause t)
27 ;;; Font lock is Emacs for "syntax highlighting".
28 (global-font-lock-mode -1)
30 ;;; By default, only the row number is shown in the modeline.
31 (column-number-mode)
33 ;;; Highlight matching parenthesis at point.
34 (show-paren-mode)
36 (setq-default doc-view-resolution 300)
38 ;;; eldoc-mode employs the minibuffer to prompt parameter lists and
39 ;;; docstrings for Emacs Lisp objects, and also generally
40 ;;; (e.g. Clojure's nrepl uses eldoc).
41 (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
42 (add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)
43 (add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)
45 ;;; Prompt keystrokes quickly.
46 (setq echo-keystrokes 0.0166)
48 ;;; By default, Emacs rings the bell on end of buffer, and other
49 ;;; unecessary times.
50 (setq ring-bell-function 'ignore)
52 (defalias 'yes-or-no-p 'y-or-n-p)
54 ;;; The default assumes far less capable hardware than I usually
55 ;;; operate.
56 (setq large-file-warning-threshold 100000000)
58 ;;; Make sure, no matter what, ediff uses one frame.
59 (setq ediff-window-setup-function 'ediff-setup-windows-plain)
61 ;;; Minibuffer tab completion.
62 (icomplete-mode)
64 (when (require 'ido nil t)
65 (ido-mode 1)
66 (ido-everywhere))
68 ;;; Slightly simplified by preferring ansi-term defaults.
69 (when (require 'term nil t)
70 ;; Many programs (including grml zsh) (seem to) assume this
71 ;; behavior.
72 (setq term-scroll-to-bottom-on-output 'this)
73 (setq term-scroll-show-maximum-output t))
75 ;;; Follow compile errors with tab.
76 (add-hook 'compilation-mode-hook 'next-error-follow-minor-mode)
78 ;;; By default, moving the point past the bottom of a page in docview
79 ;;; does not jump to next page.
80 (setq doc-view-continuous t)
82 ;;; Enable some "confusing" commands.
83 (put 'set-goal-column 'disabled nil)
84 (put 'erase-buffer 'disabled nil)
85 (put `upcase-region `disabled nil)
86 (put `downcase-region `disabled nil)
87 (put 'dired-find-alternate-file 'disabled nil)
89 ;;; The defaults in this case are S-<arrow keys>.
90 (windmove-default-keybindings)
92 (global-set-key (kbd "C-c p") 'proced)
93 (global-set-key (kbd "C-c b") 'bury-buffer)
94 (global-set-key (kbd "C-c d") 'yard-toggle-window-dedication)
95 (global-set-key (kbd "C-c q") 'yard-quit-other-window)
96 (global-set-key (kbd "C-c r") 'yard-root-find-file)
97 (global-set-key (kbd "C-c c") 'save-buffers-kill-emacs)
99 (define-key emacs-lisp-mode-map (kbd "M-.")
100 'yard-find-function-at-point)
102 (define-key emacs-lisp-mode-map (kbd "M-*")
103 'yard-pop-find-symbol-stack)
105 ;;; Aristotelean scrolling maps better to the hardware I use.
106 (setq mouse-wheel-progressive-speed nil)
108 (setq focus-follows-mouse t)
109 (setq mouse-autoselect-window t)
110 (setq mouse-yank-at-point t)
112 (define-key emacs-lisp-mode-map (kbd "<C-S-mouse-1>")
113 (lambda (event prefix-arg)
114 (interactive "@e
116 (mouse-set-point event)
117 (yard-find-function-at-point prefix-arg)))
119 (define-key emacs-lisp-mode-map (kbd "<mouse-9>")
120 'yard-pop-find-symbol-stack)
122 (when (require 'help-mode nil t)
123 (define-key help-mode-map (kbd "<mouse-8>") 'help-go-forward)
124 (define-key help-mode-map (kbd "<mouse-9>") 'help-go-back))