views:

807

answers:

25

What are the most useful keyboard short-cuts in an IDE

I know of Visual Studio:

  • SHIFT+ALT+F10 - Show Smart Tag

I wish there were Eclipse like functionality below:

  • CTRL+SHIFT+H - Show Hierarchy
  • CTRL+T - Find related Types
  • CTRL+SHIFT+T - Open Types
+3  A: 

Visual Studio: F5 or Ctrl-F5 - debug/execute without debug

tvanfosson
+2  A: 

CTRL+F

I'm always searching for something!

EndangeredMassa
+1  A: 

Visual Studio

  • Ctrl + Shift + F Find in multiple files.
  • Ctrl + K + D Apply default formatting rules.
  • Ctrl + K + C Comment section.
  • Ctrl + K + U Uncomment section.
  • Ctrl + Alt + E Debugger auto break on exception settings.
JD Conley
+9  A: 

Crtl + Z: Undo!

BBetances
+2  A: 

In Visual Studio:

F12 on a method or variable to go to the method source or variable definition.

LeopardSkinPillBoxHat
+1  A: 

In Visual Studio:

Highlight a block of code, and then press Ctrl-K-F to nicely adjust the indentation of the entire block. This also takes into account condition blocks and loops.

LeopardSkinPillBoxHat
wow, that's nice... why can't it do this by default when you paste something?
DShook
It must be an editor option, because my VS seems to adjust indentation and formatting when pasting code in.
nsr81
Go to Options->Text Editor-><Language>->Tabs and check what setting you have for "Indenting". "Smart" indenting will automatically indent the code for you when you have conditional statements and loops and automatically remove the indent when required (so you don't have redundant whitespace).
LeopardSkinPillBoxHat
Hmmm...this doesn't seem to work when pasting code, only when writing new code :-(
LeopardSkinPillBoxHat
A: 

If you are using resharper (highly recommended) these are the biggies:

  • Alt-Enter for the quick fixes and context actions
  • Alt-Insert for the code generation stuff
  • Ctrl-Shift-R for the refactoring tools
  • Alt-` for the navigation stuff (go to type, go to file). I hardly ever use solution explorer because of this short cut
PhilCo
A: 

Ctrl + Shift + Home End UpArrow DownArrow.

Much better than using the mouse to select a lot of text. Not really IDE specific, but definitely the combo I use the most.

Ed Swangren
+6  A: 

Ctrl + C & Ctrl + V

Robert Gould
Hm, is that a refactoring chord? I'm pretty sure that one is the "Make reusable" refactoring! :)
Michael Meadows
cschol
+1  A: 

Visual Studio:

CTRL-R + CTRL-T

Runs unit tests in current scope (which I usually do more often than running the app)

ctacke
I assume that's Visual Studio, no? You didn't say.
paxdiablo
A: 

Emacs:

CTRL-LEFTSHIFT-RIGHTSHIFT-META-ALT-WINDOW-APPLE-X to exit.

:-)

Seriously, CTRL-F11 in Eclipse to re-run last, so as to avoid the stupid Run dialog box.

Or the infamous "." in vi to repeat the last command.

paxdiablo
A: 

ReSharper: Alt-Enter : "Fix the problem"

and maybe not most used but at least frequently used in Visual Studio:

Ctrl-K, Ctrl-M : add method stub, very useful for TDD

F9 : toggle breakpoint

Brian Rasmussen
A: 

ctrl shift B - building solution

ctrl K F - to format xml

ctrl m o - to expand and collapse methods.

ctrl shift f - global find and replace

Jobo
A: 

I often used F12 for finding the declaration of the function/variable and Shift+F12 for finding all references.

BeowulfOF
A: 
ctrl + shift + }

in visual studio: find matching brace.

Jesse Pepper
+2  A: 

Resolve a type... i.e. add a "using" directive automatically:

[Ctrl]+. followed by [Ret]

The [Ctrl]+. brings up the smart-tag window; the [Ret] accepts the default choice.

for example:

StringBuilder[Ctrl]+., [Ret]

adds using System.Text; to the class header.

Marc Gravell
indeed, very good shortcut. Happy I learned about that one.
Davy Landman
Holy crap that's useful! I use the right-click version all the time, but that's gold.
ctacke
A: 

In Eclipse: CTRL+SHIFT+R for finding a file

Patjoh
A: 

Build, whatever that may be assigned to in the IDE of the Day.

Ignacio Vazquez-Abrams
A: 

F7 to toggle between code-behind and code-in-front in ASP.NET

Triptych
A: 

vi/vim or ViEmu for Visual Studio extension.

hjkl for left, down, up and right respectively

Yada
A: 

In Visual Studio,

CTRL+K, D to format the entire document.
F5 and CTRL+F5 to run solution with or without debugging.
CTRL+Space Trigger Intellisense dropdown.
"prop" TAB TAB for easy properties.

nsr81
+1  A: 

CTRL + F to search

CTRL + I to incrementally search

CTRL + SHIFT + F to search the whole project

I do a lot of searching...

Ty
+2  A: 

For Eclipse:

  • CTRL + S to save
  • CTRL + space for code completion
  • CTRL + . and CTRL + , cycle down/up through compile errors
  • CTRL + 1 bring up quick fix menu for compile errors
  • ALT + SHIFT + L to extract local variable
  • ALT + SHIFT + M to extract a method

Otherwise the most useful ones for me are the version control shortcuts for my Eclipse SVN plugin.

Also, not an IDE shortcut, but perhaps the most important one I use, WINDOWS + L to lock my computer when I leave.

Instantsoup
ctrl + space for sure!
dotjoe
+1  A: 
Zaagmans
+1  A: 

In Visual Studio:

  • CTRL + T, A Run all tests
  • CTRL + T, C Run all test from this class
  • CTRL + T, T Run current test method
  • CTRL + T, CTRL + A Debug all tests
  • CTRL + T, CTRL + C Debug all test from this class
  • CTRL + T, CTRL + T Debug current test method
  • CTRL + SHIFT + SPACE Reshow parameter/overload list
Davy Landman