Click here to Skip to main content
15,878,970 members
Articles / Programming Languages / C++
Article

Some Time-Saving Commands and Key Remappings for the VC IDE

Rate me:
Please Sign up or sign in to vote.
4.73/5 (11 votes)
17 Mar 1999 89.7K   75   12
Save time and impress co-workers with these great keyboard shortcuts

Over many months of using VC 6, I've come up with a few keyboard shortcuts that are really handy, save a few seconds here and there, and really impress co-workers. Many of the commands aren't apparent, and you wouldn't even know some of them existed unless you went through the entire command list on the Keyboard tab in the Tools-Customize dialog.

The first table lists the commands that I can't live without and use all the time. The second table lists commands I don't use quite as often, but which I still find handy. Commands marked as "built-in" already have the listed keyboard assignment. For the other commands, you'll need to map the keys yourself.

Must-Have Commands

Key

 

Command

 

Description

Ctrl+Shift+up arrow WBGoToPrevious Moves to the previous function in the current file.
Ctrl+Shift+down arrow WBGoToNext Moves to the next function in the current file.
Ctrl+Shift+G FileGoTo (built-in) If the cursor is over a filename, opens that file. Usually you move the cursor up to an #include line and then use this command. 
Ctrl+Shift+H WBOpenInclude Brings up a dialog listing all headers #include'd in the current file. Select a header and it will be opened. 
Ctrl+I SearchIncremental (built-in) Begins an incremental search. Press these keys and then start typing the text to search for. The caret will move through the file as you type. Hit Enter to leave search mode. You can then use the other search keys (like F3) to continue searching for the same text.
Ctrl+Shift+F7 BuildRebuildAll Rebuilds all files in the current project.
Ctrl+F3 FindNextWord (built-in) Finds the next occurrence of the word that the caret is currently over.
Ctrl+Shift+F3 FindPrevWord (built-in) Same as Ctrl+F3, but searches backwards.
Alt+F7 ProjectSettings (built-in) Opens the project settings dialog.
Alt+Num * DebugShowNextStatement (built-in) Moves the caret to the next statement to be executed (only when broken in debug mode).
Shift+Num * DebugShowNextStatement I add this key mapping because it's possible to type with one hand, while the previous one isn't. Yes, I'm lazy. :)
Ctrl+Shift+F9 DebugRemoveAllBreakpoints (built-in) Deletes all breakpoints.
Ctrl+Alt+Shift+F9 DebugDisableAllBreakpoints Disables all breakpoints.
Ctrl+M CheckMnemonicKeys (built-in) Checks for duplicate shortcut keys in a dialog or menu.

Other Time-Savers

Key

 

Command

 

Description

Ctrl+Enter LineOpenBelow Opens a blank line below the current line and moves the caret to the new line.
Ctrl+Shift+F8 SelectColumn (built-in) Begins a selection - move the caret to select columns of text. Easier than Alt-dragging.
Ctrl+Shift+S FileSaveAll Saves all open files.
Alt+F8 SelectionFormat (built-in) Formats the selected text according to your indentation preferences. Great for when you cut & paste code out of MSDN and the code loses its indentation.
Ctrl+Alt+up arrow LevelUp Moves to the previous occurrence of a start of a block (for instance, the next left brace).
Ctrl+Alt+down arrow LevelDown Moves to the next occurrence of an end of a block (for instance, the next right brace).
Ctrl+Shift+X CutAppendNext Press these keys right before a cut (Ctrl+X) to append the cut text to the end of the clipboard.
Ctrl+E GoToMatchBrace (built-in) If the caret is over a parenthesis, bracket, or brace, moves the caret to the matching character.
Ctrl+Shift+E GoToMatchBraceExtend (built-in) Same as Ctrl+E, but selects the text between the matching characters as well.
Ctrl+Shift+T WindowScrollToTop Scrolls the window so the current line is at the top of the window.
Ctrl+Shift+C WindowScrollToCenter Scrolls the window so the current line is at the center of the window.
Ctrl+Shift+B WindowScrollToBottom Scrolls the window so the current line is at the bottom of the window.
Ctrl+J ConditionalUp (built-in) Moves back to an enclosing #if.
Ctrl+K ConditionalDown (built-in) Moves forward to an enclosing #else or #endif.
Ctrl+Alt+S WindowSplitHorizontal Splits a text editor window into two panes (with the split running horizontally).
Alt+Up arrow WindowSwitchPaneUp Moves one pane up in a split window.
Alt+Down arrow WindowSwitchPaneDown Moves one pane down in a split window
Alt+Left arrow WindowSwitchPaneLeft Moves one pane left in a split window
Alt+Right arrow WindowSwitchPaneRight Moves one pane right in a split window

You can get the latest updates to this and my other articles at http://home.inreach.com/mdunn/code/

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior) VMware
United States United States
Michael lives in sunny Mountain View, California. He started programming with an Apple //e in 4th grade, graduated from UCLA with a math degree in 1994, and immediately landed a job as a QA engineer at Symantec, working on the Norton AntiVirus team. He pretty much taught himself Windows and MFC programming, and in 1999 he designed and coded a new interface for Norton AntiVirus 2000.
Mike has been a a developer at Napster and at his own lil' startup, Zabersoft, a development company he co-founded with offices in Los Angeles and Odense, Denmark. Mike is now a senior engineer at VMware.

He also enjoys his hobbies of playing pinball, bike riding, photography, and Domion on Friday nights (current favorite combo: Village + double Pirate Ship). He would get his own snooker table too if they weren't so darn big! He is also sad that he's forgotten the languages he's studied: French, Mandarin Chinese, and Japanese.

Mike was a VC MVP from 2005 to 2009.

Comments and Discussions

 
QuestionWill it work on VC .NET? Pin
AHTOXA8-Jun-05 5:34
AHTOXA8-Jun-05 5:34 
AnswerRe: Will it work on VC .NET? Pin
Michael Dunn9-Jun-05 6:22
sitebuilderMichael Dunn9-Jun-05 6:22 
QuestionWhere are the macros for download? Pin
TBiker24-Jan-02 10:22
TBiker24-Jan-02 10:22 
AnswerRe: Where are the macros for download? Pin
Michael Dunn24-Jan-02 10:33
sitebuilderMichael Dunn24-Jan-02 10:33 
There's nothing to download - you just assign the listed commands to the keystrokes.

--Mike--
"COM didn't solve the old version of DLL hell - it just provided us with a new and improved version of hell."
  -- John Simmons, 1/22/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.

GeneralKeyboardability Pin
Jason Hooper18-Jan-02 7:33
Jason Hooper18-Jan-02 7:33 
QuestionWill it work at all the rest of the time? Pin
5-Oct-01 8:48
suss5-Oct-01 8:48 
GeneralMore That I Like Pin
Andrew Phillips30-Oct-00 18:13
Andrew Phillips30-Oct-00 18:13 
GeneralRe: More That I Like Pin
14-Aug-01 3:14
suss14-Aug-01 3:14 
Generalwhere in registry Pin
Darren Schroeder27-Aug-00 15:15
Darren Schroeder27-Aug-00 15:15 
GeneralRe: where in registry Pin
Michael Dunn27-Aug-00 17:37
sitebuilderMichael Dunn27-Aug-00 17:37 
GeneralRe: where in registry Pin
Andrew Phillips30-Oct-00 18:01
Andrew Phillips30-Oct-00 18:01 
GeneralFindInFiles Pin
Itay Szekely7-Apr-00 23:14
sussItay Szekely7-Apr-00 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.