In Tools | Options | Keyboard...
- Add
CTRL+W
as a Global shortcut forWindow.CloseDocumentWindow
- Remove the
CTRL+W
shortcut 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+W
keyboard 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+W
keyboard shortcut that binds to theWindow.CloseDocumentWindow
command.Ctrl+W
keys on your keyboard simultaneously.Click the “OK” button to save your changes & close the modal.