dot404
dot404

Reputation: 208

Shortcut to delete current file in visual studio

Is it possible to delete the active file in visual studio from the editor itself with a keyboard shortcut without searching it in the solution explorer and deleting with the mouse?

This can be useful when refactoring, for example if I have

namespace Test
{
    public static class Class
    {
    }
}

resharper will suggest to remove the unused class but the file can't be deleted

Upvotes: 4

Views: 1266

Answers (1)

Matt.G
Matt.G

Reputation: 3609

In Tools->Options->Projects and Solutions->General, check Track Active Item in Solution Explorer.

enter image description here

This will highlight the file in Solution Explorer, when the file is opened in the editor. Use solution explorer shortcut key Ctrl+Alt+L, then use Delete or Shift+Del key to delete the file.

Upvotes: 8

Related Questions