JonyEpsilon / gorilla-repl

A rich REPL for Clojure in the notebook style.
http://gorilla-repl.org
MIT License
887 stars 104 forks source link

Auto-indent code #149

Closed JonyEpsilon closed 8 years ago

JonyEpsilon commented 10 years ago

It would be nice to be able to trigger a re-indent of the code in a segment. As @lspector points out, as well as being helpful for keeping things neat, this can help out beginners a lot by effectively highlighting their errors.

JonyEpsilon commented 9 years ago

@lspector Much to my surprise, I've just discovered that selecting code and hitting shift+tab already does this, to a limited degree at least! Good old CodeMirror :-)

lspector commented 9 years ago

Wonderful! If it surprised you then it probably won't be obvious to others, so maybe this can somehow be called out to users?

On May 6, 2015, at 12:29 PM, Jony Hudson notifications@github.com wrote:

@lspector https://github.com/lspector Much to my surprise, I've just discovered that selecting code and hitting shift+tab already does this, to a limited degree at least! Good old CodeMirror :-)

— Reply to this email directly or view it on GitHub https://github.com/JonyEpsilon/gorilla-repl/issues/149#issuecomment-99530136.

Lee Spector, Professor of Computer Science Director, Institute for Computational Intelligence Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspector@hampshire.edu, http://hampshire.edu/lspector/ Phone: 413-559-5352, Fax: 413-559-5438

JonyEpsilon commented 9 years ago

Yes, once I figure out what it actually does I'll call it out in the documentation.

edw commented 8 years ago

I'd like to call attention to this issue. Coming from an antique editing experience where I've been using Paredit for a decade and Emacs for over two, Gorilla frustrated me nearly to the point of throwing my laptop out the window until I found this shift-tab tip. I'm currently on my second or third go at Gorilla; my previous flirtation with it came to an end in large part due to my ignorance of this feature—and the lack of good structural editing, but that's minor compared to indenting.

JonyEpsilon commented 8 years ago

:-)

I've added a note to the website.

It would be really nice to have this presented as a command in the command menu, so it would be discoverable in the same was as the other commands. Not sure I really know how to do that straightforwardly though.