Skip to content

Commit

Permalink
feat(web): Add Cmd/Ctrl-Alt-H alias to hide editor (#330)
Browse files Browse the repository at this point in the history
`Ctrl-Shift-H` does not work as it is a Firefox shortcut, so this adds `Ctrl-Alt-H` as an alternative.
  • Loading branch information
taconi authored Jan 26, 2025
1 parent ec28f1f commit b32f54d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ Web-based P2P collaborative editor for live coding music and graphics

*Some keybindings may differ depending on the language/target you choose, and the operating system*

| Keybinding | Function |
| ------------------------- | ------------------------------------ |
| `alt/option` `enter` | Evaluate all |
| `ctrl/cmd` `enter` | Evaluate block, Evaluate selection |
| `shift` `enter` | Evaluate line |
| `ctrl/cmd/option/alt` `.` | Silence (output depends on language) |
| `cmd/ctrl` `shift` `h` | Show/Hide editor panels |
| `cmd/ctrl` `x` | Cut selected text |
| `cmd/ctrl` `c` | Copy selected text |
| `cmd/ctrl` `v` | Paste cut/copied text |
| `cmd/ctrl` `z/u` | Undo edit |
| `cmd/ctrl` `shift` `z/u` | Redo edit |
| `cmd/ctrl` `}` | add indentation |
| `cmd/ctrl` `{` | remove indentation |
| `cmd/ctrl` `f` | search and replace |
| Keybinding | Function |
| -------------------------- | ------------------------------------ |
| `alt/option` `enter` | Evaluate all |
| `ctrl/cmd` `enter` | Evaluate block, Evaluate selection |
| `shift` `enter` | Evaluate line |
| `ctrl/cmd/option/alt` `.` | Silence (output depends on language) |
| `cmd/ctrl` `shift/alt` `h` | Show/Hide editor panels |
| `cmd/ctrl` `x` | Cut selected text |
| `cmd/ctrl` `c` | Copy selected text |
| `cmd/ctrl` `v` | Paste cut/copied text |
| `cmd/ctrl` `z/u` | Undo edit |
| `cmd/ctrl` `shift` `z/u` | Redo edit |
| `cmd/ctrl` `}` | add indentation |
| `cmd/ctrl` `{` | remove indentation |
| `cmd/ctrl` `f` | search and replace |

*On Mac:*

Expand Down
9 changes: 6 additions & 3 deletions packages/web/src/routes/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,12 @@ export function Component() {
},
[documents, ...editorRefs],
);
useShortcut(["Meta-Shift-H", "Control-Shift-H"], () => {
setHidden((p) => !p);
});
useShortcut(
["Meta-Shift-H", "Control-Shift-H", "Meta-Alt-H", "Control-Alt-H"],
() => {
setHidden((p) => !p);
},
);
useShortcut(["Control-,", "Meta-,"], () => {
setMessagesPanelExpanded((v) => !v);
});
Expand Down

0 comments on commit b32f54d

Please sign in to comment.