In Tools | Options | Keyboard...
- Add
CTRL+Was a Global shortcut forWindow.CloseDocumentWindow - Remove the
CTRL+Wshortcut forEdit.SelectCurrentWord
The caveat to this is if you are used to using CTRL+W to select the current word. If you do, find another shortcut that works for that.
Here are the steps I used to configure Visual Studio 2022 to use the
Ctrl+Wkeyboard shortcut to close an active text editor tab:Using the Visual Studio top menu bar, navigate to "Tools > Options > Environment > Keyboard".
Delete any existing keyboard shortcuts that are already bound to
Ctrl+W.Create a new
Ctrl+Wkeyboard shortcut that binds to theWindow.CloseDocumentWindowcommand.Ctrl+Wkeys on your keyboard simultaneously.Click the “OK” button to save your changes & close the modal.