-
Notifications
You must be signed in to change notification settings - Fork 0
/
shortcuts.el
executable file
·65 lines (47 loc) · 1.8 KB
/
shortcuts.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
;; Alias ctrl x ctrl m for alt m
(define-key global-map "\C-x\C-p" 'revert-buffer)
(define-key global-map "\M-g" 'goto-line)
(define-key global-map "\C-x\C-g" 'helm-projectile)
;; control a to begining of statement instead of line
(global-set-key (kbd "C-a") 'back-to-indentation)
;; make ctrl z undo, as well as ctrl x ctrl u
(global-set-key "\C-z" 'undo)
(global-set-key "\C-x\C-u" 'undo)
;; auto indent after new line
(define-key global-map (kbd "RET") 'newline-and-indent)
;; short cut to shell
(global-set-key (kbd "\C-c 5") 'eshell)
(global-set-key (kbd "\C-c 7") 'shell)
;; shortcuts i like
(global-set-key (kbd "\C-c \C-t") 'lisp-complete-symbol)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(global-set-key (kbd "<f8>") 'ielm)
;; usually bound to M-SPC which is taken by OSX
(global-set-key (kbd "M-m") 'just-one-space)
(defun switch-to-previous-buffer()
"Goes to the last buffer"
(interactive)
(switch-to-buffer (other-buffer)))
(global-set-key (kbd "\C-q") 'switch-to-previous-buffer)
;; delete pair (will delete matching "" or ())
(global-set-key "\M-sd" 'delete-pair)
(global-set-key "\M-sf" 'flyspell-correct-word-before-point)
(require 'recentf)
;; enable recent files mode.
(recentf-mode t)
; 50 files ought to be enough.
(setq recentf-max-saved-items 50)
(defun ido-recentf-open ()
"Use `ido-completing-read' to \\[find-file] a recent file"
(interactive)
(if (find-file (ido-completing-read "Find recent file: " recentf-list))
(message "Opening file...")
(message "Aborting")))
;; get rid of `toggle-read-only' and replace it with something
;; more useful.
;;(global-set-key (kbd "C-x C-q") 'ido-recentf-open)
(global-set-key (kbd "C-c i") 'dirs)
;; minimize is just annoying
(global-unset-key (kbd "C-x C-z"))