-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinds.el
65 lines (49 loc) · 1.71 KB
/
binds.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
;;---------------------Binds----------------------
; Scroll and recenter the text
(global-set-key "\M-n" 'my-down-scroll)
(global-set-key "\M-p" 'my-up-scroll)
; Delete words without changing the kill-ring
(global-set-key (kbd "M-d") 'my-delete-word)
(global-set-key (kbd "<M-backspace>") 'my-backward-delete-word)
; Work with macros
(defun toggle-kbd-macro-recording-on ()
"One-key keyboard macros: turn recording on."
(interactive)
(define-key global-map (this-command-keys)
'toggle-kbd-macro-recording-off)
(start-kbd-macro nil))
(defun toggle-kbd-macro-recording-off ()
"One-key keyboard macros: turn recording off."
(interactive)
(define-key global-map (this-command-keys)
'toggle-kbd-macro-recording-on)
(end-kbd-macro))
; Macro bindings
(global-set-key '[(f1)] 'call-last-kbd-macro)
(global-set-key '[(shift f1)] 'toggle-kbd-macro-recording-on)
; Search and Replace
(global-set-key [f4] 'query-replace)
; Refresh a buffer
(global-set-key [f5] 'revert-buffer)
; Execute shell
(global-set-key [S-f5] 'eshell)
; Make the buffer small
(global-set-key (quote [M-down]) 'enlarge-window)
; Make buffer bigger
(global-set-key (quote [M-up]) 'shrink-window)
; Shrink buffer horizontally
(global-set-key (quote [M-left]) 'shrink-window-horizontally)
; Shrink buffer vertically
(global-set-key (quote [M-right]) 'enlarge-window-horizontally)
; Delete with SUPR and DEL keys
(global-set-key [delete] 'delete-char)
(global-set-key [kp-delete] 'delete-char)
; Do not overwrite with insert
(global-set-key [insert]
(function
(lambda () (interactive)
(message "Sorry, overwrite mode has been disabled forever."))))
;Compile
(global-set-key [f8] 'compile)
;Recompile
(global-set-key [f9] 'recompile)