Reputation: 26355
I'd like a simple keyboard shortcut to swap between the header (h, hpp) and CPP files. Visual Assist for Visual Studio allowed me to do this via ALT+O. Is there a similar keyboard binding for Visual Studio Code?
Upvotes: 41
Views: 49031
Reputation: 5889
If you're using the clangd
plugin already, then you don't need an additional plugin and can use cmd-opt-o.
Upvotes: 2
Reputation: 1993
You can use the extension ms-vscode.cpptools
to Switch Header/Source
.
Old answer:
There are currently a couple of extensions that support header/source file toggling:
You can find more by searching the words "switch toggle header source" in the extensions tab in vscode.
Upvotes: 68
Reputation: 83
In my case builtin IntelliSense solution conflicted with clangd plugin that I use, so the solution that worked for me was using aforementioned Header source switch plugin.
Upvotes: 0
Reputation: 29
No need for an extension, this is now built into Visual Studio.
The command you're looking for is:
EditorContextMenus.CodeWindow.ToggleHeaderCodeFile
It's by default bound to Ctrl-K, Ctrl-O.
Upvotes: 0
Reputation: 27
Ctrl + Tab, press it one and it'll always swap between A.cpp and A.h file.
Upvotes: -8