Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code pane management like Origami

Has anyone found a way to have more complex pane layouts in Visual Studio Code, like those supported by Origami for Sublime? Layouts beyond splitting on the same axis are something that I really miss from Sublime.

like image 872
Pat Putnam Avatar asked Aug 23 '17 18:08

Pat Putnam


People also ask

How do I enable folding in VS Code?

There are several advanced keyboard shortcut to fold/unfold code blocks in VSCode, although I personally don't use them very often. Toggle Fold (Ctrl+K Ctrl+L) folds or unfolds the region at the cursor.

How do you fold and unfold in VS Code?

Use Shift + Click on the folding icon to fold or unfold the region and all regions inside. You can also use the following actions: Fold (Ctrl+Shift+[) folds the innermost uncollapsed region at the cursor. Unfold (Ctrl+Shift+]) unfolds the collapsed region at the cursor.

What is Zen mode in VS Code?

Zen mode is a feature in a VS Code that hides all UI (Status Bar, Activity Bar, Panel, and Sidebar) and displays only the editor on a full screen. Zen Mode.

How do I get out of Zen mode VS Code?

Press Esc twice to exit Zen Mode.


2 Answers

like @pat-putnam says, VSCode now supports editor window splitting 🎉

To replicate the Origami experience, we need the Origami keyboard shortcuts too. To do this, paste the JSON snippet shown below into your VSCode keybindings.json.

You can quickly open keybindings.json in VSCode by pressing cmd+shift+p and then typing keyb and clicking the Preferences: Open Keyboard Shortcuts (JSON) completion hint that appears.

enter image description here

[
  {
    "key": "cmd+k up",
    "command": "workbench.action.splitEditorUp"
  },
  {
    "key": "cmd+k right",
    "command": "workbench.action.splitEditorRight"
  },
  {
    "key": "cmd+k down",
    "command": "workbench.action.splitEditorDown"
  },
  {
    "key": "cmd+k left",
    "command": "workbench.action.splitEditorLeft"
  },
  {
    "key": "cmd+k up",
    "command": "-workbench.action.moveActiveEditorGroupUp"
  },
  {
    "key": "cmd+k right",
    "command": "-workbench.action.moveActiveEditorGroupRight"
  },
  {
    "key": "cmd+k down",
    "command": "-workbench.action.moveActiveEditorGroupDown"
  },
  {
    "key": "cmd+k left",
    "command": "-workbench.action.moveActiveEditorGroupLeft"
  }
]

Note that if you have existing key bindings that you want to preserve, you should remove the [ and ] from the JSON snippet and just paste the config objects into your existing array.

These custom keybindings are for the editor-window-splitting functionality from Origami that I use most often. There are a few more Origami keyboard shortcuts beyond these four. It would be cool in the future to create a VSCode keybinding file that fully replicated the Origami keyboard shortcuts, and then release that as a VSCode keymap. Future work.

like image 128
Micah Stubbs Avatar answered Oct 19 '22 04:10

Micah Stubbs


I recently revisited Visual Studio Code and found that you can now window split to your hearts content. Simply right click on any pane and select the appropriate split action.

enter image description here enter image description here

like image 20
Pat Putnam Avatar answered Oct 19 '22 03:10

Pat Putnam