Skip to content

Commit

Permalink
Remove default key binding and inform user to explicity define one.
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Dec 1, 2015
1 parent 6491bdb commit f4da219
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ both `evil`, `bind-map` and `smartparens` to be installed.
## Principle

To execute a command while in normal state, a leader key is used.
By default, the leader for each command is `SPC l`.
The leader has to be defined with the function `evil-lisp-state-leader`.
By default any command when executed sets the current state to `lisp state`.

Examples:
Expand Down Expand Up @@ -110,16 +110,21 @@ Key Binding | Function

## Configuration

No default binding comes with the package, you have to explicitly
bind the lisp state to a key with the function `evil-lisp-state-leader`
For instance:

```elisp
(evil-lisp-state-leader ", l")
```

Key bindings are set only for `emacs-lisp-mode` by default. It is possible to
add major modes with the variable `evil-lisp-state-major-modes'.

It is also possible to define the key bindings globally by setting
`evil-lisp-state-global` to t. In this case `evil-lisp-state-major-modes' has no
effect.

The leader key is `SPC l` by default, it is possible to change it with the
function `evil-lisp-state-leader`.

If you don't want commands to enter in `lisp state` by default set the variable
`evil-lisp-state-enter-lisp-state-on-command` to nil. Then use the
<kbd><leader> .</kbd> to enter manually in `lisp state`
Expand Down
16 changes: 8 additions & 8 deletions evil-lisp-state.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
;; ----------

;; To execute a command while in normal state, a leader is used.
;; By default, the leader for each command is `SPC l`.
;; The leader has to be defined with the function `evil-lisp-state-leader'.
;; By default, any command when executed sets the current state to
;; `lisp state`.

;; By example, to slurp three times while in normal state:
;;
;; For example, to slurp three times while in normal state:
;; <leader> 3 s
;; Or to wrap a symbol in parenthesis then slurping two times:
;; <leader> w 2 s

;;
;; Key Binding | Function
;; -------------|------------------------------------------------------------
;; `leader .' | switch to `lisp state'
Expand Down Expand Up @@ -92,6 +92,10 @@
;; Configuration:
;; --------------

;; No default binding comes with the package, you have to explicitly
;; bind the lisp state to a key with the function `evil-lisp-state-leader'
;; For instance: `(evil-lisp-state-leader ", l")'

;; Key bindings are set only for `emacs-lisp-mode' by default.
;; It is possible to add major modes with the variable
;; `evil-lisp-state-major-modes'.
Expand All @@ -100,9 +104,6 @@
;; setting `evil-lisp-state-global' to t. In this case
;; `evil-lisp-state-major-modes' has no effect.

;; The leader key is `SPC l' by default, it is possible to
;; change it with the function `evil-lisp-state-leader'.

;; If you don't want commands to enter in `lisp state' by default
;; set the variable `evil-lisp-state-enter-lisp-state-on-command'
;; to nil. Then use the `.' to enter manually in `lisp state'
Expand Down Expand Up @@ -178,7 +179,6 @@ If `evil-lisp-state-global' is non nil then this variable has no effect."
:evil-keys (,leader)
:evil-states (normal)
:major-modes ,evil-lisp-state-major-modes)))
(evil-lisp-state-leader "SPC l")

;; escape
(define-key evil-lisp-state-map [escape] 'evil-normal-state)
Expand Down

0 comments on commit f4da219

Please sign in to comment.