just discoverd lispy-mode for emacs, it's just amazing compared to paredit (though the two can work together)
anyone here using lispy-mode with clojure?
I'm using emacs doom configuration, just switched from paredit to lispy
however [
and ]
are used for navigating so I can't type brackets with them directly
not sure how do people handle that
bind some key to lispy-open-square
???
i abandoned lispy years ago because of that
@myguidingstar by default you'll want to insert brackets by hitting }
exactly what I'm looking for. Thanks
? how would you enter curly and straight brackets?
I just use adjust-parens-mode + aggressive-indent-mode + smartparens
Best combo I've ever tried
And I have custom bindings for most things. So I use M-left/right/up/down for navigating s-expressions
You can always press C-v and type a bracket symbol
}
inserts []
, {
inserts {}
. Because lispy itself manages brackets (such that they're always balanced), you only need a command for starting a new pair, not for individually typing in {
and }
, or [
and ]
. Its another thing that takes getting used to, and it mainly becomes painful when you operate on the file in some way that lispy is not managing that allows brackets to become unbalanced (which usually means
1. opening a file with already unbalanced parentheses
2. manually deleting a parentheses. Normally this will not happen, as if you normally go to delete a parentheses, its still being managed by lispy, and it will balance the parentheses by deleting the entire form, or if you just mean to remove a pair of parentheses and not the contents (basically splicing the form into its outer form), it will likewise handle that. If your intention is even to move the parentheses, you'll just slurp or barf with lispy as needed. But if you, say, highlight something and hit Cntrl-D
, you are manually deleting something from outside the lispy abstraction layer, and can end up disturbing the balance of the force parentheses
3. Pasting in something that is unbalanced, or pasting in something in a way that partially erases something else and unbalances brackets / parentheses / whatever).
Of course, in a scenario like that you just end up disabling lispy, fixing the parentheses, and re-enabling it, and over time you learn to disturb parentheses less. But it is kind of annoying as you adjust, and I do wonder myself is there's some quicker way to manually modify parentheses without restarting lispy (or without, say, calling something like`(insert ")")` from elisp, which I also do sometimes)
Ohh cool