| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Add evil-send-leader and evil-send-localleader which will push the symbol
<leader> or <localleader> into the unread-command-events list. This allows one
to bind a key to evil-send-leader to make it a leader key and activate bindings
like the following.
(defun hi ()
(interactive)
(message "hi"))
(define-key evil-normal-state-map (kbd "<leader> h") 'hi)
For convenience, evil-set-leader can be used as follows
(evil-set-leader 'normal (kbd "C-c"))
An optional argument makes it a localleader.
|
|
|
|
|
|
|
|
|
|
assq uses more memory for some reason. See #1037
|
|
Allow auxiliary maps to be intercept maps
|
|
In some situations, we don't use the match data. So we might as well not capture
it.
|
|
Previously this was done in evil-initial-state-for-buffer, but it's easier to
recursively follow all parent branches (including those from aliases) within
evil-initial-state.
|
|
|
|
Teach evil-initial-state to look at aliases for a mode when they exist and to
handle nil for modes
Search parent modes (and their aliases) for defined initial states in
evil-initial-state-for-buffer.
One effect is that
(evil-set-initial-state 'special-mode 'motion)
now makes motion state the default for all major modes that derive from special
mode and don't have defaults set for them.
|
|
|
|
|
|
Because we delay some bindings using after-load-functions, definitions that
throw errors such as (evil-define-key* 'normal emacs-lisp-mode-map "a" blah)
become very disruptive. To deal with this situation, wrap the definition in
condition-case-unless-debug so that we only print a warning message.
|
|
Give it a meaning when KEYMAP is global or local.
Explicitly mention this in the docstrings of evil-define-key and
evil-define-key*.
|
|
If the parent keymap already has an auxiliary keymap, ignore it. For
example, if the user attempted to bind a key in emacs-lisp-mode-map
before this commit, evil-define-key* could define the key in the
corresponding auxiliary keymap in lisp-shared-mode-map instead of
creating a new auxiliary keymap in emacs-lisp-mode-map. This resulted in
keys bound in emacs-lisp-mode-map with evil-define-key potentially being
bound in other keymaps that inherit from lisp-shared-mode-map (e.g.
lisp-mode-map).
Addresses #709.
|
|
In evil-define-key, allow keymap to be 'global, 'local or some other quoted
symbol, which is assumed to be a minor mode.
Using 'global, corresponds to making a global binding in the corresponding
global evil keymap (similar to evil-global-set-key). Using 'local, corresponds
to making a local binding in the corresponding local evil keymap (similar to
evil-local-set-key).
Any other quoted symbol is assumed to be the name of a minor mode, and the
binding is dispatched to evil-define-minor-mode-key.
Make evil-define-key* support global and local symbols.
Allow a list of states in evil-define-minor-mode-key.
This makes evil-define-key serve as a general keybinding function.
|
|
See #733
|
|
|
|
This avoids having to input ESC ESC ESC in Terminals when trying to
exit out of Minibuffer/Ivy/Helm/etc.
Can then write something like this for Ivy to escape out.
(eval-after-load 'evil
(lambda ()
(define-key ivy-minibuffer-map [escape] 'minibuffer-keyboard-quit)))
|
|
|
|
Introduced by previous commit
|
|
and into a new function evil-define-key*. evil-define-key* tries
bind the keys on invocation which leads to more predictable behavior.
For example, if there is a typo in the keymap then using
evil-define-key will never bind its keys, whereas evil-define-key*
will signal an error right away. It is also a function instead of
a macro which is much more predictable inside of loops and functions
when the file is compiled and the macros are expanded.
|
|
Support a common pattern of putting the same binding in multiple
states and avoid difficulties with using evil-define-key inside
of a dolist loop due to it being a macro.
|
|
Without this if there is an auxiliary keymap in the parent map
it gets used automatically, which may not be what you want. This
option allows you to create a keymap in the passed map if it
doesn't exist (even if it exists in the parent).
|
|
|
|
|
|
|
|
|
|
BINDINGS was denoted as &optional when it should be &rest.
|
|
evil-mode was defined last in the loading sequence, after an advice had been
defined for it, which raised a warning at load time. There does not seem to be
any reason to defer defining evil-mode to the end of the load sequence as it
just defines a minor mode and all of the constituent functions have been
defined at this point.
|
|
|
|
|
|
commands so that they can be compiled
|
|
Since evil-define-key can be used for major-mode keys, if someone
defines all of their minor-mode keys with evil-define-minor-mode-key
they can be shadowed by the major-mode ones. Consider defining
keys for org-mode using evil-define-key and keys for org-capture-mode
using evil-define-minor-mode key. The former might shadow the latter
and there is no good way to fix this in the current priority order.
|
|
evil-normalize-keymaps was activating inactive minor modes in the
keymaps introduced by evil-define-minor-mode-key. This adds a
guard to make sure that this does not happen.
|
|
|
|
|
|
|
|
|
|
evil-define-minor-mode-key is similar to evil-define-key, except
it associates bindings with a minor-mode symbol instead of a
specific keymap. This has the advantage of automatically picking
up on when a minor-mode is enabled or disabled through standard
Emacs mechanisms, instead of requiring a call to
evil-normalize-keymaps to activate the binding after the mode is
toggled.
This is meant to supplement usage of evil-define-key.
|
|
|
|
It is possible for (evil-disabled-buffer-p) to return t, but for
the evil-local-mode variable to be left as t. This means that
functions that check the value of evil-local-mode wrongly assume
that evil-local-mode is enabled in these buffers. One such function
is evil-refresh-cursor.
|
|
|
|
|
|
|
|
|
|
|