forked from jyp/boon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boon-emacs.el
119 lines (103 loc) · 5.35 KB
/
boon-emacs.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
;; boon-emacs.el --- Emacs idiomatic key bindings for boon. -*- lexical-binding: t; -*-
;; Copyright (C) 2019-2020 Bernd Rellermeyer
;; Author: Bernd Rellermeyer <[email protected]>
;; Keywords: convenience
;; Version: 2.0
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; This file defines Emacs idiomatic or mnemonic key bindings for
;; boon.
;;; Code:
(require 'boon)
(define-key boon-goto-map ":" 'avy-go-to-char)
(define-key boon-goto-map "'" 'avy-go-to-char-2)
(define-key boon-goto-map "f" 'avy-go-to-line)
(define-key boon-goto-map "w" 'avy-go-to-word-1)
(define-key boon-goto-map "e" 'avy-go-to-word-0)
(define-key boon-select-map "w" 'boon-select-word)
(define-key boon-select-map "h" 'boon-select-paragraph)
(define-key boon-select-map "H" 'boon-select-document)
(define-key boon-select-map "s" 'boon-select-wim)
(define-key boon-select-map "S" 'boon-select-sentence)
(define-key boon-select-map "r" 'boon-select-justline)
(define-key boon-select-map "g" 'boon-select-block)
(define-key boon-select-map "q" 'boon-select-outside-quotes)
(define-key boon-select-map "x" 'boon-select-outside-pairs)
(define-key boon-select-map "c" 'boon-select-inside-pairs)
(define-key boon-select-map "C" 'boon-select-comment)
(define-key boon-select-map "V" 'boon-select-blanks)
(define-key boon-select-map "v" 'boon-select-with-spaces)
(define-key boon-select-map "z" 'boon-select-content)
(define-key boon-select-map "t" 'boon-select-borders)
(define-key boon-select-map "T" 'boon-select-org-tree)
(define-key boon-select-map "G" 'boon-select-org-table-cell)
(define-key boon-moves-map "x" 'boon-switch-mark)
(define-key boon-moves-map "p" '("previous" . previous-line))
(define-key boon-moves-map "n" '("next" . next-line))
(define-key boon-moves-map "{" 'backward-paragraph)
(define-key boon-moves-map "}" 'forward-paragraph)
(define-key boon-moves-map "A" 'backward-sentence)
(define-key boon-moves-map "E" 'forward-sentence)
(define-key boon-moves-map "a" 'boon-beginning-of-line)
(define-key boon-moves-map "e" 'boon-end-of-line)
(define-key boon-moves-map "B" 'boon-smarter-backward)
(define-key boon-moves-map "F" 'boon-smarter-forward)
(define-key boon-moves-map "P" 'boon-smarter-upward)
(define-key boon-moves-map "N" '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 "b" '("backward" . backward-char))
(define-key boon-moves-map "f" '("forward" . forward-char))
(define-key boon-moves-map "<" 'beginning-of-buffer)
(define-key boon-moves-map ">" 'end-of-buffer)
(define-key boon-moves-map "r" 'boon-backward-search-map)
(define-key boon-moves-map "s" 'boon-forward-search-map)
(define-key boon-moves-map "R" 'boon-qsearch-previous)
(define-key boon-moves-map "S" 'boon-qsearch-next)
;; Some key bindings defined in boon-key.el are modified in order to
;; make some Special mode-like key bindings. They are commented out
;; by default.
;; (define-key boon-command-map "_" 'undo)
;; (define-key boon-command-map "-" 'negative-argument)
;; (define-key boon-command-map "@" 'boon-drop-mark)
;; (define-key boon-command-map " " 'scroll-up-command)
;; (define-key boon-command-map [?\S-\ ] 'scroll-down-command)
;; (define-key boon-command-map "\C-?" 'scroll-down-command)
;; (define-key boon-command-map [S-backspace] 'scroll-up-command)
;; (define-key boon-command-map [S-delete] 'scroll-up-command)
(define-key boon-command-map "\"" 'boon-quote-character)
(define-key boon-command-map "X" 'boon-highlight-regexp)
(define-key boon-command-map "t" '("transform" . boon-replace-by-character))
(define-key boon-command-map "T" 'boon-enclose)
(define-key boon-command-map "w" 'boon-take-region)
(define-key boon-command-map "W" 'boon-treasure-region)
(define-key boon-command-map "y" '("yank" . boon-splice))
(define-key boon-command-map "Y" 'yank-pop)
(define-key boon-command-map "g" '("goto" . boon-goto-map))
(define-key boon-command-map "z" 'boon-repeat-command)
(define-key boon-command-map "x" 'boon-x-map)
(define-key boon-command-map "c" 'boon-c-god)
(define-key boon-command-map "o" '("open" . boon-open-next-line-and-insert))
(define-key boon-command-map "O" 'boon-open-line-and-insert)
(define-key boon-command-map "i" '("insert" . boon-set-insert-like-state))
(define-key boon-command-map "I" 'boon-substitute-region)
(define-key boon-command-map "j" 'scroll-up-line)
(define-key boon-command-map "k" 'scroll-down-line)
(define-key boon-command-map "?" 'describe-mode)
(define-key boon-command-map "h" 'describe-mode)
(define-key boon-command-map "q" '("quit" . quit-window))
(define-key indent-rigidly-map "k" 'indent-rigidly-right)
(define-key indent-rigidly-map "l" 'indent-rigidly-left)
(provide 'boon-emacs)
;;; boon-emacs.el ends here