editors

Discussion about all editors used for Clojure/ClojureScript
cfleming 2015-07-16T06:57:42.001582Z

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

2015-07-16T07:30:08.001583Z

personally: vim motions

2015-07-16T07:32:13.001584Z

lets you select any level of nested form in one go

cfleming 2015-07-16T07:32:24.001586Z

How does that work?

2015-07-16T07:32:43.001587Z

va)

2015-07-16T07:32:49.001588Z

selects the surrounding form

2015-07-16T07:33:17.001589Z

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

cfleming 2015-07-16T07:33:40.001590Z

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

2015-07-16T07:33:57.001591Z

two neighbouring forms?

2015-07-16T07:34:23.001592Z

hmm, not that I know of

cfleming 2015-07-16T07:34:23.001593Z

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

2015-07-16T07:34:53.001594Z

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

cfleming 2015-07-16T07:35:08.001595Z

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.

cfleming 2015-07-16T07:35:34.001596Z

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.yates 2015-07-16T08:32:13.001597Z

@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.yates 2015-07-16T08:32:57.001598Z

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

bozhidar 2015-07-16T11:34:30.001599Z

I use expand-region or easy-kill

bozhidar 2015-07-16T11:34:46.001600Z

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

malabarba 2015-07-16T11:36:31.001601Z

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

bozhidar 2015-07-16T11:36:38.001602Z

I think IntelliJ has great expanding selection

bozhidar 2015-07-16T11:36:48.001603Z

and I believe it was the inspiration for expand-region

rauh 2015-07-16T13:32:25.001604Z

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

colin.yates 2015-07-16T17:47:53.001606Z

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

rauh 2015-07-16T17:49:24.001607Z

@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.yates 2015-07-16T17:50:42.001608Z

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

colin.yates 2015-07-16T17:52:10.001609Z

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

cfleming 2015-07-16T21:16:17.001611Z

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

cfleming 2015-07-16T21:16:42.001612Z

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

rauh 2015-07-16T21:17:04.001613Z

@cfleming: Thanks, I'll try that

cfleming 2015-07-16T21:17:27.001614Z

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