简体   繁体   中英

VSCode: Shortcut key for (controlling) increasing/decreasing current split panes width/height?

Is there a quick keyboard shortcut to control the width of the current split pane, at least increasing and decreasing it?

for vim users it would be:

:vertical resize 80 :res +5 :res -5 :vertical resize +5 :vertical resize -5

and so on...

There is no default shortcut for this but you can make your own.

The following works on vscode version 1.11.2 on Linux but it should be the same for Windows users:

Go to File > Preferences > Keyboard shortcuts

(or you can use the shortcut ctrl + k ctrl + s to open it)

Search for current view size and you can set your custom key combinations for decreasing and increasing the size of the current view.

On a Mac (If you are on windows replace cmd with ctrl)

cmd-k cmd-s

Type

current view size

Double click on

View:Decrease Current View Size 

Type whatever key combo you want, I like using this

F3

Double click on

View:Increase Current View Size 

Type whatever key combo you want, I like using this

F4

Rejoice

Code ( File on window ) >> Preferences >> Keyboard shortcuts.

to the top right there is an icon to open user keyboard shortcuts.

adjust the keys to your linkings.

  {
    "key": "ctrl+shift+o",
    "command": "workbench.action.decreaseViewSize"
  },
  {
    "key": "ctrl+shift+i",
    "command": "workbench.action.increaseViewSize"
  }

The Increase Current View Size and Decrease Current View Size commands adjust both the width and the height of the view.

In case you would like too adjust just the width of the editor, use Decrease editor width and Increase editor width commands.

In split view, if you double click the current editor tab then it will increase to max, double click again and it will reset to 50%. Not a shortcut key but pretty nice nonetheless

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM