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?
Usage. Set your cursor on a word or select a word and press the associated keybinding (Ctrl+r by default on macOS, Alt+r on Windows and Linux). You can also use the VS Code Command Palette and choose the Toggle command, or use the Toggle action in a context menu.
All keyboard shortcuts in VS Code can be customized via the keybindings. json file. To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. This will open your keybindings.
You can use the extension ms-vscode.cpptools
to Switch Header/Source
. If you're on Mac, then the shortcut is ⌥ O (option + O key). On windows, the shortcut is Alt+O.
Old answer:
There are currently a couple of extensions that support header/source file toggling:
bbenoist.togglehs
ryzngard.vscode-header-source
You can find more by searching the words "switch toggle header source" in the extensions tab in vscode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With