Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 324
dot404 Avatar asked Oct 24 '25 15:10

dot404


1 Answers

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.

like image 53
Matt.G Avatar answered Oct 26 '25 05:10

Matt.G



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!