2017-05-11 00:50:13 +00:00
|
|
|
;;; packages.el --- keyboard-layout Layer Packages File for Spacemacs
|
2016-04-04 02:22:35 +00:00
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2016-04-04 02:22:35 +00:00
|
|
|
;;
|
|
|
|
;; Author: Fabien Dubosson <fabien.dubosson@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defconst keyboard-layout-packages
|
2016-04-04 02:22:35 +00:00
|
|
|
'(
|
|
|
|
ace-window
|
|
|
|
avy
|
2016-05-30 02:39:21 +00:00
|
|
|
comint
|
2016-04-04 02:22:35 +00:00
|
|
|
company
|
|
|
|
elfeed
|
|
|
|
evil
|
|
|
|
evil-escape
|
|
|
|
evil-evilified-state
|
2018-02-10 22:34:16 +00:00
|
|
|
evil-magit
|
2016-04-04 19:21:30 +00:00
|
|
|
evil-surround
|
2016-04-04 02:22:35 +00:00
|
|
|
eyebrowse
|
|
|
|
flycheck
|
2016-04-04 19:21:30 +00:00
|
|
|
helm
|
2016-04-04 20:35:01 +00:00
|
|
|
imenu-list
|
2016-04-04 02:22:35 +00:00
|
|
|
ivy
|
|
|
|
magit
|
2016-06-03 15:14:46 +00:00
|
|
|
mu4e
|
2016-04-04 02:22:35 +00:00
|
|
|
neotree
|
|
|
|
org
|
|
|
|
org-agenda
|
|
|
|
ranger
|
2016-04-04 20:35:01 +00:00
|
|
|
twittering-mode
|
2018-11-19 10:41:42 +00:00
|
|
|
undo-tree
|
2016-04-04 02:22:35 +00:00
|
|
|
))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-ace-window ()
|
|
|
|
(kl|config ace-window
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
2016-04-04 20:35:01 +00:00
|
|
|
"Change `ace-window' keys to the central row."
|
2016-04-04 02:22:35 +00:00
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook ace-window :post-init BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
|
|
|
(setq aw-keys '(?a ?u ?i ?e ?t ?s ?r ?n))
|
|
|
|
:dvorak
|
2017-05-08 07:03:02 +00:00
|
|
|
(setq aw-keys '(?a ?o ?e ?u ?h ?t ?n ?s))
|
|
|
|
:neo
|
2016-09-23 11:16:14 +00:00
|
|
|
(setq aw-keys '(?u ?i ?a ?e ?n ?r ?t ?d))
|
2017-04-20 15:53:18 +00:00
|
|
|
:colemak-neio
|
|
|
|
(setq aw-keys '(?a ?r ?s ?t ?n ?e ?i ?o))
|
|
|
|
:colemak-hnei
|
|
|
|
(setq aw-keys '(?a ?r ?s ?t ?n ?e ?i ?o))
|
2016-09-23 11:16:14 +00:00
|
|
|
:colemak-jkhl
|
2017-10-16 14:59:10 +00:00
|
|
|
(setq aw-keys '(?a ?r ?s ?t ?n ?e ?i ?o))
|
|
|
|
:workman
|
|
|
|
(setq aw-keys '(?a ?s ?h ?t ?n ?e ?o ?i))))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-avy ()
|
|
|
|
(kl|config avy
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
2016-04-04 20:35:01 +00:00
|
|
|
"Change `avy' keys to the central row."
|
2016-04-04 02:22:35 +00:00
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook avy :post-init BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
|
|
|
(setq-default avy-keys '(?a ?u ?i ?e ?t ?s ?r ?n))
|
|
|
|
:dvorak
|
2017-05-08 07:03:02 +00:00
|
|
|
(setq-default avy-keys '(?a ?o ?e ?u ?h ?t ?n ?s))
|
|
|
|
:neo
|
2016-09-23 11:16:14 +00:00
|
|
|
(setq-default avy-keys '(?u ?i ?a ?e ?n ?r ?t ?d))
|
2017-04-20 15:53:18 +00:00
|
|
|
:colemak-neio
|
|
|
|
(setq-default avy-keys '(?a ?r ?s ?t ?n ?e ?i ?o))
|
|
|
|
:colemak-hnei
|
|
|
|
(setq-default avy-keys '(?a ?r ?s ?t ?n ?e ?i ?o))
|
2016-09-23 11:16:14 +00:00
|
|
|
:colemak-jkhl
|
2017-10-16 14:59:10 +00:00
|
|
|
(setq-default avy-keys '(?a ?r ?s ?t ?n ?e ?i ?o))
|
|
|
|
:workman
|
|
|
|
(setq-default avy-keys '(?a ?s ?h ?t ?n ?e ?o ?i))))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-comint ()
|
|
|
|
(kl|config comint-mode
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
2016-04-04 20:35:01 +00:00
|
|
|
"Remap `comint' bindings."
|
2016-04-04 02:22:35 +00:00
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'shell BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
2016-04-04 02:22:35 +00:00
|
|
|
(dolist (m '(normal insert))
|
2016-04-04 20:35:01 +00:00
|
|
|
(eval `(kl/evil-correct-keys `,m comint-mode-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"C-j"
|
|
|
|
"C-k")))))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-company ()
|
|
|
|
(kl|config company
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `company' bindings."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook company :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/correct-keys company-active-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"C-h"
|
|
|
|
"C-j"
|
|
|
|
"C-k"
|
|
|
|
"C-l")))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-elfeed ()
|
|
|
|
(kl|config elfeed
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `elfeed' bindings."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook elfeed :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
2016-04-04 02:22:35 +00:00
|
|
|
(progn
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/evil-correct-keys 'evilified elfeed-search-mode-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"j"
|
|
|
|
"k")
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/evil-correct-keys 'evilified elfeed-show-mode-map
|
|
|
|
"j"
|
|
|
|
"k"
|
2016-04-04 02:22:35 +00:00
|
|
|
"C-j"
|
2016-04-04 20:35:01 +00:00
|
|
|
"C-k"))
|
|
|
|
:bepo
|
|
|
|
;; HACK: The auto correction doesn't work... mystery.
|
|
|
|
(evil-define-key 'evilified elfeed-search-mode-map
|
|
|
|
"k" 'elfeed-search-live-filter)))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-evil ()
|
|
|
|
(kl|config evil
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
2016-04-04 20:35:01 +00:00
|
|
|
"Remap `evil' bindings."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'evil BODY)
|
|
|
|
:common
|
|
|
|
(dolist (map kl--all-evil-states-but-insert)
|
|
|
|
(kl/correct-keys map
|
|
|
|
"h"
|
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"l"
|
|
|
|
;;
|
|
|
|
"H"
|
|
|
|
"J"
|
|
|
|
"K"
|
|
|
|
"L"))
|
|
|
|
:bepo
|
2016-04-04 02:22:35 +00:00
|
|
|
(progn
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/set-in-all-evil-states-but-insert
|
2016-04-04 02:22:35 +00:00
|
|
|
"é" 'evil-forward-word-begin
|
|
|
|
"É" 'evil-forward-WORD-begin)
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/set-in-state evil-inner-text-objects-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"é" 'evil-inner-word
|
|
|
|
"É" 'evil-inner-WORD)
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/set-in-state evil-outer-text-objects-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"é" 'evil-a-word
|
|
|
|
"É" 'evil-a-WORD)
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/set-in-all-evil-states-but-insert
|
2016-04-04 02:22:35 +00:00
|
|
|
"«" 'evil-shift-left
|
2016-04-04 20:35:01 +00:00
|
|
|
"»" 'evil-shift-right))
|
|
|
|
:dvorak
|
|
|
|
;; Invert it twice to reset `k' and `K' for searching
|
|
|
|
(dolist (map kl--all-evil-states-but-insert)
|
|
|
|
(kl/correct-keys map
|
2016-09-23 11:16:14 +00:00
|
|
|
"K"))
|
|
|
|
:colemak-jkhl
|
|
|
|
(progn
|
|
|
|
(define-key evil-motion-state-map "J" 'evil-join)
|
|
|
|
(define-key evil-motion-state-map "K" 'evil-window-bottom)
|
|
|
|
(define-key evil-motion-state-map "H" 'evil-window-top)
|
|
|
|
(define-key evil-motion-state-map "L" 'evil-lookup)))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl|config evil-window
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
2016-04-04 20:35:01 +00:00
|
|
|
"Remap `evil-window' bindings."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'evil-commands BODY)
|
2020-01-06 13:54:54 +00:00
|
|
|
;; :common
|
|
|
|
;; ;; FIXME: Not working
|
|
|
|
;; (kl/leader-correct-keys
|
|
|
|
;; "wh"
|
|
|
|
;; "wj"
|
|
|
|
;; "wk"
|
|
|
|
;; "wl"
|
|
|
|
;; ;;
|
|
|
|
;; "wH"
|
|
|
|
;; "wJ"
|
|
|
|
;; "wK"
|
|
|
|
;; "wL")
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
2016-04-04 02:22:35 +00:00
|
|
|
(progn
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"wé" 'other-window
|
|
|
|
"wq" 'delete-window)
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/leader-alias-of "é" "w"))))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-09-23 11:16:14 +00:00
|
|
|
;; HACK: These are defined by the spacemacs-bootstrap layer, and this is the
|
|
|
|
;; only I've found to make them stick. An unfortunate consequence of using
|
|
|
|
;; `kl|config evil' twice is that user hooks for this configuration will be run
|
|
|
|
;; twice as well.
|
|
|
|
(defun keyboard-layout/post-init-evil ()
|
|
|
|
(kl|config evil
|
|
|
|
:description
|
|
|
|
"Remap `evil' bindings."
|
|
|
|
:colemak-jkhl
|
|
|
|
(progn
|
|
|
|
(define-key evil-normal-state-map "K" nil)
|
|
|
|
(define-key evil-normal-state-map "L" 'spacemacs/evil-smart-doc-lookup))))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-evil-escape ()
|
|
|
|
(kl|config evil-escape
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
2016-04-04 20:35:01 +00:00
|
|
|
"Change `evil-escape' default escape combination for a better one than `fd'."
|
2016-04-04 02:22:35 +00:00
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook evil-escape :post-init BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
Adding colemak keyboard layout option to `keyboard-layout`
- Base Remapping Keys
`#{n, e, i, o}` <=> `#{h, j, k, l}`
- setting `avy` keys to the `colemak` home row keys
`#{a, r, s, t, n, e, i, o}`
- adjusting leader key to `tn`
- overriding evil org mode bindings especially for 'o'
- one character key guess rebindings can give back empty string
when looking for the prefix and it isn't empty, then guess the rebindings --
this fix lets the check not pass and return `'(nil nil)`, allowing the
`(remove-if #'null)` to actually work.
- correcting magit staging when using visual line
2017-02-21 21:15:51 +00:00
|
|
|
(setq-default evil-escape-key-sequence "gq")
|
2017-04-20 15:53:18 +00:00
|
|
|
:colemak-neio
|
Adding colemak keyboard layout option to `keyboard-layout`
- Base Remapping Keys
`#{n, e, i, o}` <=> `#{h, j, k, l}`
- setting `avy` keys to the `colemak` home row keys
`#{a, r, s, t, n, e, i, o}`
- adjusting leader key to `tn`
- overriding evil org mode bindings especially for 'o'
- one character key guess rebindings can give back empty string
when looking for the prefix and it isn't empty, then guess the rebindings --
this fix lets the check not pass and return `'(nil nil)`, allowing the
`(remove-if #'null)` to actually work.
- correcting magit staging when using visual line
2017-02-21 21:15:51 +00:00
|
|
|
(setq-default evil-escape-key-sequence "tn")))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-evil-evilified-state ()
|
|
|
|
(kl|config evil-evilified-state
|
2016-04-04 19:21:30 +00:00
|
|
|
:description
|
|
|
|
"Remap `evil-evilified-state' bindings."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'evil-evilified-state BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/correct-keys evil-evilified-state-map
|
2016-04-04 19:21:30 +00:00
|
|
|
"h"
|
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"l")))
|
|
|
|
|
2018-02-10 22:34:16 +00:00
|
|
|
(defun keyboard-layout/pre-init-evil-magit ()
|
|
|
|
(kl|config evil-magit
|
|
|
|
:description
|
|
|
|
"Remap `evil-magit' bindings."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'evil-magit BODY)
|
|
|
|
:common
|
|
|
|
(dolist (state (if evil-magit-use-y-for-yank
|
|
|
|
(list evil-magit-state 'visual)
|
|
|
|
(list evil-magit-state)))
|
|
|
|
(kl/evil-correct-keys state magit-mode-map
|
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"C-j"
|
|
|
|
"C-k"))
|
|
|
|
(kl/evil-correct-keys 'normal evil-magit-toggle-text-minor-mode-map
|
|
|
|
"C-j")))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-evil-surround ()
|
|
|
|
(kl|config evil-surround
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
2016-04-04 20:35:01 +00:00
|
|
|
"Remap `evil-surround' bindings."
|
2016-04-04 02:22:35 +00:00
|
|
|
:loader
|
2018-06-15 08:58:50 +00:00
|
|
|
(spacemacs|use-package-add-hook evil-surround :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/evil-correct-keys 'visual evil-surround-mode-map "s")))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-eyebrowse ()
|
|
|
|
(kl|config eyebrowse
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `eyebrowse' keybindings conflicting with evil."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook eyebrowse :post-init BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/correct-keys evil-motion-state-map "gj"))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl|config eyebrowse
|
|
|
|
:description
|
|
|
|
"Remap `eyebrowse' keybindings conflicting with evil-commands."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'evil-commands BODY)
|
|
|
|
:common
|
|
|
|
(kl/correct-keys evil-motion-state-map "gJ")))
|
|
|
|
|
|
|
|
(defun keyboard-layout/pre-init-flycheck ()
|
|
|
|
(kl|config flycheck-error-list
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `flycheck-error-list' bindings."
|
|
|
|
:loader
|
2018-06-15 08:58:50 +00:00
|
|
|
(spacemacs|use-package-add-hook flycheck :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/evil-correct-keys 'evilified flycheck-error-list-mode-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"j"
|
|
|
|
"k")))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-helm ()
|
|
|
|
(kl|config helm
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `helm' bindings."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook helm :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/correct-keys helm-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"C-h"
|
|
|
|
"C-j"
|
|
|
|
"C-k"
|
|
|
|
"C-l"))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl|config helm-buffers
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `helm-buffers' bindings."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'helm-buffers BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
2016-04-04 02:22:35 +00:00
|
|
|
;; HACK: Forced to correct wrong behaviour
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/set-in-state helm-buffer-map "C-s" 'helm-previous-line))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl|config helm-files
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `helm-files' bindings."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'helm-files BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
2016-04-04 02:22:35 +00:00
|
|
|
(progn
|
|
|
|
;; HACK: Forced to correct wrong behaviour
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/set-in-state helm-find-files-map "C-s" 'helm-previous-line)
|
|
|
|
(kl/set-in-state helm-find-files-map "C-k" 'helm-ff-run-grep)
|
|
|
|
(kl/set-in-state helm-find-files-map "C-r" 'helm-maybe-exit-minibuffer)
|
|
|
|
(kl/set-in-state helm-read-file-map "C-s" 'helm-previous-line)
|
2017-05-08 07:03:02 +00:00
|
|
|
(kl/set-in-state helm-read-file-map "C-K" 'helm-previous-line))
|
|
|
|
:neo
|
|
|
|
(progn
|
|
|
|
(kl/set-in-state helm-find-files-map "C-r" 'helm-previous-line)
|
2016-09-23 11:16:14 +00:00
|
|
|
(kl/set-in-state helm-find-files-map "C-s" 'helm-next-line))
|
|
|
|
:colemak-jkhl
|
|
|
|
(progn
|
|
|
|
;; HACK: Forced to correct wrong behaviour
|
|
|
|
(kl/set-in-state helm-find-files-map "C-h" 'helm-previous-line)
|
|
|
|
(kl/set-in-state helm-find-files-map "C-j" 'helm-find-files-up-one-level)))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl|config helm-locate
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `helm-locate' bindings."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'helm-locate BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
|
|
|
(progn
|
|
|
|
;; HACK: Forced to correct wrong behaviour
|
|
|
|
(kl/set-in-state helm-generic-files-map "C-s" 'helm-previous-line)
|
|
|
|
(kl/set-in-state helm-generic-files-map "C-k" 'helm-ff-run-grep))
|
|
|
|
:bepo
|
2016-04-04 02:22:35 +00:00
|
|
|
(progn
|
|
|
|
;; HACK: Forced to correct wrong behaviour
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/set-in-state helm-generic-files-map "C-n" 'helm-previous-line)
|
|
|
|
(kl/set-in-state helm-generic-files-map "C-k" 'helm-ff-run-grep))))
|
|
|
|
|
|
|
|
(defun keyboard-layout/pre-init-imenu-list ()
|
|
|
|
(kl|config imenu-list
|
|
|
|
:description
|
|
|
|
"Remap `imenu-list' bindings."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook imenu-list :post-config BODY)
|
|
|
|
:common
|
|
|
|
(kl/evil-correct-keys 'evilified imenu-list-major-mode-map
|
2016-09-23 11:16:14 +00:00
|
|
|
"j"
|
|
|
|
"k")))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-ivy ()
|
|
|
|
(kl|config ivy
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `ivy' bindings."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook ivy :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
2016-04-04 02:22:35 +00:00
|
|
|
(progn
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/correct-keys ivy-minibuffer-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"C-h"
|
|
|
|
"C-j"
|
|
|
|
"C-k"
|
|
|
|
"C-l"))))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-magit ()
|
|
|
|
(kl|config magit
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `magit' bindings."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook magit :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
2018-02-10 22:34:16 +00:00
|
|
|
(dolist (map (list magit-branch-section-map
|
|
|
|
magit-commit-section-map
|
|
|
|
magit-file-section-map
|
|
|
|
magit-hunk-section-map
|
|
|
|
magit-remote-section-map
|
|
|
|
magit-staged-section-map
|
|
|
|
magit-unstaged-section-map
|
|
|
|
magit-module-commit-section-map
|
|
|
|
magit-stash-section-map
|
|
|
|
magit-stashes-section-map
|
|
|
|
magit-tag-section-map
|
|
|
|
magit-unpulled-section-map
|
|
|
|
magit-unpushed-section-map
|
|
|
|
magit-untracked-section-map))
|
|
|
|
(kl/correct-keys map
|
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"C-j"
|
|
|
|
"C-k"))
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
|
|
|
(progn
|
2019-02-15 17:31:01 +00:00
|
|
|
(transient-suffix-put 'magit-dispatch "t" :key "j")
|
|
|
|
(transient-suffix-put 'magit-dispatch "s" :key "k")
|
|
|
|
(transient-suffix-put 'magit-dispatch "S" :key "K"))
|
2016-09-23 11:16:14 +00:00
|
|
|
:colemak-jkhl
|
2018-02-10 22:34:16 +00:00
|
|
|
(kl/evil-correct-keys 'visual magit-mode-map
|
|
|
|
"j"
|
|
|
|
"k")))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-mu4e ()
|
|
|
|
(kl|config mu4e
|
2016-06-03 15:14:46 +00:00
|
|
|
:description
|
2016-06-06 21:00:31 +00:00
|
|
|
"Remap navigation keys in `mu4e' headers and view mode."
|
2016-06-03 15:14:46 +00:00
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook mu4e :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
2016-06-03 15:14:46 +00:00
|
|
|
(dolist (map (list mu4e-headers-mode-map
|
|
|
|
mu4e-view-mode-map))
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/evil-correct-keys 'evilified map
|
2016-06-03 15:14:46 +00:00
|
|
|
"h"
|
|
|
|
"j"
|
|
|
|
"k"
|
2016-04-04 20:35:01 +00:00
|
|
|
"l"
|
|
|
|
"C-j"
|
|
|
|
"C-k"))
|
|
|
|
:bepo
|
|
|
|
(dolist (map (list mu4e-headers-mode-map
|
|
|
|
mu4e-view-mode-map))
|
2016-06-03 15:14:46 +00:00
|
|
|
(evil-define-key 'evilified map
|
|
|
|
"è" 'mu4e-headers-mark-subthread
|
2016-06-06 21:00:31 +00:00
|
|
|
"/" 'mu4e-headers-search))))
|
2016-06-03 15:14:46 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-neotree ()
|
|
|
|
(kl|config neotree
|
2016-04-04 02:22:35 +00:00
|
|
|
:descripition
|
|
|
|
"Remap `neotree' bindings."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook neotree :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/evil-correct-keys 'evilified neotree-mode-map
|
|
|
|
"h"
|
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"l"
|
|
|
|
;;
|
|
|
|
"H"
|
|
|
|
"J"
|
|
|
|
"K"
|
|
|
|
"L")
|
|
|
|
:bepo
|
|
|
|
(kl/set-in-state (evil-get-auxiliary-keymap neotree-mode-map 'evilified)
|
|
|
|
"h" 'neotree-hidden-file-toggle
|
|
|
|
"k" 'neotree-rename-node)))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-org ()
|
|
|
|
(kl|config org
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap keys in `org-mode'."
|
|
|
|
:loader
|
|
|
|
(with-eval-after-load 'org BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:bepo
|
2016-04-04 02:22:35 +00:00
|
|
|
(progn
|
|
|
|
(evil-define-key 'normal evil-org-mode-map
|
|
|
|
"t" 'evil-next-line
|
|
|
|
"j" 'org-todo)
|
|
|
|
(dolist (m '(normal insert))
|
|
|
|
(eval `(evil-define-key ',m evil-org-mode-map
|
|
|
|
;; ctsr
|
|
|
|
(kbd "M-c") 'org-metaleft
|
|
|
|
(kbd "M-t") 'org-metadown
|
|
|
|
(kbd "M-s") 'org-metaup
|
|
|
|
(kbd "M-r") 'org-metaright
|
|
|
|
(kbd "M-C") 'org-shiftmetaleft
|
|
|
|
(kbd "M-T") 'org-shiftmetadown
|
|
|
|
(kbd "M-S") 'org-shiftmetaup
|
|
|
|
(kbd "M-R") 'org-shiftmetaright
|
|
|
|
;; hjkl
|
|
|
|
(kbd "M-h") 'capitalize-word
|
|
|
|
(kbd "M-j") 'transpose-chars
|
|
|
|
(kbd "M-k") 'kill-sentence
|
|
|
|
(kbd "M-l") 'move-to-window-line-top-bottom
|
|
|
|
(kbd "M-H") 'capitalize-word
|
|
|
|
(kbd "M-J") 'transpose-chars
|
|
|
|
(kbd "M-K") 'kill-sentence
|
|
|
|
(kbd "M-L") 'move-to-window-line-top-bottom)))
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-mode
|
|
|
|
;; ctsr
|
|
|
|
"C-S-c" 'org-shiftcontrolleft
|
|
|
|
"C-S-t" 'org-shiftcontroldown
|
|
|
|
"C-S-s" 'org-shiftcontrolup
|
|
|
|
"C-S-r" 'org-shiftcontrolright
|
|
|
|
;; hjkl
|
|
|
|
"C-S-h" nil
|
|
|
|
"C-S-j" nil
|
|
|
|
"C-S-k" nil
|
|
|
|
"C-S-l" nil)
|
|
|
|
(evil-define-key 'normal evil-org-mode-map
|
|
|
|
;; ctsr
|
|
|
|
"gt" 'org-forward-heading-same-level
|
|
|
|
"gs" 'org-backward-heading-same-level
|
|
|
|
;; hjkl
|
|
|
|
"gj" nil
|
|
|
|
"gk" nil
|
|
|
|
;; additional
|
|
|
|
(kbd "«") 'org-metaleft
|
Adding colemak keyboard layout option to `keyboard-layout`
- Base Remapping Keys
`#{n, e, i, o}` <=> `#{h, j, k, l}`
- setting `avy` keys to the `colemak` home row keys
`#{a, r, s, t, n, e, i, o}`
- adjusting leader key to `tn`
- overriding evil org mode bindings especially for 'o'
- one character key guess rebindings can give back empty string
when looking for the prefix and it isn't empty, then guess the rebindings --
this fix lets the check not pass and return `'(nil nil)`, allowing the
`(remove-if #'null)` to actually work.
- correcting magit staging when using visual line
2017-02-21 21:15:51 +00:00
|
|
|
(kbd "»") 'org-metaright))
|
2017-04-20 15:53:18 +00:00
|
|
|
:colemak-neio
|
Adding colemak keyboard layout option to `keyboard-layout`
- Base Remapping Keys
`#{n, e, i, o}` <=> `#{h, j, k, l}`
- setting `avy` keys to the `colemak` home row keys
`#{a, r, s, t, n, e, i, o}`
- adjusting leader key to `tn`
- overriding evil org mode bindings especially for 'o'
- one character key guess rebindings can give back empty string
when looking for the prefix and it isn't empty, then guess the rebindings --
this fix lets the check not pass and return `'(nil nil)`, allowing the
`(remove-if #'null)` to actually work.
- correcting magit staging when using visual line
2017-02-21 21:15:51 +00:00
|
|
|
(progn
|
|
|
|
(spacemacs|use-package-add-hook evil-org
|
|
|
|
:post-config
|
|
|
|
(progn
|
|
|
|
(evil-define-key 'normal evil-org-mode-map
|
|
|
|
"O" 'org-forward-heading-same-level
|
|
|
|
"o" 'evil-forward-char
|
|
|
|
"E" 'org-forward-element
|
|
|
|
"I" 'org-backward-element
|
2017-05-08 07:03:02 +00:00
|
|
|
"N" 'org-backward-heading-same-level))))
|
|
|
|
:neo
|
|
|
|
(progn
|
|
|
|
(spacemacs|use-package-add-hook evil-org
|
|
|
|
:post-config
|
|
|
|
(progn
|
|
|
|
(evil-define-key 'normal evil-org-mode-map
|
|
|
|
"t" 'evil-forward-char
|
|
|
|
"l" 'org-todo
|
|
|
|
"gn" 'org-forward-heading-same-level
|
|
|
|
"gr" 'org-backward-heading-same-level
|
|
|
|
"gj" nil
|
|
|
|
"gk" nil)
|
|
|
|
(dolist (m '(normal insert))
|
|
|
|
(eval `(evil-define-key ',m evil-org-mode-map
|
|
|
|
;; snrt
|
|
|
|
(kbd "M-s") 'org-metaleft
|
|
|
|
(kbd "M-n") 'org-metadown
|
|
|
|
(kbd "M-r") 'org-metaup
|
|
|
|
(kbd "M-t") 'org-metaright
|
|
|
|
(kbd "M-S") 'org-shiftmetaleft
|
|
|
|
(kbd "M-N") 'org-shiftmetadown
|
|
|
|
(kbd "M-R") 'org-shiftmetaup
|
|
|
|
(kbd "M-T") 'org-shiftmetaright
|
|
|
|
;; hjkl
|
|
|
|
(kbd "M-h") 'capitalize-word
|
|
|
|
(kbd "M-j") 'transpose-chars
|
|
|
|
(kbd "M-k") 'kill-sentence
|
|
|
|
(kbd "M-l") 'move-to-window-line-top-bottom
|
|
|
|
(kbd "M-H") 'capitalize-word
|
|
|
|
(kbd "M-J") 'transpose-chars
|
|
|
|
(kbd "M-K") 'kill-sentence
|
|
|
|
(kbd "M-L") 'move-to-window-line-top-bottom)))
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'org-mode
|
|
|
|
;; snrt
|
|
|
|
"C-S-s" 'org-shiftcontrolleft
|
|
|
|
"C-S-n" 'org-shiftcontroldown
|
|
|
|
"C-S-r" 'org-shiftcontrolup
|
|
|
|
"C-S-t" 'org-shiftcontrolright
|
|
|
|
;; hjkl
|
|
|
|
"C-S-h" nil
|
|
|
|
"C-S-j" nil
|
|
|
|
"C-S-k" nil
|
|
|
|
"C-S-l" nil))))))
|
2016-04-04 02:22:35 +00:00
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-org-agenda ()
|
|
|
|
(kl|config org-agenda
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap `org-agenda' bindings."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook org-agenda :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/evil-correct-keys 'evilified org-agenda-mode-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"M-h"
|
|
|
|
"M-j"
|
|
|
|
"M-k"
|
|
|
|
"M-l")))
|
|
|
|
|
2016-04-04 20:35:01 +00:00
|
|
|
(defun keyboard-layout/pre-init-ranger ()
|
|
|
|
(kl|config ranger
|
2016-04-04 02:22:35 +00:00
|
|
|
:description
|
|
|
|
"Remap navigation keys in `ranger'."
|
|
|
|
:loader
|
2016-09-01 12:05:43 +00:00
|
|
|
(spacemacs|use-package-add-hook ranger :post-config BODY)
|
2016-04-04 20:35:01 +00:00
|
|
|
:common
|
|
|
|
(kl/correct-keys ranger-mode-map
|
|
|
|
"h"
|
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"l")))
|
|
|
|
|
2017-03-08 10:46:35 +00:00
|
|
|
(defun keyboard-layout/pre-init-twittering-mode ()
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl|config twittering-mode
|
|
|
|
:description
|
|
|
|
"Remap navigation keys in `twittering-mode'."
|
|
|
|
:loader
|
2017-03-08 10:46:35 +00:00
|
|
|
(spacemacs|use-package-add-hook twittering-mode :post-config BODY)
|
|
|
|
:common
|
2016-04-04 20:35:01 +00:00
|
|
|
(kl/correct-keys twittering-mode-map
|
2016-04-04 02:22:35 +00:00
|
|
|
"h"
|
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"l"
|
|
|
|
;;
|
|
|
|
"H"
|
|
|
|
"J"
|
2016-04-04 20:35:01 +00:00
|
|
|
"K"
|
2016-04-04 02:22:35 +00:00
|
|
|
"L")))
|
2018-11-19 10:41:42 +00:00
|
|
|
|
|
|
|
(defun keyboard-layout/pre-init-undo-tree ()
|
|
|
|
(kl|config undo-tree
|
|
|
|
:description
|
|
|
|
"Remap navigation keys in `undo-tree-visualizer-mode'."
|
|
|
|
:loader
|
|
|
|
(spacemacs|use-package-add-hook undo-tree :post-config BODY)
|
|
|
|
:common
|
|
|
|
(kl/evil-correct-keys 'evilified undo-tree-visualizer-mode-map
|
|
|
|
"h"
|
|
|
|
"j"
|
|
|
|
"k"
|
|
|
|
"l")))
|