Home
Tags:

Visual Studio. Hotkeys

Other names: keyboard shortcuts, key bindings

Editor

  • shift + enter: New line underneath
  • ctrl + d: Duplicate line
  • ctrl + shift + up/down: edit multiple lines at once
  • ctrl + l: delete line (cut)
  • ctrl + k, ctrl + c: comment selection

Go to Definition, Implementation, Declaration, References

  • F12: Go to definition
  • Ctrl+F12: Go to implementation

Collapse all definitions/methods

  • ctrl+m ctrl+o: Collapse all definitions/methods
  • ctrl+m ctrl+p: Expand all
  • ctrl+m ctrl+m: Toggle collapse and expand current section

Intellisense

  • ctrl + space: Show complete suggestions. Will list all words available for completion in the current context
  • alt + right arrow: Show complete suggestions
  • alt + /: Copilot

Refactoring

  • Ctrl+Shift+R: Refactor this (Displays a list of refactoring options)
  • Ctrl+.: Quick actions and refactorings
  • Ctrl+K+E: Sort usings and remove "unused usings" in the file
  • Ctr+R Ctrl+G: Sort usings and remove "unused usings" in the file

Formatting

  • ctrl+k+d: Format code (entire document)
  • ctrl+k+f: Format Code (selection only)
  • ctrl+left/right: Skip a word left/right
  • Home: Go to start of the line
  • End: Go to the end of the line
  • PgUp/PgDown:
  • shift+PgUp/PgDown: move to the top/bottom of the screen
  • ctrl+Home: Go to the first line of the document
  • ctrl+End: Go to the last line of the document
  • alt+up/down: Go to the next method up/down

Window Management

  • shift+alt+enter: enter full screen

Bookmarks

  • ctrl+k ctrl+k: Set bookmark
  • ctrl+k ctrl+p: Go to previous bookmark
  • ctrl+k ctrl+n: Go to next bookmark
  • ctrl+,: go to file
  • ctrl+t: go to type