If you want to assign a custom shortcut as of Visual Studio 2022, open Tools > Options > Environment > Keyboard.
Click in the "Show commands containing" text box and type Window.CloseDocumentWindow.
Click in the "Press shortcut keys:" text box and perform your shortcut, like ctrl + w.
Click "Assign".