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

⌨️ Keyboard shortcut for folding cell #2922

Merged
merged 8 commits into from
May 21, 2024
Merged

⌨️ Keyboard shortcut for folding cell #2922

merged 8 commits into from
May 21, 2024

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented May 16, 2024

Fix #2917

The implemented keyboard shortcut is Ctrl/Cmd + K

MacOS: ⌥⌘[ to fold, ⌥⌘] to unfold
Windows/Linx: Ctrl+Shift+[ to fold, Ctrl+Shift+] to unfold

Loosely matching VS Code

You can do this while editing a cell, or with multiple cells selected

I also made #2920 to make it more clear that folding the cell does not hide the code yet because you are still focused on the codemirror.

@fonsp fonsp added frontend Concerning the HTML editor accessibility Accessibility improvements of the frontend, like screen reader support and internationalization labels May 16, 2024
Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="keymap-fold")
julia> using Pluto

@fonsp
Copy link
Owner Author

fonsp commented May 17, 2024

Nooo Cmd+K is not so good, i misunderstood the vs code thing

But the shortcuts for "folding" "unfolding" code sections might actually be a good fit. I don't think we ever want to implement code folding (ie within cells) in Pluto because cells should be fairly small, so using it for folding cells might be a good use for the shortcuts.

image

Ctrl+Shift+[ ] on windows linux

@fonsp fonsp merged commit 5069ee4 into main May 21, 2024
3 checks passed
@fonsp fonsp deleted the keymap-fold branch May 21, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Accessibility improvements of the frontend, like screen reader support and internationalization frontend Concerning the HTML editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shortcut to "Show/hide code"
1 participant