Mercurial > dotfiles
annotate .elisp/settings/90.keybindings.el @ 236:3e1ec121efaf
emacs: use smex as a replacement for execute-extended-command
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sat, 18 Dec 2010 10:39:18 -0600 |
parents | 5dbff8b65be7 |
children | 5fd871a98b5f |
rev | line source |
---|---|
77 | 1 ;; Key Bindings |
2 ; M-backspace kills the current buffer | |
3 (global-set-key [(meta backspace)] 'kill-this-buffer) | |
190
5dbff8b65be7
emacs: switch ways of defining M-backsp
Augie Fackler <durin42@gmail.com>
parents:
177
diff
changeset
|
4 (global-set-key "\M-\d" 'kill-this-buffer) |
77 | 5 ; Save early and often, with only one keystroke |
6 (global-set-key [(meta s)] 'save-buffer) | |
7 ; Typing tab is for lesser editors, make hitting return do that | |
128
d59b0340a85a
Man, this is what I wanted all along.
Augie Fackler <durin42@gmail.com>
parents:
126
diff
changeset
|
8 (global-set-key "\C-m" 'indent-new-comment-line) |
77 | 9 ; M-l makes more sense to me for jumping to a line |
10 (global-set-key "\M-l" 'goto-line) | |
11 ; Sometimes C-h is what Backspace sends in a terminal, and I never use C-h | |
12 (global-set-key "\C-h" 'backward-delete-char-untabify) | |
13 ; M-t is what I want for the textmate file finding | |
14 (global-set-key [(meta t)] 'textmate-goto-file) | |
126 | 15 ; M-p for bouncing to the matching paren |
16 (global-set-key [(meta p)] 'bounce-to-other-paren) | |
101 | 17 (global-set-key [(meta control f)] 'textmate-find-in-project-type) |
126 | 18 (global-set-key [(meta shift f)] 'textmate-find-in-project) |
77 | 19 (global-set-key [(meta m)] 'iconify-or-deiconify-frame) |
20 (global-set-key [(control backspace)] 'kill-word) | |
95
df45e402581c
Save in server buffer also marks as done.
Augie Fackler <durin42@gmail.com>
parents:
77
diff
changeset
|
21 |
168
efe94205bf07
emacs: bind f3 to next-error
Augie Fackler <durin42@gmail.com>
parents:
141
diff
changeset
|
22 (global-set-key [f3] 'next-error) |
177
70dcdb2acade
emacs keybindings: f5 for diff-apply-hunk
Augie Fackler <durin42@gmail.com>
parents:
168
diff
changeset
|
23 (global-set-key [f5] 'diff-apply-hunk) |
168
efe94205bf07
emacs: bind f3 to next-error
Augie Fackler <durin42@gmail.com>
parents:
141
diff
changeset
|
24 |
101 | 25 ;; M-j for jump to function definition |
141
e30655eb7050
textmate.el: synced with upstream
Augie Fackler <durin42@gmail.com>
parents:
128
diff
changeset
|
26 (global-set-key [(meta j)] 'textmate-goto-symbol) |
101 | 27 |
28 ;; commit emacs heresy? | |
236
3e1ec121efaf
emacs: use smex as a replacement for execute-extended-command
Augie Fackler <durin42@gmail.com>
parents:
190
diff
changeset
|
29 (global-set-key [(meta r)] 'smex) |
3e1ec121efaf
emacs: use smex as a replacement for execute-extended-command
Augie Fackler <durin42@gmail.com>
parents:
190
diff
changeset
|
30 (global-set-key (kbd "M-R") 'smex-major-mode-commands) |
101 | 31 |
32 ;; Mac-like keybindings for undo/cut/copy/paste | |
33 (global-set-key [(meta c)] 'kill-ring-save) | |
34 (global-set-key [(meta x)] 'kill-region) | |
35 (global-set-key [(meta z)] 'undo) | |
36 (global-set-key [(meta v)] 'yank) | |
37 (global-set-key [M-return] 'fullscreen) | |
38 (global-set-key [(control v)] 'yank-pop) | |
39 | |
40 ;; Fixup hooks for modes that like taking my keys back | |
41 (add-hook 'text-mode-hook '(lambda () | |
42 (define-key text-mode-map "\M-s" | |
43 'save-buffer))) | |
44 (add-hook 'comint-mode-hook '(lambda () | |
45 (local-set-key "\M-r" | |
46 'execute-extended-command))) | |
47 | |
95
df45e402581c
Save in server buffer also marks as done.
Augie Fackler <durin42@gmail.com>
parents:
77
diff
changeset
|
48 (defun server-save-buffer-and-finish () |
df45e402581c
Save in server buffer also marks as done.
Augie Fackler <durin42@gmail.com>
parents:
77
diff
changeset
|
49 (interactive) |
df45e402581c
Save in server buffer also marks as done.
Augie Fackler <durin42@gmail.com>
parents:
77
diff
changeset
|
50 (save-buffer) (server-edit)) |
df45e402581c
Save in server buffer also marks as done.
Augie Fackler <durin42@gmail.com>
parents:
77
diff
changeset
|
51 (add-hook 'server-switch-hook |
df45e402581c
Save in server buffer also marks as done.
Augie Fackler <durin42@gmail.com>
parents:
77
diff
changeset
|
52 '(lambda ()(local-set-key "\M-s" 'server-save-buffer-and-finish ))) |