RubyMine cheat sheet

93 shortcuts in 12 lessons

Reading a list won't make them stick. ShortcutFoo has you type each shortcut, then brings it back just before you'd forget it.

Editing I

7 shortcuts
  • ^SPACE
    Basic code completion
  • ^J
    Quick documentation lookup
  • ⌘=
    Expand block
  • ⌘⇧*
    Toggle editor colum mode
  • ⌘F1
    Show description of error or warning at caret
  • ⌥DEL
    Delete to word end
  • ⇧TAB
    Unindent selected lines

Editing II

9 shortcuts
  • ⌘C
    Copy current line or selected block to buffer
  • ⌘⇧V
    Paste from recent buffers
  • ⌘D
    Duplicate current line or selected block
  • ⌘BACKSPACE
    Delete line at caret
  • ⇧↵
    Start new line
  • ⌘⇧U
    Toggle case for word at caret or selected block
  • ⌥⇧U
    Toggle Camel/Snake Case
  • ⌥BACKSPACE
    Delete to word start
  • ⌘-
    Collapse code block

Editing III

11 shortcuts
  • ^↵
    Generate code (eg Rails Generators)
  • ^O
    Override methods
  • ⌘⌥T
    Surround with (begin...end, if...then...end, etc.)
  • ⌘/
    Comment/uncomment with line comment
  • ⌘⌥/
    Comment/uncomment with block comment
  • ⌥↵
    Show intention actions/quick-fixes
  • ⌘⌥L
    Reformat code
  • ^⌥I
    Auto-indent line(s)
  • TAB
    Indent selected lines
  • ⌘X
    Cut current line or selected block to buffer
  • ⌘V
    Paste from buffer

Navigation I

7 shortcuts
  • ⌘⌥O
    Go to symbol
  • ⌘L
    Go to line
  • ⌘E
    Recent files popup
  • ⌘⇧BACKSPACE
    Navigate to last edit location
  • ⌥F1
    Select current file or symbol in any view
  • ⌥SPACE
    Open quick definition lookup
  • ⌘⌥]
    Move to code block end

Navigation II

9 shortcuts
  • ⌘⌥[
    Move to code block start
  • ⌘F12
    File structure popup
  • ^H
    Type hierarchy
  • F2
    Next highlighted error
  • ⇧F2
    Previous highlighted error
  • ⌘DOWN
    Jump to source
  • ⌘↵
    View source
  • ⌥F3
    Toggle bookmark with mnemonic
  • ^3
    Go to bookmark 3

Search/Replace

10 shortcuts
  • ⌥F7
    Find usages
  • ⌘F7
    Find usages in file
  • ⌘⇧F7
    Highlight usages in file
  • ⌘⌥F7
    Show usages
  • ⌘F
    Find
  • ⌘G
    Find next
  • ⌘⇧G
    Find previous
  • ⌘R
    Replace
  • ⌘⇧F
    Find in path
  • ⌘⇧R
    Replace in path

Refactoring

8 shortcuts
  • F5
    Refactor Copy (only for files)
  • F6
    Refactor Move (only for files)
  • ⇧F6
    Refactor Rename
  • ⌘⌥V
    Introduce variable
  • ⌘⌥C
    Introduce constant
  • ⌘⌥F
    Introduce field
  • ⌘⌥M
    Extract method
  • ^T
    'Refactor this...' quick list

Live Templates/Snippets

3 shortcuts
  • ⌘JFLASH
    Insert template - flash [:attr] = "..."
  • ⌘JRA
    Insert template - render :action => "action"
  • ⌘JRT
    Insert template - render :text => "text"

Debugging

9 shortcuts
  • F8
    Step over
  • F7
    Step into
  • ⇧F8
    Step out
  • ⌥F9
    Run to cursor
  • ⌥F8
    Evaluate expression
  • ⌘⌥R
    Resume program
  • ⌘F8
    Toggle breakpoint
  • ⌘⇧F8
    View breakpoints
  • ⌥F10
    Show execution point

Run

5 shortcuts
  • ^R
    Run
  • ^D
    Debug
  • ^⇧R
    Run context configuration from editor
  • ^⇧D
    Debug context configuration from editor
  • ⌥R
    Run Rake task

Rails

5 shortcuts
  • ⌘⇧↵
    Complete statement (only in RHTML)
  • ⌘⇧>
    Insert <%= %> (only in RHTML)
  • ⌘⌥G
    Run Rails generator
  • ⌘R
    Reload application sources (only in Rails Console)
  • ⌥⇧L
    Load file/selection into IRB / Rails console

General

10 shortcuts
  • ⌘D
    View Diff
  • ⌘⇧D
    VCS operations popup
  • ⌘3
    Open tool window 3
  • ⌘S
    Save all
  • ⌘⌥Y
    Synchronize
  • ⌘^F
    Toggle full screen mode
  • ⌥⇧F
    Add to Favorites
  • ⌥⇧I
    Inspect current file with current profile
  • ⌘,
    Open Preferences dialog
  • ^`
    Quick switch current scheme