-
Notifications
You must be signed in to change notification settings - Fork 34
/
boon-qwerty.el
125 lines (92 loc) · 4.2 KB
/
boon-qwerty.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
;;; boon-qwerty.el --- An Ergonomic Command Mode -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(require 'boon)
(define-key boon-select-map "q" 'boon-select-outside-quotes)
(define-key boon-select-map "w" 'boon-select-word)
(define-key boon-select-map "g" 'boon-select-paragraph)
(define-key boon-select-map "a" 'boon-select-borders) ;; Around
(define-key boon-select-map "s" 'boon-select-wim) ;; symbol
(define-key boon-select-map "v" 'boon-select-with-spaces)
(define-key boon-select-map "d" 'boon-select-document)
(define-key boon-select-map "C" 'boon-select-comment)
(define-key boon-select-map "x" 'boon-select-outside-pairs) ;; eXpression
(define-key boon-select-map "c" 'boon-select-inside-pairs) ;; Contents
(define-key boon-select-map "z" 'boon-select-content) ;; inZide
(define-key boon-select-map "b" 'boon-select-blanks) ;; blanKs
(define-key boon-moves-map "n" '("noon walk" . boon-switch-mark))
(define-key boon-moves-map "N" 'xref-pop-marker-stack)
(define-key boon-moves-map "y" '("fYnd" . xref-find-definitions))
(define-key boon-moves-map "Y" 'xref-find-references)
(define-key boon-moves-map "i" 'previous-line)
(define-key boon-moves-map "o" 'next-line)
(define-key boon-moves-map "I" 'backward-paragraph)
(define-key boon-moves-map "O" 'forward-paragraph)
(define-key boon-moves-map "u" 'boon-beginning-of-line)
(define-key boon-moves-map "p" 'boon-end-of-line)
(define-key boon-moves-map "j" 'boon-smarter-backward)
(define-key boon-moves-map ";" 'boon-smarter-forward)
(define-key boon-moves-map "K" 'boon-smarter-upward)
(define-key boon-moves-map "L" 'boon-smarter-downward)
(define-key boon-moves-map "," 'boon-beginning-of-expression)
(define-key boon-moves-map "." 'boon-end-of-expression)
(define-key boon-moves-map "k" 'backward-char)
(define-key boon-moves-map "l" 'forward-char)
(define-key boon-moves-map "<" 'beginning-of-buffer)
(define-key boon-moves-map ">" 'end-of-buffer)
(define-key boon-moves-map "h" '("hop" . avy-goto-word-1))
(define-key boon-moves-map "H" 'avy-goto-char)
;; Special keys
;; LEFT HAND
;; Top row
;; q
(define-key boon-command-map "q" '("quote" . boon-quote-character))
;; w,e
;; where is? elsewhere?
(define-key boon-moves-map "w" '("where was?" . boon-backward-search-map))
(define-key boon-moves-map "e" '("elsewhere?" . boon-forward-search-map))
(define-key boon-moves-map "W" 'boon-qsearch-previous)
(define-key boon-moves-map "E" 'boon-qsearch-next)
;; r
(define-key boon-command-map "r" '("occuR" . occur))
(define-key boon-command-map "R" 'kmacro-start-macro) ; Record
;; Misc crap
(define-key boon-command-map "P" 'kmacro-end-or-call-macro) ; Play
(define-key boon-command-map "X" 'boon-highlight-regexp)
;; t
(define-key boon-command-map "t" '("transform" . boon-replace-by-character))
;; home row
;; a
(define-key boon-command-map "a" '("around" . boon-enclose))
;; s
(define-key boon-command-map "s" '("substitute" . boon-substitute-region))
;; d
(define-key boon-command-map "d" '("delete" . boon-take-region)) ; "delete"
(define-key boon-command-map "D" 'boon-treasure-region) ; "duplicate"
;; f
(define-key boon-command-map "f" '("fetch" . boon-splice))
(define-key boon-command-map "F" 'yank-pop)
;; g
(define-key boon-command-map "g" '("goto" . boon-goto-map))
;; Bottom row
;; z
(define-key boon-command-map "z" '("repeat" . boon-repeat-command))
;; x
(define-key boon-command-map "x" 'boon-x-map)
;; c
(define-key boon-command-map "c" 'boon-c-god)
;; v
(define-key boon-command-map (kbd "C-v") 'boon-open-line-and-insert)
(define-key boon-command-map "V" 'boon-open-next-line-and-insert)
(define-key boon-command-map "v" '("v looks like an insert mark" . boon-set-insert-like-state))
;; b
(define-key boon-command-map "B" 'boon-copy-to-register) ; bank
(define-key boon-command-map "b" 'insert-register)
;; RIGHT HAND: movement and marking commands.
;; Most of these are actually in the boon-moves-map; however some don't quite work there; so they end up here.
(define-key boon-command-map (kbd "C-k") 'scroll-down-line)
(define-key boon-command-map (kbd "C-l") 'scroll-up-line)
(define-key indent-rigidly-map "k" 'indent-rigidly-right)
(define-key indent-rigidly-map "l" 'indent-rigidly-left)
(provide 'boon-qwerty)
;;; boon-qwerty.el ends here