Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Hotkeys for Folding Subheadings and Disabling Auto-Expansion of Subheadings #12519

Closed
AdRmeon opened this issue Sep 18, 2024 · 5 comments

Comments

@AdRmeon
Copy link

AdRmeon commented Sep 18, 2024

In what scenarios do you need this feature?

This feature is particularly useful when working with large documents that have multiple levels of subheadings. For instance:

  • When organizing notes or writing long articles, I often need to quickly collapse specific sections to focus on others.
  • In project documentation or research work, I want to collapse lower-level subheadings (like H4, H5, etc.) without affecting higher-level ones (H1, H2) to maintain a clean and focused view.
  • Similar to using VS Code for coding, where folding code blocks helps me manage the complexity of the document, I want this in SiYuan for note structuring.

Hotkeys for Subheading Folding: I expect the ability to assign customizable hotkeys to fold/unfold subheadings of specific levels (e.g., press a key combination to fold all H2 subheadings or only H3 subheadings).

Disable Auto-Expansion of Subheadings: I expect an option in the settings that allows me to prevent lower-level subheadings (e.g., H3, H4) from automatically expanding when their parent (e.g., H1) is opened. This would allow me to control what parts of the document are visible.

Scenarios:

  • Reviewing long documents with a clear hierarchy, where I only want to see certain levels of detail.
  • Creating structured lesson plans, research papers, or technical documentation where I need to hide detailed sections unless I specifically choose to open them.

Describe the optimal solution

Hotkeys for Folding by Subheading Level:
The best solution would be similar to the functionality in VS Code. In VS Code, you can fold/unfold code blocks or headings with simple shortcuts like Ctrl + K, Ctrl + [n], where [n] is the heading level. In SiYuan, customizable hotkeys for different heading levels (H1, H2, H3, etc.) would be ideal. For instance:
Ctrl + 1 folds/unfolds all H1 subheadings.
Ctrl + 2 folds/unfolds all H2 subheadings.
Toggle Auto-Expansion of Subheadings:
There should be an option in the settings that prevents all child subheadings (H5, H6, etc.) from automatically expanding when their parent heading is opened. Users should be able to manage this behavior globally or per document.

Describe the candidate solution

  • Limited Hotkeys for Folding:

  • Even if hotkeys are only available for a few heading levels (e.g., H1 to H3), this would still improve the workflow for large documents.

  • Auto-Expansion Settings per Heading Level:

  • If fully disabling auto-expansion is too complex, adding an option to control auto-expansion based on specific heading levels (e.g., preventing H4 and below from auto-expanding) would be acceptable.

Other information

I would like to request two features that could enhance the workflow for many users:

Hotkeys for Folding Subheadings by Level
It would be very helpful to have hotkeys that allow us to fold/unfold subheadings of different levels (H1, H2, etc.), similar to the functionality available in VS Code. This would greatly improve navigation, especially when working with large documents.

Option to Disable Auto-Expansion of Subheadings
Currently, when a higher-level heading is expanded, all of its subheadings are automatically opened. It would be great to have an option to prevent this auto-expansion, allowing us to control which subheadings remain folded or unfolded.

@88250
Copy link
Member

88250 commented Sep 19, 2024

Duplicate of #11533

@88250 88250 marked this as a duplicate of #11533 Sep 19, 2024
@88250 88250 closed this as completed Sep 19, 2024
@TCOTC
Copy link
Contributor

TCOTC commented Sep 19, 2024

这个 issue 的需求应该是折叠/展开标题块而不是折叠/展开大纲标题,因为他提到了展开标题块遇到的问题:

The requirement of this issue should be to collapse/expand the title block rather than collapse/expand the outline title, because he mentioned the problem encountered in expanding the title block:

when a higher-level heading is expanded, all of its subheadings are automatically opened.

@88250
Copy link
Member

88250 commented Sep 19, 2024

when a higher-level heading is expanded, all of its subheadings are automatically opened.

这个没有办法解决,只能全部展开。
There is no way to solve this problem except to expand them all.

@TCOTC
Copy link
Contributor

TCOTC commented Sep 19, 2024

能否提供批量折叠文档中的所有同一级标题的(6个)快捷键?

Is it possible to provide a shortcut for batch collapsing all headings of the same level in a document?

@88250
Copy link
Member

88250 commented Sep 19, 2024

@TCOTC

暂时不考虑了,建议用大纲面板进行导航。
PS:如果提 issue 的人使用了英文,我们还是翻译一下吧,谢谢。

We won't consider it for now. I suggest using the outline panel for navigation.
PS: If the person who raised the issue used English, we will translate it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants