-
Notifications
You must be signed in to change notification settings - Fork 0
/
+clipboard.el
71 lines (54 loc) · 2.1 KB
/
+clipboard.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
;;; ~/.doom.d/+clipboard.el -*- lexical-binding: t; -*-
(defun evil-paste-after-from-0 ()
(interactive)
(let ((evil-this-register ?0))
(call-interactively 'evil-paste-after)))
(defun evil-paste-after-from-clip ()
(interactive)
(let ((evil-this-register ?+))
(call-interactively 'evil-paste-after)))
(defun evil-x-as-cut ()
(interactive)
(let ((evil-this-register ?0))
(call-interactively 'evil-delete-char)))
(defun evil-c-into-void()
(interactive)
(let ((evil-this-register ?_))
(call-interactively 'evil-change)))
(defun evil-d-into-void()
(interactive)
(let ((evil-this-register ?_))
(call-interactively 'evil-delete)))
(defun evil-dd-into-void()
(interactive)
(let ((evil-this-register ?_))
(call-interactively 'evil-delete-whole-line)))
(define-key evil-normal-state-map "p" 'evil-paste-after-from-0)
(define-key evil-normal-state-map "x" 'evil-x-as-cut)
;; (define-key evil-normal-state-map "d" 'evil-d-into-void)
;; (define-key evil-normal-state-map "dd" 'evil-dd-into-void)
;; Key definitions w/o map macro
(general-define-key
:states 'normal "c"
(general-key-dispatch 'evil-c-into-void
"s" 'evil-surround-edit
"S" 'evil-Surround-edit
"w" (general-simulate-key ('evil-c-into-void "iw"))
"W" (general-simulate-key ('evil-c-into-void "iW"))
"\"" (general-simulate-key ('evil-c-into-void "i\""))
"\'" (general-simulate-key ('evil-c-into-void "i\'"))
"\(" (general-simulate-key ('evil-c-into-void "i\("))
"\)" (general-simulate-key ('evil-c-into-void "i\)"))
"{" (general-simulate-key ('evil-c-into-void "i{"))
"}" (general-simulate-key ('evil-c-into-void "i}"))
"\[" (general-simulate-key ('evil-c-into-void "i\]"))
"\]" (general-simulate-key ('evil-c-into-void "i\["))
"<" (general-simulate-key ('evil-c-into-void "i<"))
">" (general-simulate-key ('evil-c-into-void "i>"))))
(general-define-key
:states 'normal "d"
(general-key-dispatch 'evil-d-into-void
"d" 'evil-dd-into-void))
(define-key evil-insert-state-map (kbd "C-V") 'evil-paste-after-from-clip)
;; Shits bugged work around
(define-key evil-normal-state-map "C" 'evil-change)