Fork me on GitHub
#editors
<
2015-07-16
>
cfleming06:07:42

So for editing Clojure forms, what does everyone find are the most useful ways of selecting forms? Emacs mark-sexp? Expand region? Something else?

aleksanders07:07:08

personally: vim motions

aleksanders07:07:13

lets you select any level of nested form in one go

cfleming07:07:24

How does that work?

aleksanders07:07:49

selects the surrounding form

aleksanders07:07:17

if you prepend with a number then the nth nesting form is selected

cfleming07:07:40

Ok. Can you then extend the selection to subsequent/previous forms?

aleksanders07:07:57

two neighbouring forms?

aleksanders07:07:23

hmm, not that I know of

cfleming07:07:23

right - I’m trying to figure out the best way to implement that for Cursive.

aleksanders07:07:53

well, in that case vim answer is probably not relevant simple_smile

cfleming07:07:08

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.

cfleming07:07:34

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.

colin.yates08:07:13

@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…

colin.yates08:07:57

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..

bozhidar11:07:30

I use expand-region or easy-kill

bozhidar11:07:46

I’ve never used mark-sexp for something like this

malabarba11:07:31

Just expand region here too. followed by backward/forward sexp to mark neighbors too

bozhidar11:07:38

I think IntelliJ has great expanding selection

bozhidar11:07:48

and I believe it was the inspiration for expand-region

rauh13:07:25

Cursive: Is there a command that can jump to the matching parentheses/bracket?

colin.yates17:07:53

@rauh on a mac alt+right jumps to the end of the form for me

rauh17:07:24

@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.

colin.yates17:07:42

Apparently 'Move caret to next word’ is bound to alt+right for example

colin.yates17:07:10

whats the shortcut to expand selection in IntelliJ? I am sure it was Cmd+W but that doesn’t work anymore...

cfleming21:07:17

@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.

cfleming21:07:42

@colin.yates: Edit->Extend Selection, it’s probably Alt-up

rauh21:07:04

@cfleming: Thanks, I'll try that

cfleming21:07:27

@rauh: Cool. What they’re bound to will depend on which binding set you chose.