Window and Pane Management Tricks for RStudio and your OS

Learning the hotkeys for the various programs I use has paid huge dividends in productivity over the years. I can knock out a task in a split second and move on while others are still moving their cursor over the right button.

Learning the hotkeys for window management within my OS and pane management within RStudio have been particularly hepful, and in this post, I'd like to share those hotkeys. Learn them! Then you can feel the joy of flying through previously slow, mouse-based tasks and getting back to what we all love: analyzing data.

RStudio Pane Shortcuts

default RStudio pane layout

RStudio's multi-column layout is great when you're just starting with RStudio and you need to see everything it can do. If you're like me, however, you'll find yourself annoyed at how much screen real-estate is occupied by parts of the UI that you rarely need. Knowing the hotkeys for resizing panes can help you maximize the screen realestate for the pane that's most relevant for your work.

Zoom Left/Center Column

Ctrl + Alt + Shift + F12 => Alt + Shift + 1

expand/shrink source editor pane

The default hotkey for this isn't so useful so I mapped it to Alt + Shift + 1 instead.

Zoom Right Column

Ctrl + Alt + Shift + F11 => Alt + Shift + 2

expand/shrink source editor pane

Same deal here. The default hotkey for this isn't so useful so I mapped it to Alt + Shift + 2.

Expand/Shrink Source Editor Pane

Ctrl + Shift + 1

expand/shrink source editor pane

Expand/Shrink Console Pane

Ctrl + Shift + 2

expand/shrink console pane

OS Window Shortcuts

Windows

If you use Windows, at a minimum, you should know the hotkeys for sending windows between monitors and for making them take up half of a single screen. Here they are:

Maximize a window on the left half of a screen

Windows Key + Left Arrow

Maximize a window on the right half of a screen

Windows Key + Right Arrow

Sending window to left display

Windows Key + Shift + Left Arrow

Sending window to right display

Windows Key + Shift + Right Arrow

Mac

Hotkeys for the same actions are useful to know on mac, but you'll need to install an extra window management tool to use hotkeys to manage your windows. I use Slate. Its free, open source, and pretty good. Here's my config:

config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize

layout product

# Push Bindings
bind right:ctrl;cmd  push right bar-resize:screenSizeX/2
bind left:ctrl;cmd   push left  bar-resize:screenSizeX/2
bind up:ctrl;cmd     push up    bar-resize:screenSizeY/2
bind down:ctrl;cmd   push down  bar-resize:screenSizeY/2

# Throw Bindings
bind 1:ctrl;alt         throw 0 resize
bind 2:ctrl;alt         throw 1 resize

With this config, the hotkeys to key window actions are:

Maximize a window on the left half of a screen

Cmd + Ctrl + Left

Maximize a window on the right half of a screen

Cmd + Ctrl + Right

Sending window to left display

Ctrl + Alt + 1

Sending window to right display

Ctrl + Alt + 2

Conclusion

These hotkeys will help you move faster while doing data analysis. You don't even have to memorize the hotkeys immediately. As long as you know these RStudio commands exist, you can invoke them via the fairly new command palette by pressing Cmd + Shift + P:

command palette

I hope these tips help you work faster because at data chimp, we're all about speed. If you're looking for ways to analyze data faster, check us out.