This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
init-keybindings.el
51 lines (36 loc) · 1.58 KB
/
init-keybindings.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
;;; Global keyboard combinations
;; Unset GNUs since it clashes with C-x C-m and I don't use it
(global-unset-key (kbd "C-x m"))
;; unset M-x due to smex
(global-unset-key (kbd "M-x"))
(global-set-key (kbd "C-x C-b") 'ibuffer)
;; Use hippie-expand instead of dabbrev
(global-set-key (kbd "M-/") 'hippie-expand)
;; Copy readline's kill word
(global-set-key (kbd "C-w") 'backward-kill-word)
;; Since we've unset C-w, map it to something else
(global-set-key (kbd "C-x C-k") 'kill-region)
;; ... and the clumsy version
(global-set-key (kbd "C-c C-k") 'kill-region)
(global-set-key (kbd "C-c y") 'bury-buffer)
(global-set-key (kbd "C-c r") 'revert-buffer)
;; prompt before quitting
(global-set-key (kbd "C-x C-c") 'bw-kill-emacs)
(global-set-key (kbd "C-c x") 'server-edit)
(global-set-key (kbd "C-c m") 'manual-entry)
(global-set-key (kbd "C-c o") 'occur)
(define-key occur-mode-map (kbd "v") 'occur-mode-display-occurrence)
(define-key occur-mode-map (kbd "n") 'next-line)
(define-key occur-mode-map (kbd "p") 'previous-line)
;; terminal-related bindings
(global-set-key (kbd "C-c t") 'bw-open-term)
(global-set-key (kbd "C-c C-t t") 'ansi-term)
(global-set-key (kbd "C-c C-t e") 'eshell)
;; mnemonic keybindings for window splitting (copies my tmux bindings)
(global-set-key (kbd "C-x |") 'split-window-right)
(global-set-key (kbd "C-x -") 'split-window-below)
(global-set-key (kbd "C-c C-b") 'org-iswitchb)
(global-set-key (kbd "C-c s") 'bw-switch-to-scratch)
(global-set-key (kbd "C-h C-f") 'find-function)
(global-set-key (kbd "M-p") 'magit-find-file-completing-read)
(provide 'init-keybindings)