boon/boon-colemak.el

131 lines
4.8 KiB
EmacsLisp
Raw Normal View History

;;; 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
(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)
2019-05-24 09:36:53 +02:00
(define-key boon-select-map "T" 'boon-select-org-tree)
2015-11-30 23:22:50 +01:00
(define-key boon-select-map "d" 'boon-select-document)
2019-05-24 09:36:53 +02:00
(define-key boon-select-map "z" 'boon-select-content) ;; inZide
2014-10-19 14:17:46 +02:00
(define-key boon-select-map "x" 'boon-select-outside-pairs) ;; eXpression
2019-05-24 09:36:53 +02:00
(define-key boon-select-map "C" 'boon-select-comment)
2014-10-19 14:17:46 +02:00
(define-key boon-select-map "c" 'boon-select-inside-pairs) ;; Contents
2015-11-30 23:22:50 +01:00
2019-05-24 09:36:53 +02:00
(define-key boon-select-map "b" 'boon-select-block)
2014-10-19 14:17:46 +02:00
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
(define-key boon-moves-map "k" '("bacK to marK" . boon-switch-mark)) ; bacK to marK
(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))
(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
(define-key boon-command-map "q" '("quote" . boon-quote-character))
2014-10-19 22:29:29 +02:00
;; w,f
;; where is? find?
2019-08-25 22:18:32 +02:00
(define-key boon-moves-map "w" '("where was?" . boon-navigate-backward))
(define-key boon-moves-map "f" '("find forward" . boon-navigate-forward))
2014-10-19 22:29:29 +02:00
(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
;; 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
(define-key boon-command-map "a" '("around" . boon-enclose))
2014-10-19 22:29:29 +02:00
;; r
(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
(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
(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
(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)
(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)
(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