leora
leora

Reputation: 196469

Visual studio or resharper shortcut to close currently selected file in IDE

Is there a shortcut in VS 2005 or resharper to close the current file. or "save and close" would be even better

Upvotes: 12

Views: 3285

Answers (4)

DantaliaN
DantaliaN

Reputation: 163

Tools -> Options -> Keyboard

Find "Windos.CloseDocumentWindow"

And for me, need to set "Use new shortcut in" to "text editor" to override old ctrl+w without delete

Upvotes: 0

Gishu
Gishu

Reputation: 136613

Ctrl + F4

Save and close would Ctrl + S followed with Ctrl + F4

Upvotes: 14

Tjelle
Tjelle

Reputation: 996

Ctrl+S, Ctrl+F4 will save and close the current file.

Upvotes: 4

Flavio Wuensche
Flavio Wuensche

Reputation: 10326

Visual Studio 2015 + Resharper

The question is a bit old. Just wanted to update it with the current solution.
As you can see below, you can also completely customize your shortcuts:

  • just navigate to Tools > Options

enter image description here

  • on the left pane, go to Environment > Keyboard

enter image description here

  • now use the field Show commands containing to search for file.close

  • select File.Close on the list

  • click the field Press shortcuts keys

  • type your desired shortcut, for example, <Ctrl> + W

  • finally, click Assign

And you're good to go!

Upvotes: 11

Related Questions