Skip to content

Commit

Permalink
Use spacemacs/set-leader-keys in the bepo layer
Browse files Browse the repository at this point in the history
  • Loading branch information
StreakyCobra committed Jan 3, 2016
1 parent e6733ba commit e3f23ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
18 changes: 7 additions & 11 deletions layers/+keyboard-layouts/bepo/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,15 @@ evil states, except insert."
(declare (indent 0))
(bepo//define-key bepo--all-evil-states-but-insert key def bindings))

(defun bepo/evil-leader-alias-of (key1 key2)
"Define a evil-leader key as an alias of another one."
(evil-leader/set-key key1 (lookup-key spacemacs-default-map key2)))
(defun bepo/leader-alias-of (key1 key2)
"Define a leader key as an alias of another one."
(spacemacs/set-leader-keys key1 (lookup-key spacemacs-default-map key2)))

(defun bepo/evil-leader-alias-of (key1 key2)
"Define a evil-leader key as an alias of another one."
(evil-leader/set-key key1 (lookup-key spacemacs-default-map key2)))

(defun bepo/evil-leader-swap-keys (key1 key2)
"Invert the behaviour of two evil-leader keys."
(defun bepo/leader-swap-keys (key1 key2)
"Invert the behaviour of two leader keys."
(let ((map1 (lookup-key spacemacs-default-map key1))
(map2 (lookup-key spacemacs-default-map key2)))
(evil-leader/set-key key1 map2 key2 map1)))
(spacemacs/set-leader-keys key1 map2 key2 map1)))

;;------------------------------------------------------------------------------
;; CORRECTION FUNCTIONS
Expand All @@ -129,7 +125,7 @@ evil states, except insert."
(declare (indent 2))
(apply #'bepo/correct-keys (evil-get-auxiliary-keymap map state) keys))

(defun bepo/evil-leader-correct-keys (&rest keys)
(defun bepo/leader-correct-keys (&rest keys)
(declare (indent 0))
(apply #'bepo/correct-keys spacemacs-default-map keys))

Expand Down
10 changes: 5 additions & 5 deletions layers/+keyboard-layouts/bepo/keybindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
(progn
;; HACK: Manual binding, otherwise conflicts with evil-window auto
;; remapping.
(evil-leader/set-key
(spacemacs/set-leader-keys
"wC" 'evil-window-move-far-left
"wL" 'ace-delete-window
"wQ" 'ace-delete-window)
Expand All @@ -40,7 +40,7 @@
:loader
(with-eval-after-load 'buffer-move BODY)
:config
(bepo/evil-leader-correct-keys
(bepo/leader-correct-keys
"bmh"
"bmj"
"bmk"
Expand Down Expand Up @@ -153,7 +153,7 @@
`q' for closing."
:config
(progn
(bepo/evil-leader-correct-keys
(bepo/leader-correct-keys
"wh"
"wj"
"wk"
Expand All @@ -166,7 +166,7 @@
(spacemacs/set-leader-keys
"" 'other-window
"wq" 'delete-window)
(bepo/evil-leader-alias-of "é" "w")))
(bepo/leader-alias-of "é" "w")))

(bepo|config eyebrowse
:description
Expand Down Expand Up @@ -360,7 +360,7 @@
:description
"Customize some `spacemacs' bindings."
:config
(bepo/evil-leader-correct-keys
(bepo/leader-correct-keys
"jh"
"jj"
"jk"
Expand Down

0 comments on commit e3f23ea

Please sign in to comment.