Giter VIP home page Giter VIP logo

Comments (5)

bixuanzju avatar bixuanzju commented on June 1, 2024 12

press }

from lispy.

abo-abo avatar abo-abo commented on June 1, 2024

Thanks, @bixuanzju.

@JohnGurin, it's a little weird, but if you're familiar with vi, you know how
important it is to quickly enter normal mode (ESC in vi).
Here [, ] and C-3 perform the function of entering normal mode.

The cost is just a small inconvenience for entering []. But since
you already enter {} with a shift key plus [, it's not to
different to enter the other pair shifted as well.

If you want to customize some bindings, look at lispy-setup-new-bindings.
It contains modifications to the default bindings that I don't like any more.
Most importantly the swap of a and h. It's possible that these corrections
will become defaults in a future release.

from lispy.

JohnGurin avatar JohnGurin commented on June 1, 2024

I'm just getting used to structural editing. So the question about brackets seems silly. Bindings is a matter of taste, and default bindings of current version are fine with me.
In my configuration I added "wrap sexp" binding to resemble paredit's wrap

(defun custom-lispy-wrap ()
    (interactive)
    (call-interactively 'lispy-mark-list)
    (call-interactively 'lispy-parens)
)
(add-hook 'lispy-mode-hook
      (lambda ()
        (local-set-key (kbd "M-(") 'custom-lispy-wrap))) 

from lispy.

abo-abo avatar abo-abo commented on June 1, 2024

Actually lispy-pair will wrap sexp when called with a digit argument,
e.g. 2 ( or C-u (.

Also, lispy-mark-list only works in special currently, so it makes sense
to bind the command that uses it in the appropriate way:

(defun custom-lispy-wrap ()
  (interactive)
  (lispy-mark-list)
  (lispy-parens 1))

(lispy-define-key lispy-mode-map "Y" 'custom-lispy-wrap)

Or add a backup plan in case the point isn't special:

(defun custom-lispy-wrap ()
  (interactive)
  (unless (or (looking-at lispy-left)
              (looking-back lispy-right)
              (region-active-p))
    (lispy-backward 1))
  (lispy-mark-list)
  (lispy-parens 1))

(local-set-key (kbd "M-(") 'custom-lispy-wrap)

from lispy.

benjamin-asdf avatar benjamin-asdf commented on June 1, 2024

Sometimes users get confused about how to insert single [. I have answered this here: https://www.youtube.com/watch?v=kPWUYT6kYLQ

tldr; C-q, which is bound to quoted-insert

from lispy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.