-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-keybinds.el
97 lines (79 loc) · 2.88 KB
/
my-keybinds.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
91
92
93
94
95
96
;;; my-keybinds --- Global keybindings
;;
;; Copyright (C) 2014 Alex Bennée
;;
;; Author: Alex Bennée <[email protected]>
;;
;; This file is not part of GNU Emacs.
;;
;; This file 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, or (at your option)
;; any later version.
;;
;;; Commentary:
;;
;; All my global keybinds in here that aren't mode specific.
;;
;; I'm allowed to bind: C-c [letter], [f5]-[f9]
;;
;; NB I've also re-mapped Caps-Lock to control
;;
;;; Code:
;; Function Keys, I'm currently going over what my Microsoft ergonomic
;; keyboard has sentsiled on the function keys
; Find help
(global-set-key (kbd "<C-f1>") 'apropos)
; Make Undo a little less octopedal
(global-set-key (kbd "<f2>") 'undo)
;; In Emacs 21+, home and end go to beginning and end of line. This is
;; clearly the Wrong Thing.
(when I-am-emacs-21+
(global-unset-key [home])
(global-set-key [home] 'beginning-of-buffer)
(global-unset-key [end])
(global-set-key [end] 'end-of-buffer))
;; Macro keys
; If I define a single press macro keys I may use them more often
(global-set-key [(control meta m)] 'call-last-kbd-macro)
(global-set-key (kbd "<f10>") 'call-last-kbd-macro)
(global-set-key (kbd "<C-f11>") 'start-kbd-macro)
(global-set-key (kbd "<C-f12>") 'end-kbd-macro)
; This stops warnings with re-mapped
; return (when using xcape)
(global-set-key (kbd "<key-4660>") 'ignore)
;; This gets over-ridden when company/auto-complete is in effect
(global-set-key (kbd "M-/") 'hippie-expand)
;; Goto-line should be easy
(global-set-key "\C-cg" 'goto-line)
(global-set-key "\M-g" 'goto-line)
;; Return => newline-and-indent
(global-unset-key "\C-m")
(global-set-key "\C-m" 'newline-and-indent)
(global-set-key (kbd "M-SPC") 'cycle-spacing)
;; Make delete do what I expect
;? Do I still need this?
(global-unset-key [delete])
(global-set-key [delete] 'delete-char)
;; C-z is too easy to hit (you can still C-x C-z to suspend)
(global-unset-key (kbd "C-z"))
;; C-k deletes whole line
(global-set-key "\C-k" 'kill-whole-line)
;; Let's also do Alt-X and easier way
(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
;; Basic buffer navigation
(global-set-key (kbd "<C-tab>") 'pop-global-mark)
;; maps to C-c page-up/down
(global-set-key (kbd "C-c <prior>") 'previous-buffer)
(global-set-key (kbd "C-c <next>") 'next-buffer)
;; Handle next/prev error on keymap / and * (with numlock off)
(global-set-key (kbd "M-O o") 'previous-error)
(global-set-key [kp-divide] 'previous-error)
(global-set-key (kbd "M-O j") 'next-error)
(global-set-key [kp-multiply] 'next-error)
;; above don't seem to preserve across mosh sessions
(global-set-key (kbd "<f7>") 'previous-error)
(global-set-key (kbd "<f8>") 'next-error)
(provide 'my-keybinds)
;;; my-keybinds.el ends here