So for editing Clojure forms, what does everyone find are the most useful ways of selecting forms? Emacs mark-sexp
? Expand region? Something else?
personally: vim motions
lets you select any level of nested form in one go
How does that work?
va)
selects the surrounding form
if you prepend with a number then the nth nesting form is selected
Ok. Can you then extend the selection to subsequent/previous forms?
two neighbouring forms?
hmm, not that I know of
right - I’m trying to figure out the best way to implement that for Cursive.
well, in that case vim answer is probably not relevant :simple_smile:
Cursive supports expanding and contracting the selection, similar to what you describe. But it’s not so good at extending the selection to neighbouring forms.
Oh yeah, it’s always interesting to see how things work in other editors, especially one that works in quite a different way like Vim.
@seancorfield: no, still puzzling. I also get the same when I use boot on that project (in either a console or emacs). It feels like some nondeterministic ordering that I am relying on which happens to work the way lein bootstraps… Why it doesn’t work with lein via emacs connected to console REPL…
I do have 4 separate component maps which are all merged in with about 30 components, almost all of which reference and explicitly declare a dependency on the :db..
I use expand-region
or easy-kill
I’ve never used mark-sexp for something like this
Just expand region here too. followed by backward/forward sexp to mark neighbors too
I think IntelliJ has great expanding selection
and I believe it was the inspiration for expand-region
Cursive: Is there a command that can jump to the matching parentheses/bracket?
@rauh on a mac alt+right jumps to the end of the form for me
@colin.yates: Hmm that doesn't work for me. Do you see a command bind to it? Though, I just discovered I can jump by top level forms with ALT+UP/DOWN which is pretty cool.
Apparently 'Move caret to next word’ is bound to alt+right for example
whats the shortcut to expand selection in IntelliJ? I am sure it was Cmd+W but that doesn’t work anymore...
@rauh: I’m not sure if there’s one to go to matching paren - Navigate->Structural Movement->Move Forward/Back do a good job though.
@colin.yates: Edit->Extend Selection, it’s probably Alt-up
@cfleming: Thanks, I'll try that
@rauh: Cool. What they’re bound to will depend on which binding set you chose.