%s
")))
(setq org-html-style-default nil)
(setq org-html-head-include-scripts nil)
#+end_src
* Macros :noexport:
#+MACRO: cond The result depends on the following conditions:
* General Notes
The keybindings here assume that lispy's parinfer key theme is in use. These
keybindings are modeled after the behavior of the corresponding keys for
parinfer, but they are adapted to lispy. This means that no inference is used,
so none of the accompanying problems from that method are present. This also
means that the functionality is not exactly the same.
Take ~(~ as an example. In parinfer, the wrapping behavior is based on the
indentation. The lispy equivalent will wrap to the end of the line where the
current sexp ends by default.
With parinfer, starting with:
#+begin_src elisp
(defun foo (a b)
|let ((x (+ a b)))
(print x))
#+end_src
pressing ~(~ will give:
#+begin_src elisp
(defun foo (a b)
(|let ((x (+ a b)))
(print x)))
#+end_src
With lispy, the result will be this:
#+begin_src elisp
(defun foo (a b)
(| let ((x (+ a b))))
(print x))
#+end_src
This means that you cannot first indent and then expect the wrapping to behave
based on that indentation as you would with parinfer. However, it could be
argued that lispy's version of parinfer's ~(~ is actually more powerful since
setting up the correct indentation may be tedious. To change how many sexps are
wrapped in lispy, you can simply use a prefix =arg=. To achieve the same result
as in the parinfer example, you could press ~C-0 (~:
#+begin_src emacs-lisp
(defun foo (a b)
(| let ((x (+ a b)))
(print x)))
#+end_src
Another thing to note is that lispy will insert a space by default after
wrapping. This example with missing parens around the =let= is somewhat
contrived. Often you will want to insert something at the beginning of the sexp
when wrapping, and in these cases, this behavior is convenient.
See the individual function references for more information.
* Global bindings
:PROPERTIES:
:CUSTOM_ID: global-bindings
:END:
| key | function name |
|-----------+-----------------------------------------------------------------------------------------|
| ( | [[#lispy-parens-auto-wrap][lispy-parens-auto-wrap]] |
| [ | [[#lispy-brackets-auto-wrap][lispy-brackets-auto-wrap]] |
| { | [[#lispy-braces-auto-wrap][lispy-braces-auto-wrap]] |
| ) | [[#lispy-barf-to-point-nostring][lispy-barf-to-point-nostring]] |
| ] | [[#lispy-barf-to-point-nostring][lispy-barf-to-point-nostring]] |
| } | [[#lispy-barf-to-point-nostring][lispy-barf-to-point-nostring]] |
| TAB | [[#lispy-indent-adjust-parens][lispy-indent-adjust-parens]] |
| #+begin_src elisp (foo bar| baz) #+end_src #+HTML: | -> ~)~ -> #+HTML: | #+begin_src elisp (foo bar)| baz #+end_src #+HTML: |
#+begin_src elisp (foo bar| baz) #+end_src #+HTML: | -> ~C-u )~ -> #+HTML: | #+begin_src elisp foo bar |(baz) #+end_src #+HTML: |
#+begin_src elisp [(foo bar| baz)] #+end_src #+HTML: | -> ~)~ -> #+HTML: | #+begin_src elisp [(foo bar)| baz] #+end_src #+HTML: |
#+begin_src elisp [(foo bar| baz)] #+end_src #+HTML: | -> ~C-u )~ -> #+HTML: | #+begin_src elisp [foo bar |(baz)] #+end_src #+HTML: |
#+begin_src elisp ([foo bar| baz]) #+end_src #+HTML: | -> ~)~ -> #+HTML: | #+begin_src elisp ([foo bar baz])| #+end_src #+HTML: |
#+begin_src elisp ([foo bar| baz]) #+end_src #+HTML: | -> ~C-u )~ -> #+HTML: | #+begin_src elisp |([foo bar baz]) #+end_src #+HTML: |
#+begin_src elisp (foo |bar baz) #+end_src #+HTML: |
-> ~ | #+begin_src elisp (foo) |bar baz #+end_src #+HTML: |
#+begin_src elisp (foo ~bar| baz) #+end_src #+HTML: |
-> ~ | #+begin_src elisp (foo baz) ~bar| #+end_src #+HTML: |
#+begin_src elisp (foo (|baz bar)) #+end_src #+HTML: | -> ~DEL~ -> #+HTML: | #+begin_src elisp (foo |baz bar) #+end_src #+HTML: |
#+begin_src elisp (foo baz)| bar #+end_src #+HTML: | -> ~DEL~ -> #+HTML: | #+begin_src elisp (foo baz| bar) #+end_src #+HTML: |
#+begin_src elisp (foo baz)| #+end_src #+HTML: | -> ~DEL~ -> #+HTML: | #+begin_src elisp (foo baz|) #+end_src #+HTML: |
#+begin_src elisp "foo" "|baz" #+end_src #+HTML: | -> ~DEL~ -> #+HTML: | #+begin_src elisp "foo" | #+end_src #+HTML: |
#+begin_src elisp "foo"| #+end_src #+HTML: | -> ~DEL~ -> #+HTML: | #+begin_src elisp "foo|" #+end_src #+HTML: |
#+begin_src elisp (foo |(baz bar)) #+end_src #+HTML: | -> ~C-d~ -> #+HTML: | #+begin_src elisp (foo |baz bar) #+end_src #+HTML: |
#+begin_src elisp (foo baz|) bar #+end_src #+HTML: | -> ~C-d~ -> #+HTML: | #+begin_src elisp (foo baz| bar) #+end_src #+HTML: |
#+begin_src elisp (foo baz|) #+end_src #+HTML: | -> ~C-d~ -> #+HTML: | #+begin_src elisp (foo baz)| #+end_src #+HTML: |
#+begin_src elisp "foo" |"baz" #+end_src #+HTML: | -> ~C-d~ -> #+HTML: | #+begin_src elisp "foo" | #+end_src #+HTML: |
#+begin_src elisp "foo|" #+end_src #+HTML: | -> ~C-d~ -> #+HTML: | #+begin_src elisp "foo"| #+end_src #+HTML: |