2015-11-09 15:25:20 +09:00
|
|
|
;;; boon-colemak.el --- An Ergonomic Command Mode -*- lexical-binding: t -*-
|
2014-10-19 14:17:46 +02:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;;; Code:
|
2016-08-31 21:58:55 +02:00
|
|
|
(require 'boon)
|
2014-10-19 14:17:46 +02:00
|
|
|
|
2015-11-30 23:22:50 +01:00
|
|
|
(define-key boon-select-map "q" 'boon-select-outside-quotes)
|
2016-08-30 21:18:36 +02:00
|
|
|
(define-key boon-select-map "w" 'boon-select-word)
|
2014-10-19 14:17:46 +02:00
|
|
|
(define-key boon-select-map "f" 'boon-select-word) ;; 'rf' is easier to type than 'rw'
|
2015-11-30 23:22:50 +01:00
|
|
|
(define-key boon-select-map "p" 'boon-select-paragraph)
|
|
|
|
(define-key boon-select-map "g" 'boon-select-org-table-cell)
|
|
|
|
|
|
|
|
(define-key boon-select-map "a" 'boon-select-borders) ;; Around
|
|
|
|
(define-key boon-select-map "r" 'boon-select-justline) ;; Row
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-select-map "s" '("symbol" . boon-select-wim)) ;; symbol
|
2015-11-30 23:22:50 +01:00
|
|
|
(define-key boon-select-map "t" 'boon-select-with-spaces)
|
|
|
|
(define-key boon-select-map "d" 'boon-select-document)
|
2016-09-04 09:16:54 +02:00
|
|
|
(define-key boon-select-map "b" 'boon-select-block)
|
2015-11-30 23:22:50 +01:00
|
|
|
|
|
|
|
(define-key boon-select-map "C" 'boon-select-comment)
|
2014-10-19 14:17:46 +02:00
|
|
|
(define-key boon-select-map "x" 'boon-select-outside-pairs) ;; eXpression
|
|
|
|
(define-key boon-select-map "c" 'boon-select-inside-pairs) ;; Contents
|
2015-11-30 23:22:50 +01:00
|
|
|
|
2014-10-19 14:17:46 +02:00
|
|
|
(define-key boon-select-map "z" 'boon-select-content) ;; inZide
|
|
|
|
|
2016-11-15 22:07:43 +01:00
|
|
|
(define-key boon-select-map "k" '("blanks" . boon-select-blanks))
|
2014-12-20 22:19:05 +01:00
|
|
|
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-moves-map "k" '("bacK to marK" . boon-switch-mark)) ; bacK to marK
|
2016-09-28 21:38:48 +02:00
|
|
|
(define-key boon-moves-map "K" 'xref-pop-marker-stack)
|
2014-10-19 13:59:12 +02:00
|
|
|
|
2016-11-14 13:30:41 +01:00
|
|
|
(define-key boon-moves-map "j" '("jump" . xref-find-definitions))
|
2016-09-28 21:38:48 +02:00
|
|
|
(define-key boon-moves-map "J" 'xref-find-references)
|
2016-11-14 13:30:41 +01:00
|
|
|
(define-key boon-moves-map "u" '("↑" . previous-line))
|
|
|
|
(define-key boon-moves-map "y" '("↓" . next-line))
|
2014-10-19 13:59:12 +02:00
|
|
|
(define-key boon-moves-map "U" 'backward-paragraph)
|
|
|
|
(define-key boon-moves-map "Y" 'forward-paragraph)
|
2016-11-14 13:30:41 +01:00
|
|
|
(define-key boon-moves-map "l" '("⇤" . boon-beginning-of-line))
|
|
|
|
(define-key boon-moves-map ";" '("⇥" . boon-end-of-line))
|
|
|
|
(define-key boon-moves-map "n" '("⇠" . boon-smarter-backward))
|
|
|
|
(define-key boon-moves-map "o" '("⇢" . boon-smarter-forward))
|
2016-08-28 08:16:40 +02:00
|
|
|
(define-key boon-moves-map "E" 'boon-smarter-upward)
|
|
|
|
(define-key boon-moves-map "I" 'boon-smarter-downward)
|
2016-11-14 13:30:41 +01:00
|
|
|
(define-key boon-moves-map "," '("↜" . boon-beginning-of-expression))
|
|
|
|
(define-key boon-moves-map "." '("↝" . boon-end-of-expression))
|
|
|
|
(define-key boon-moves-map "e" '("←" . backward-char))
|
|
|
|
(define-key boon-moves-map "i" '("→" . forward-char))
|
2015-11-25 22:13:12 +01:00
|
|
|
(define-key boon-moves-map "<" 'beginning-of-buffer)
|
|
|
|
(define-key boon-moves-map ">" 'end-of-buffer)
|
2015-10-21 22:26:15 +02:00
|
|
|
(define-key boon-moves-map "m" 'boon-qsearch-previous-at-point)
|
|
|
|
(define-key boon-moves-map "/" 'boon-qsearch-next-at-point)
|
2016-11-14 13:30:41 +01:00
|
|
|
(define-key boon-moves-map "h" '("hop" . avy-goto-word-1))
|
2015-11-25 22:13:12 +01:00
|
|
|
(define-key boon-moves-map "H" 'avy-goto-char)
|
2015-12-26 22:57:37 +01:00
|
|
|
|
2014-10-19 22:29:29 +02:00
|
|
|
;; Special keys
|
|
|
|
|
|
|
|
;; LEFT HAND
|
|
|
|
|
|
|
|
;; Top row
|
|
|
|
;; q
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-command-map "q" '("quote" . boon-quote-character))
|
2014-10-19 22:29:29 +02:00
|
|
|
|
|
|
|
;; w,f
|
|
|
|
;; where is? find?
|
2016-11-13 19:05:44 +01:00
|
|
|
(define-key boon-moves-map "w" '("where was?" . boon-backward-search-map))
|
|
|
|
(define-key boon-moves-map "f" '("find" . boon-forward-search-map))
|
2014-10-19 22:29:29 +02:00
|
|
|
|
|
|
|
(define-key boon-moves-map "ww" 'boon-qsearch-previous)
|
|
|
|
(define-key boon-moves-map "ff" 'boon-qsearch-next)
|
|
|
|
|
|
|
|
(define-key boon-moves-map "W" 'boon-qsearch-previous)
|
|
|
|
(define-key boon-moves-map "F" 'boon-qsearch-next)
|
|
|
|
|
|
|
|
;; p
|
|
|
|
;; Pinpoint Place
|
2016-11-15 22:07:43 +01:00
|
|
|
(define-key boon-command-map "p" '("pinpoint" . occur))
|
2014-10-19 22:29:29 +02:00
|
|
|
|
|
|
|
;; Misc crap
|
|
|
|
(define-key boon-command-map "P" 'kmacro-end-or-call-macro) ; Play
|
|
|
|
|
2016-11-08 21:38:01 +01:00
|
|
|
;; g
|
2016-11-16 19:59:36 +01:00
|
|
|
(define-key boon-command-map "g" '("goto" . boon-goto-map))
|
2014-10-19 22:29:29 +02:00
|
|
|
|
|
|
|
;; home row
|
|
|
|
;; a
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-command-map "a" '("around" . boon-enclose))
|
2014-10-19 22:29:29 +02:00
|
|
|
|
|
|
|
;; r
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-command-map "r" '("replace" . boon-substitute-region))
|
|
|
|
(define-key boon-command-map "R" '("Record" . kmacro-start-macro))
|
2014-10-19 22:29:29 +02:00
|
|
|
|
|
|
|
;; s
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-command-map "s" '("splice" . boon-splice))
|
2014-10-19 22:29:29 +02:00
|
|
|
(define-key boon-command-map "S" 'yank-pop)
|
|
|
|
|
|
|
|
;; t
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-command-map "t" '("take" . boon-take-region))
|
2014-10-19 22:29:29 +02:00
|
|
|
(define-key boon-command-map "T" 'boon-treasure-region) ; "treasure"
|
|
|
|
|
|
|
|
;; d
|
2016-11-15 22:07:43 +01:00
|
|
|
(define-key boon-command-map "d" '("displace" . boon-replace-by-character))
|
2014-10-19 22:29:29 +02:00
|
|
|
|
|
|
|
;; Bottom row
|
|
|
|
;; z
|
2017-05-04 21:41:42 +02:00
|
|
|
(define-key boon-command-map "z" '("repeat" . boon-repeat-command))
|
2014-10-19 22:29:29 +02:00
|
|
|
;; x
|
2016-11-16 19:59:36 +01:00
|
|
|
(define-key boon-command-map "x" 'boon-x-map)
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-command-map "X" 'boon-highlight-regexp)
|
2014-10-19 22:29:29 +02:00
|
|
|
;; c
|
2016-08-14 22:20:32 +02:00
|
|
|
(define-key boon-command-map "c" 'boon-c-god)
|
2014-10-19 22:29:29 +02:00
|
|
|
;; 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)
|
2016-11-08 21:38:01 +01:00
|
|
|
(define-key boon-command-map "v" '("v looks like an insert mark" . boon-set-insert-like-state))
|
|
|
|
|
2014-10-19 22:29:29 +02:00
|
|
|
;; b
|
|
|
|
(define-key boon-command-map "B" 'boon-copy-to-register)
|
2016-11-15 22:07:43 +01:00
|
|
|
(define-key boon-command-map "b" '("bank" . insert-register))
|
2014-10-19 22:29:29 +02:00
|
|
|
|
|
|
|
;; RIGHT HAND: movement and marking commands.
|
2016-11-15 22:07:43 +01:00
|
|
|
|
|
|
|
;; Most of the moves are in boon-moves-map. Yet some moves do not work
|
|
|
|
;; as selectors, so they are put in the boon-command-map instead.
|
2015-06-06 22:39:09 +02:00
|
|
|
(define-key boon-command-map (kbd "C-u") 'scroll-down-line)
|
|
|
|
(define-key boon-command-map (kbd "C-y") 'scroll-up-line)
|
2014-10-19 14:17:46 +02:00
|
|
|
|
2016-08-28 19:14:47 +02:00
|
|
|
(define-key indent-rigidly-map "i" 'indent-rigidly-right)
|
|
|
|
(define-key indent-rigidly-map "e" 'indent-rigidly-left)
|
|
|
|
|
2014-10-19 14:17:46 +02:00
|
|
|
(provide 'boon-colemak)
|
|
|
|
;;; boon-colemak.el ends here
|
2015-05-29 21:21:55 +02:00
|
|
|
|
|
|
|
|