Ahmed Eid
Ahmed Eid

Reputation: 4804

Shortcut key for 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...

Upvotes: 25

Views: 16441

Answers (6)

gndps
gndps

Reputation: 821

I found these to be suitable because the buttons are just above - and + buttons on mac.

    {
        "key": "ctrl+f11",
        "command": "workbench.action.decreaseViewSize"
    },
    {
        "key": "ctrl+f12",
        "command": "workbench.action.increaseViewSize"
    }

Upvotes: 0

jasonleonhard
jasonleonhard

Reputation: 13887

  1. On a Mac (If you are on Windows or Linux replace cmd with ctrl):

    cmd-k cmd-s

  2. Type current view size

  3. Double click on Decrease Current View Size

    Type whatever key combo you want. I like using F3

  4. Double click on Increase Current View Size

    Type whatever key combo you want. I like using F4

Upvotes: 14

Tripurari Shankar
Tripurari Shankar

Reputation: 3548

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

Go to File > Preferences > Keyboard shortcuts

(or you can use the shortcut ctrl+k ctrl+s to open it on Linux and Windows, or cmd+k cmd+s on Mac)

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

Upvotes: 33

Jarppe
Jarppe

Reputation: 303

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.

Upvotes: 7

kuklei
kuklei

Reputation: 1205

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

Upvotes: 10

Ahmed Eid
Ahmed Eid

Reputation: 4804

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"
  }

Upvotes: 13

Related Questions