Update which-key for MELPA

This commit is contained in:
justbur 2015-07-15 11:08:51 -04:00 committed by syl20bnr
parent 081f58bbd5
commit a6818815a3
4 changed files with 47 additions and 21 deletions

3
.gitmodules vendored
View File

@ -16,6 +16,3 @@
[submodule "spacemacs/extensions/spray"]
path = spacemacs/extensions/spray
url = https://github.com/syl20bnr/spray
[submodule "contrib/which-key/extensions/which-key"]
path = contrib/which-key/extensions/which-key
url = https://github.com/justbur/emacs-which-key

View File

@ -1,16 +0,0 @@
;;; extensions.el --- which-key Layer Extensions File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(setq which-key-post-extensions '(which-key))
(defun which-key/init-which-key ()
(use-package which-key))

@ -1 +0,0 @@
Subproject commit d57fca695d6efaaa264368f7909a134857b2e1c2

View File

@ -1,3 +1,49 @@
(setq which-key-packages '())
(setq which-key-packages '(which-key))
(setq which-key-excluded-packages '(guide-key
guide-key-tip))
(defun which-key/init-which-key ()
(use-package which-key
:defer t
:config
(progn
(defun spacemacs/toggle-which-key ()
"Toggle which-key-mode on and off."
(interactive)
(if (symbol-value which-key-mode)
(which-key-mode -1)
(which-key-mode)))
(defadvice which-key--update
(around spacemacs/inhibit-which-key-buffer activate)
"Prevent the popup of the which-key buffer in some case."
;; a micro-state is running
;; or
;; bzg-big-fringe-mode is on
(if (or overriding-terminal-local-map
bzg-big-fringe-mode)
(let ((which-key-inhibit t)) ad-do-it)
ad-do-it))
(spacemacs|add-toggle which-key
:status which-key-mode
:on (which-key-mode)
:off (which-key-mode -1)
:documentation
"Display a buffer with available key bindings."
:evil-leader "tW")
(add-to-list 'which-key-description-replacement-alist '("select-window-\\([0-9]\\)" . "Window \\1"))
(which-key-add-key-based-replacements
"SPC TAB" "last buffer"
"SPC SPC" "ace word"
"SPC !" "shell cmd"
"SPC '" "open shell"
"SPC /" "smart search"
"SPC ?" "show keybindings"
"SPC J" "split sexp"
"SPC l" "ace line"
"SPC u" "universal arg"
"SPC v" "expand region"
"SPC <f1>" "apropos"
"SPC m" "maj mode cmds"
(concat "SPC " dotspacemacs-command-key) "M-x"))))