fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.91k stars 284 forks source link

⌨️ Keyboard shortcut for folding cell #2922

Closed fonsp closed 1 month ago

fonsp commented 1 month ago

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.

github-actions[bot] commented 1 month ago

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 commented 1 month ago

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