Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.5K Views
|
14 Replies
|
1 Total Like
View groups...
Share
Share this post:

Is it possible to fold and unfold cells using keyboard shortcuts?

Posted 3 years ago

I would like to be able to 'fold' my functions so that only the first line appears, and then be able to unfold them again, all via the keyboard. Setting a cell to Open or not Open, sort of gives the effect I want, although I would prefer to be able to see the first line of the code.

I have seen reference to using ctrl + ' but using this on on MacOS with the latest V13 doesn't seem to do anything. Is there a setting I need to enable somewhere, or is there a totally different approach I should be using?

Cheers
Andy

POSTED BY: Andrew Burnett
14 Replies
Posted 3 years ago
Attachments:
POSTED BY: Hans Milton
Posted 3 years ago

Thanks Hans. I had never played with the .wl editor. That is actually an interesting approach. I will definitely try using that more. Being able to jump between functions is very helpful.

Cheers, Andy

POSTED BY: Andrew Burnett
Posted 3 years ago

see the signatures of all my functions without having to scroll through a whole bunch of code

I know this isn't the same thing, but there is a function for seeing definitions associated with a symbol: Information. There is a special prefix form: ??. So you can evaluate this whenever/wherever you want:

??myFunction

Just using the groupings won't show you the signatures unless you manually keep your header text in sync with the function it relates to, but Information will tell you pretty much everything you want to know.

POSTED BY: Eric Rimbey
Posted 3 years ago

Thanks Eric, that seems like a good collection of keystrokes to get me started.

Cheers Andy

POSTED BY: Andrew Burnett
Posted 3 years ago
POSTED BY: Eric Rimbey
Posted 3 years ago
POSTED BY: Andrew Burnett
Posted 3 years ago
POSTED BY: Andrew Burnett
Posted 3 years ago

Yes, it did. Cursor somewhere in the "header" cell. Then Ctrl + ' . Bracket selection not needed.

POSTED BY: Hans Milton
Posted 3 years ago

The keyboard shortcut Ctrl + ' works for me on Windows. No mouse needed.

POSTED BY: Hans Milton
Posted 3 years ago

Thank you both. I am looking for a mouse-less approach, so I will give the sections mechanism.

Cheers Andy

POSTED BY: Andrew Burnett
Posted 3 years ago

Just double-click the enclosing cell bracket?

enter image description here

Documentation link

POSTED BY: Hans Milton
Posted 3 years ago
POSTED BY: Eric Rimbey
Posted 3 years ago

Hi Eric, Thanks for your suggestions. The problem that I am trying to solve is that I am am becoming a little overwhelmed by all the functions I have defined in a relatively small program. Lots of editors let you jump between functions, but only show the function signature. Usually the function is collapsed, and you can pop it open when you want to edit it.

It's OK if it can't be done easily. Maybe it means that I need to move to a different editor once I get to this stage

POSTED BY: Andrew Burnett
Posted 3 years ago
POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard