Some handy Visual Studio editor shortcuts

on

I’ve come across a number of cool keyboard shortcuts in the Visual Studio text editor recently. I’ve CTRL-S’ed these into my brain, here’s a quick list, let me know in the comments if you’ve discovered more of them.

CTRL-Enter: The inverse of pressing enter, this inserts a newline above your current line, not below. Super handy

CTRL-X: Cuts selection, but also cuts an entire line if nothing is selected

CTRL-arrow keys: move cursor left right one word at a time

CTRL-shift-arrow keys: moves and selects one word at a time.

CTRL-space: opens Intellisense with relevant content

CTRL-K, U: uncomments current line or selection

CTRL-K, C: uncomments current line or selection

CTRL+K,  M: generate method stubb for currently selected non-existing method call

CTRL-K, F: Format current line or selection

Shift-tab: moves selection back one tab

Shift-CTRL-W: select word the cursor is on [I have this mapped to CTRL-D because I use it so much]

CTRL+K,CTRL+O:  switch between header and CPP file, in C++ projects [Visual Studio 2013 only]

Note that your setup might be different, you can see all of the available shortcuts and how they’re configured in Tools | Options | Environment | Keyboard

(Yes more blogposts will be coming soon, I’ve been busy procastinating!)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s