I know, first thing you’re asking is “What is Ctrl+D”? It’s a keyboard command I fell in love with back in VS 2005 days – a “light” version of the FIND dialog.
I’m assuming everyone knows about Ctrl+F, which brings up the standard FIND dialog. But in VS 2010 it’s disappointingly slow to present the dialog. When I’m cutting code, I want to find something NOW, not in a few milliseconds.
In the default C# keyboard mapping, Ctrl+D is called “Edit.GotoFindCombo”. This command puts the cursor in the “Find ComboBox” in the Standard toolbar. From here, when you hit RETURN, VS will find the text you typed in the ComboBox. It has the same history as the Find dialog if you want to arrow down to a recent search term.
In a new VS install, I typically create a new custom toolbar that becomes my “main” toolbar, and it combines my favorite commands from all the various toolbars (edit, find, debug, window management, source control, etc).
A long long time ago, my Ctrl+D functionality stopped working as well. Hitting that keystroke would not put the cursor up in the Find ComboBox. The other day I just happened upon the answer. I can’t remember why, but for some reason I had the Standard toolbar displayed in addition to my custom main one. When I hit Ctrl+D, the cursor DID go to the Find ComboBox … IN THE STANDARD TOOLBAR! So all this time, Ctrl+D has been (sort of) working – just going to MY Find ComboBox in my custom toolbar.
The fix: I removed the Find ComboBox from the standard toolbar, so now only one exists, in my toolbar, and the keystroke works.
I know … simple pleasures…
Of course there are other alternatives to FIND via Ctrl+D or Ctrl+F. There’s Ctrl+F3 which finds based on the text that’s “under” the cursor (or any currently selected text), and there’s Ctrl+I that does an incremental search as you type. (Still trying to get used to that one – it’s a little disconcerting when I fat finger a key and have to correct the text, all the while the current selection is jumping all over my code.)
One more cool tidbit about the Find ComboBox: did you know if you have the cursor up there, type a file name of a file in your solution, and hit Ctrl+Shift+G – VS will open the file?! This is not that big of a deal any longer with R# which has better file navigation features, but kind of fun/handy to quickly open app.config for example.
(As an aside, I HATE how they changed the toolbar customization in VS 2010 – you can no longer drag-n-drop items from one toolbar to the other or from the dialog of all commands. Instead you have to monkey around in the customize dialog and find/add them manually.)