Skip to content

Commit

Permalink
Merge branch 'develop' (v0.48.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Jan 22, 2015
2 parents e0e35c4 + 1b6281f commit a48cee6
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 6 deletions.
6 changes: 5 additions & 1 deletion doc/DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ is **guaranteed** to never conflict with `Spacemacs` defaults key bindings.
## Escaping

`Spacemacs` uses [evil-escape][] to easily switch between `insert state` and
`normal state` with the key chord `fd`.
`normal state` by quickly pressing the `fd` keys.

The choice of `fd` was made to be able to use the same sequence to escape from
"everything" in Emacs:
Expand All @@ -877,6 +877,10 @@ to `jj` (it is important set the variable in `dotspacemacs/init`):
(setq-default evil-escape-key-sequence "jj"))
```

**Note:** Although `jj` or `jk` are popular choices of vim users, these key
sequences are not optimal for `Spacemacs`. Indeed it is very easy in
`visual state` to press quickly `jj` and inadvertently escape to `normal state`.

## Executing Vim, Emacs and shell commands

Command | Key Binding
Expand Down
2 changes: 1 addition & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst spacemacs-version "0.48.6" "Spacemacs version.")
(defconst spacemacs-version "0.48.7" "Spacemacs version.")
(defconst spacemacs-min-version "24.3" "Mininal required version of Emacs.")

(defun spacemacs/emacs-version-ok ()
Expand Down
49 changes: 49 additions & 0 deletions spacemacs/extensions/evil-escape/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Customization](#customization)
- [Key sequence](#key-sequence)
- [Delay between keys](#delay-between-keys)
- [Limitations](#limitations)

<!-- markdown-toc end -->

Expand Down Expand Up @@ -84,4 +85,52 @@ composed with the two same characters it is recommended to set the delay to
**Note:** The variable `evil-escape-delay` must be set before requiring
`evil-escape`.

## Limitations

Due to the current implementation only the following characters can be used
as the first character of the key sequence:

| Keys |
|:----------:|
|<kbd>b</kbd>|
|<kbd>B</kbd>|
|<kbd>e</kbd>|
|<kbd>E</kbd>|
|<kbd>f</kbd>|
|<kbd>F</kbd>|
|<kbd>G</kbd>|
|<kbd>h</kbd>|
|<kbd>H</kbd>|
|<kbd>j</kbd>|
|<kbd>k</kbd>|
|<kbd>l</kbd>|
|<kbd> </kbd>|
|<kbd>K</kbd>|
|<kbd>L</kbd>|
|<kbd>M</kbd>|
|<kbd>n</kbd>|
|<kbd>N</kbd>|
|<kbd>t</kbd>|
|<kbd>T</kbd>|
|<kbd>w</kbd>|
|<kbd>W</kbd>|
|<kbd>{</kbd>|
|<kbd>}</kbd>|
|<kbd>#</kbd>|
|<kbd>%</kbd>|
|<kbd>`</kbd>|
|<kbd>'</kbd>|
|<kbd>(</kbd>|
|<kbd>)</kbd>|
|<kbd>*</kbd>|
|<kbd>,</kbd>|
|<kbd>/</kbd>|
|<kbd>;</kbd>|
|<kbd>?</kbd>|
|<kbd>|</kbd>|
|<kbd>^</kbd>|
|<kbd>+</kbd>|
|<kbd>_</kbd>|
|<kbd>-</kbd>|

[MELPA]: http://melpa.org/
11 changes: 7 additions & 4 deletions spacemacs/extensions/evil-escape/evil-escape.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Sylvain Benner <[email protected]>
;; Keywords: convenience editing evil
;; Created: 22 Oct 2014
;; Version: 2.05
;; Version: 2.06
;; Package-Requires: ((emacs "24") (evil "1.0.9"))
;; URL: https://github.com/syl20bnr/evil-escape

Expand Down Expand Up @@ -128,13 +128,16 @@ with a key sequence."
`:delete-func FUNCTION'
Specify the delete function to call when deleting the first key."
(let ((shadowed-func (plist-get properties :shadowed-func))
(insert-func (plist-get properties :insert-func))
(delete-func (plist-get properties :delete-func)))
(let* ((shadowed-func (plist-get properties :shadowed-func))
(evil-func-props (when shadowed-func
(evil-get-command-properties shadowed-func)))
(insert-func (plist-get properties :insert-func))
(delete-func (plist-get properties :delete-func)))
`(progn
(define-key ,map ,(evil-escape--first-key)
(evil-define-motion ,(evil-escape--escape-function-symbol from)
(count)
,@evil-func-props
;; called by the user
(if (called-interactively-p 'interactive)
(evil-escape--escape ,evil-escape-key-sequence
Expand Down

0 comments on commit a48cee6

Please sign in to comment.