ReSharper

ReSharper is a wonderful add-in tool for use with Microsoft's Visual Studio.

  1. General goal for programmers: Don't Use The Mouse

    Use keyboard short cuts instead.

    Remove the icons at the top of Visual Studio to force you to learn the shortcuts.

    (Keyboard Jedi is a great tool for demos to show key combinations.)

  2. First Step: Set Two Defaults
    1. Set Keymapping Scheme

      ReSharper/Options.../General/ Restore ReSharper keyboard shortcuts:/Resharper 2.x or IntelliJ IDEA

    2. Set Cache location

      ReSharper/Options.../General/System/Store caches in / system TEMP folder

    3. Makes Larger IntelliSense Fonts

      ReSharper/Options/IntelliSense/Completion Appearance/Display completion/Text Editor

    4. Highlight With Outline

      ReSharper/Options/Environment/Editor/Braces and parentheses / Highlight with outline

    5. CamelHumps

      ReSharper/Options..../Environment /Editor/Select "Use CamelHumps"

    6. Whole Project Analysis

      ReSharper / Options / Code Inspection Settings / Analysis Errors in Whole Project

  3. Set Code Inspection Severity

    Open Survey.cs, look at sealed rule and change severity (ReSharper/Options.../Code Inspection/Inspection Severity)

  4. Naming rules (new 4.5 feature)

    Open Survey.cs look at "const" (Options/Languages/Common/NamingStyle)

  5. Basics
    Key Chord Description
    Shift-Alt-l Locate current file in solution explorer
    shift-escapeIf focus is in solution explore, this hides it
    Esc Backout of current operation
    Alt-Enter Context-sensitive ReSharper hints
    Ctl-w Widen highlighted area
    Ctl-l Delete current line
    Ctl-d Duplicate current line
    F12 Go to next ReSharper issue
    Shift-F10 Shows context-menu, right mouse

    Example: Undo the checkout of a file with only the keyboard.

  6. GoTo:
    Key Chord Description
    Ctl-n find type. CanUseCamelCase: GS
    Ctl-shift-n find file. Can use wild-cards: *.xslt
    Ctl-shift-Alt-n find symbol (a method/field... on any object)
    Ctl-F12 find member. CanUseCamelCase: GSKQ
    Ctl-b go to method under cursor. Even works in nant to go to target.
    Ctl-Alt-b go to implementation of interface method
    Ctl-f12 shows all methods in object
    Ctl-shift-backspace go to previous edit point
    Ctl-tab shows files, puts in previous file
    Ctl-e recently visited files
    Ctl-Alt-7find all usages
  7. Live Template Lab: Person object.
    1. Alt-Insert to create a Person class.
    2. Usage: enter abbreviations followed by tab.
    3. Examples: psvm, out, outv, prop
    4. Create cir (ReSharper/Live Templates.../User Templates/C# right-click)
    5. Create post (public override string ToString()) with $END$
    6. "new Person()" Ctl-Alt-v abstract variable creates receiving variable
    7. Ctl-Alt-j for surround templates for exception handling
    8. Alt-Enter for split assignment / F12 / Alt-Enter for initialize variable
    9. Live Templates / XML built in t, tc, a / /
  8. Refactor Lab:
    Key Chord Description
    F2 rename local variable
    Ctl-Alt-v introduce variable
    Ctl-Alt-m extract method
    Ctl-F6 change method signature
    Ctl-R inline method
  9. IntelliSense on steroids
    Key Chord Description
    Ctl-Space Gets IntelliSense,
    Ctl-Alt-Space Gives ALL IntelliSense
    Ctl-shift-Space Gives only valid objects
  10. Miscellaneous Key Mappings
    F6 moves class to new file
    Ctl-u find parent
    Ctl-shift-F7 color codes variable
    Alt-delete safe delete
    Alt-rnc creates new class
    Ctl-shift-b build
    Ctl-r Ctl-w show white space
  11. Native VS2008 Key Mappings
    Key Chord Description
    Ctl-i for incremental search in vs2008
    c-shift-v cycle paste buffers
    Alt-br to rebuild solution
    Ctl-shift-z : undo undos