129 lines
3.9 KiB
EmacsLisp
129 lines
3.9 KiB
EmacsLisp
;; modal editing configurations
|
|
|
|
;; normal boon config
|
|
(use-package boon
|
|
:ensure t
|
|
:commands (boon-mode)
|
|
:bind
|
|
(:map boon-command-map
|
|
("C-l" . recenter-top-bottom)
|
|
("r" . swiper)
|
|
("/" . undo-tree-undo)
|
|
("?" . undo-tree-redo)
|
|
("J" . join-line)
|
|
("TAB" . 'company-indent-or-complete-common)
|
|
("C" . 'boon-toggle-comment)
|
|
("t" . nil)
|
|
("t w" . 'transpose-words)
|
|
("t e" . 'transpose-sexps)
|
|
("t l" . 'transpose-lines)
|
|
("t p" . 'transpose-paragraphs))
|
|
(:map boon-x-map
|
|
("s" . 'save-buffer)
|
|
("d" . 'dired-jump)
|
|
("e" . 'eval-last-sexp)
|
|
("f" . 'find-file)
|
|
("l" . 'ido-mini)
|
|
("c" . 'kill-emacs)
|
|
("v" . 'find-alternate-file)
|
|
("b" . 'ibuffer)
|
|
("=" . text-scale-adjust)
|
|
("-" . text-scale-adjust))
|
|
:config
|
|
(use-package boon-qwerty)
|
|
(add-to-list 'boon-enclosures `(40 "(" ")")) ;; opening paren
|
|
(use-package boon-powerline)
|
|
(boon-powerline-theme)
|
|
(mapc (lambda (mode)
|
|
(add-to-list 'boon-special-mode-list mode))
|
|
'(emms-playlist-mode
|
|
emms-browser-mode))
|
|
(add-to-list 'boon-special-conditions 'edebug-mode)
|
|
;; :hook
|
|
;; ((text-mode . turn-on-boon-mode)
|
|
;; (prog-mode . turn-on-boon-mode)
|
|
;; (shell-mode . turn-on-boon-mode)
|
|
;; (helpful-mode . turn-on-boon-mode)
|
|
;; (fundamental-mode . turn-on-boon-mode))
|
|
:init
|
|
(boon-mode))
|
|
|
|
;; experimental boon+modalka config
|
|
(use-package boon
|
|
:ensure t
|
|
:disabled
|
|
:bind
|
|
("C-d" . 'boon-take-region)
|
|
("C-a" . 'boon-beginning-of-line)
|
|
("C-e" . 'boon-end-of-line)
|
|
("M-f" . 'boon-smarter-forward)
|
|
("M-b" . 'boon-smarter-backward))
|
|
|
|
;; experimental Emacs-flavored-Boon config
|
|
(use-package boon
|
|
:ensure t
|
|
:disabled
|
|
:bind
|
|
(:map boon-command-map
|
|
("n" . next-line)
|
|
("p" . previous-line)
|
|
("f" . 'forward-char)
|
|
("b" . 'backward-char)
|
|
("a" . 'boon-beginning-of-line)
|
|
("e" . 'boon-end-of-line)
|
|
("y" . 'boon-splice)
|
|
("r" . swiper)
|
|
("x l" . ido-mini)
|
|
("/" . undo-tree-undo)
|
|
("?" . undo-tree-redo))
|
|
(:map boon-x-map
|
|
("s" . #'save-buffer)
|
|
("d" . #'dired-jump))
|
|
:config
|
|
(use-package boon-qwerty)
|
|
(boon-mode))
|
|
|
|
(use-package modalka
|
|
:ensure t
|
|
:disabled
|
|
:bind
|
|
(("<escape>" . #'modalka-mode)
|
|
:map modalka-mode-map
|
|
("J" . #'join-line)
|
|
("P" . #'backward-paragraph)
|
|
("N" . #'forward-paragraph)
|
|
("M" . mark-sexp))
|
|
;; (2019-11-03) I'm pretty much using this to emulate `god-mode',
|
|
;; which was great, but is no longer actively developed and had no
|
|
;; support for non-Latin input methods.
|
|
:config
|
|
(let ((keybind-re (rx-to-string '(group-n 1 (or (and bow (1+ (char graph)) eow)
|
|
(and (1+ (char graph))))))))
|
|
(mapc
|
|
(lambda (actual)
|
|
(let ((target (replace-regexp-in-string keybind-re "C-\\1" actual)))
|
|
(modalka-define-kbd actual target)))
|
|
;; no "t", "x", or "c", because they are prefix keys used later
|
|
'("`" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "-" "="
|
|
"q" "w" "e" "r" "y" "u" "i" "o" "p" "[" "]" "\\"
|
|
"a" "s" "d" "f" "h" "j" "k" "l" ";" "'"
|
|
"z" "v" "b" "n" "m" "," "." "/"
|
|
"<" ">" "?"
|
|
"SPC"
|
|
;; (2019-11-03) It's a little unfortunate that these cannot be
|
|
;; elided by entering ("x" "C-x") ("t" "C-t") ("c" "C-c") just
|
|
;; once :\ (I did try)
|
|
"x =" "x -" "x e" "x s" "x d"
|
|
"x f" "x l" "x x" "x c" "x v" "x b"
|
|
"t w" "t e" "t l"
|
|
"c n" "c ," "c ." "c p"
|
|
"c c n" "c h u" "c h m")))
|
|
(modalka-define-kbd "O" "C-S-o")
|
|
(setq-default cursor-type '(bar . 1))
|
|
(setq modalka-cursor-type 'box)
|
|
:hook
|
|
((text-mode . modalka-mode)
|
|
(prog-mode . modalka-mode)))
|
|
|
|
(provide 'cp-modal)
|