/
config-bindings.el
90 lines (73 loc) · 3.11 KB
/
config-bindings.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
;;; config-bindings.el --- Some default key bindings.
;;
;; Copyright (C) 2008-2010 Phil Hagelberg and contributors
;; Copyright (C) 2011 Yesudeep Mangalapilly
;;
;; Author: Yesudeep Mangalapilly <yesudeep@gmail.com>
;; Keywords: convenience
;; Package-Requires:: ((starter-kit "2.0.1"))
;;
;; This file is not a part of GNU Emacs.
;;
;;; License:
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
(progn
;;; Based on the starter-kit-bindings.el package.
;; Font size
(define-key global-map (kbd "C-+") 'text-scale-increase)
(define-key global-map (kbd "C--") 'text-scale-decrease)
(define-key global-map (kbd "C-=") 'text-scale-increase)
;; Use regex searches by default
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "\C-r") 'isearch-backward-regexp)
(global-set-key (kbd "C-M-s") 'isearch-forward)
(global-set-key (kbd "C-M-r") 'isearch-backward)
;; Jump to a definition in the current file. (Protip: this is
;; awesome.)
(global-set-key (kbd "C-x C-i") 'esk-ido-menu)
;; File finding
(global-set-key (kbd "C-x M-f") 'ido-find-file-other-window)
(global-set-key (kbd "C-x f") 'esk-recentf-ido-find-file)
(global-set-key (kbd "C-c y") 'bury-buffer)
(global-set-key (kbd "C-c r") 'revert-buffer)
;; Should be able to eval-and-replace anywhere.
(global-set-key (kbd "C-c e") 'esk-eval-and-replace)
;; Line movement.
(global-set-key (kbd "M-<up>") 'move-line-up)
(global-set-key (kbd "M-<down>") 'move-line-down)
;; Automatically indent on return.
(define-key global-map (kbd "RET") 'newline-and-indent)
;; Killing and yanking.
(define-key global-map (kbd "<delete>") 'delete-char)
(define-key global-map (kbd "M-<delete>") 'kill-word)
(global-set-key (kbd "C-k") 'kill-whole-line)
(global-set-key (kbd "C-S-<backspace>") 'kill-and-join-forward)
;; Line insertion
(global-set-key (kbd "C-S-<return>") 'insert-empty-line-above)
(global-set-key (kbd "S-<return>") 'insert-empty-line-below)
(global-set-key (kbd "s-<return>") 'insert-empty-line-below-next-line)
;; Clean up whitespace
(global-set-key (kbd "C-c n") 'tidy-buffer)
;; Fix the mac delete key.
;;(global-set-key (kbd "<kp-delete>") 'delete-forward-char)
;;(global-set-key (kbd "C-<kp-delete>") 'kill-word)
;;;;(define-key global-map (kbd "<kp-delete>") 'delete-forward-char)
;;;;(define-key global-map [\d] 'delete-forward-char)
)
(provide 'config-bindings)
;;; config-bindings.el ends here