Fork me on GitHub
#emacs
<
2020-04-16
>
myguidingstar20:04:22

just discoverd lispy-mode for emacs, it's just amazing compared to paredit (though the two can work together)

myguidingstar20:04:11

anyone here using lispy-mode with clojure?

4
myguidingstar20:04:12

I'm using emacs doom configuration, just switched from paredit to lispy

myguidingstar20:04:54

however [ and ] are used for navigating so I can't type brackets with them directly

ag22:04:44

You can always press C-v and type a bracket symbol

myguidingstar20:04:12

not sure how do people handle that

myguidingstar20:04:43

bind some key to lispy-open-square???

dpsutton20:04:29

i abandoned lispy years ago because of that

Cameron21:04:43

@myguidingstar by default you'll want to insert brackets by hitting }

myguidingstar07:04:41

exactly what I'm looking for. Thanks

dpsutton21:04:25

? how would you enter curly and straight brackets?

didibus22:04:43

I just use adjust-parens-mode + aggressive-indent-mode + smartparens

didibus22:04:55

Best combo I've ever tried

didibus22:04:08

And I have custom bindings for most things. So I use M-left/right/up/down for navigating s-expressions

Cameron23:04:33

} 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)

aisamu01:04:28

I'm not sure if I tweaked something, but while on insert mode, delete (forwards) won't balance things. This means we're able to fix broken parenthesis/brackets by adding a pair and deleting the extra one:

| is the cursor, always on insert mode

|())

type ( 
|() ())

move forward, del, del
(|())
With my current config (lispy with lispyville) I can't copy/paste unbalanced things. When I need those I manually call org-copy-visible

aisamu01:04:28
replied to a thread:`}` 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)

I'm not sure if I tweaked something, but while on insert mode, delete (forwards) won't balance things. This means we're able to fix broken parenthesis/brackets by adding a pair and deleting the extra one:

| is the cursor, always on insert mode

|())

type ( 
|() ())

move forward, del, del
(|())
With my current config (lispy with lispyville) I can't copy/paste unbalanced things. When I need those I manually call org-copy-visible