-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomshortkeys.el
86 lines (71 loc) · 3.19 KB
/
customshortkeys.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
;; search ag
(global-set-key (kbd "C-(") (lambda ()
(interactive)
(let (term dest)
(setq term (read-string (format "expression (%s): " (thing-at-point 'word))
nil nil (thing-at-point 'word)))
(setq dest (read-string (format "directory (%s): " (thing-at-point 'word))
nil nil (thing-at-point 'word)))
(ag term dest))))
(global-set-key (kbd "C-)") (lambda ()
(interactive 2)
(projectile-ag)))
;; writeroom-mode-global
(global-set-key (kbd "M-RET r") 'writeroom-mode)
;; mc-edit lines
(global-set-key (kbd "M-RET e") 'mc/edit-lines)
;; (define-key global-key-binding (kbd "<C-'") 'mc-edit-lines)
;; (global-set-key (kbd "C-'") 'mc/mark-next-sexps)
;; (global-set-key (kbd "C-\"") 'mc/mark-next-sexps)
;; Follow File (for imports, includes, input etc).
(global-set-key (kbd "M-RET f") 'find-file-at-point)
(global-set-key (kbd "M-RET >") 'mc/mark-next-like-this)
(global-set-key (kbd "M-RET <") 'mc/mark-previous-like-this)
(global-set-key (kbd "M-RET C->") 'mc/mark-all-like-this)
(global-set-key (kbd "M-RET '") 'mc/edit-lines)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;; v2
;; writeroom-mode-global
(global-set-key (kbd "C-c r") 'writeroom-mode)
;; mc-edit lines
(global-set-key (kbd "C-c e") 'mc/edit-lines)
;; (define-key global-key-binding (kbd "<C-'") 'mc-edit-lines)
(global-set-key (kbd "C-c '") 'mc/mark-next-sexps)
(global-set-key (kbd "C-c \"") 'mc/mark-next-sexps)
(global-set-key (kbd "C-c c >") 'mc/mark-next-like-this)
(global-set-key (kbd "C-c c <") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c c C->") 'mc/mark-all-like-this)
;;;;;;;;;;;;
;; swap windows
(global-set-key (kbd "C-c s") 'swap-buffers)
;; fast narrrow
(global-set-key (kbd "C-c n") 'narrow-to-region)
;; duplicate the current line or region
(global-set-key (kbd "C-c d") 'move-dup-duplicate-down)
;;(global-set-key (kbd "C-c d") 'duplicate-current-line-or-region)
;; search with google
(global-set-key (kbd "C-c g") 'google-this)
;; parenthesis related commands
;;(global-set-key (kbd "") `paren-face)
;; smartparens-mode keybindings
(global-set-key (kbd "C-c p k") 'sp-kill-sexp)
(global-set-key (kbd "C-c p u") 'sp-unwrap-sexp)
(global-set-key (kbd "C-c p r") 'sp-raise-sexp)
(global-set-key (kbd "C-c p n") 'sp-next-sexp)
(global-set-key (kbd "C-c p p") 'sp-previous-sexp)
(global-set-key (kbd "C-c p d") 'sp-down-sexp)
(require 'key-chord)
(key-chord-mode t)
;; from: https://www.emacswiki.org/emacs/KeyChord
;; Max time delay between two key presses to be considered a key chord
(setq key-chord-two-keys-delay 0.1) ; default 0.1
;; Max time delay between two presses of the same key to be considered a key chord.
;; Should normally be a little longer than `key-chord-two-keys-delay'.
(setq key-chord-one-key-delay 0.15)
;;
;;(global-set-key (kbd "C-@") 'er/expand-region)
(key-chord-define-global "fs" 'er/expand-region)
(key-chord-define-global "ds" 'md-duplicate-down)
(key-chord-define-global "sd" 'fit-window-to-buffer)