Skip to content

Commit 2b0dc2a

Browse files
committed
Merge pull request #175 from rranelli/tips-for-smartparens-users
Add tips for smartparens users
2 parents 9491c56 + 628db99 commit 2b0dc2a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,25 @@ experience, you can add the following to your `elixir-mode-hook`:
223223
(ruby-end-mode +1)))
224224
```
225225

226+
Also, if you use [smartparens](https://github.com/Fuco1/smartparens) you can
227+
piggyback on some of its functionality for dealing with Ruby's `do .. end`
228+
blocks. A sample configuration would be:
229+
230+
```lisp
231+
(sp-with-modes '(elixir-mode)
232+
(sp-local-pair "fn" "end"
233+
:when '(("SPC" "RET"))
234+
:actions '(insert navigate))
235+
(sp-local-pair "do" "end"
236+
:when '(("SPC" "RET"))
237+
:post-handlers '(sp-ruby-def-post-handler)
238+
:actions '(insert navigate))
239+
(sp-local-pair "case" "end"
240+
:when '(("SPC" "RET"))
241+
:post-handlers '(sp-ruby-def-post-handler)
242+
:actions '(insert navigate)))
243+
```
244+
226245
## Elixir Tooling Integration
227246

228247
If you looking for elixir tooling integration for Emacs, check: [alchemist.el](https://github.com/tonini/alchemist.el)

0 commit comments

Comments
 (0)