Key mappings for Visual Studio Code - visual-studio-code

I'm quite accustomed to the key mappings used in TextWrangler and other editors and I'd like to migrate those mappings into VS Code.
Is it possible to import key mappings from external applications in VS Code?
(Wild card: Failing the above question, does anyone publish key mapping files for VS Code?)

You can install a Keymap extension that brings the keyboard shortcuts from your favorite editor to VS Code.
Go to Preferences > Keymap Extensions to see the current list on the Marketplace.
Reference:
https://code.visualstudio.com/docs/getstarted/tips-and-tricks

Related

Importing IntelliJ IDEA classic keymap into VS Code in MacOS

I have customized some shortcuts in the IntelliJ IDEA classic keymap. I want to import all those shortcuts into VS-Code as sometimes I have to use both IDEs.
I have installed a plugin in VS-Code to easily provide a keymap JSON file. But I can't find my current IntelliJ keymap file JSON file.
I do not find a folder called keymaps as mentioned here -> https://www.jetbrains.com/help/idea/configuring-keyboard-and-mouse-shortcuts.html#custom_keymap_location
I already imported this keymap into VS-Code. But as I stated I have some customizations I have done on top of the default IntelliJ IDEA classic keymap. So, I'm clearly missing those shortcuts.
OS: Darwin x64 21.1.0
VS-Code : 1.65.0
IntelliJ Ultimate Version: 2021.2.1
Any help would be appreciated.
Try looking from ~/Library/Application Support/JetBrains/IntelliJIdea2021.3/settingsRepository/repository/keymaps/ instead of ~/Library/Application Support/JetBrains/IntelliJIdea2021.3/keymaps/
There you might find the XML settings of your custom keymaps.
If the folder is not there, does that mean Jetbrains might have overridden your custom keymaps? Could you check?
Jetbrains only put a custom keymap file as additional settings on top of the default keymap. ie. If I copy a macOS default keymap and edit some, there would be an entry in the keymap.xml
<keymap name="..." parent="macOS" >
...
</keymap>

Are there keyboard mapping layout files for popular IDEs?

I've been switching various C++ IDE lately. And every one of them has it's own key map. Are there any key map file repository to quickly import layout files for various IDE?
I'm used to Eclipse. Thus expect Ctrl+D to delete line, F5-F7 buttons to navigate in debugger, etc. Visual studio has mapped those to Ctrl+L and F9-F11. Qt Creator has no delete line by default. Each time it is manual mapping for each IDE.
CLion does a great job by including most popular IDE shortcuts. But for instance Qt Creator has only Import/Export feature. So maybe someone already stumbled this issue and has key map schemes?
I stumbled only across it coming from Eclipse now using Visual Studio Code from time to time.
Visual Studio Code -> Here I installed the Extension: Eclipse Keymap. At least feels a bit like home ;-)
QT Creator -> I just googled but you can set the keys: QtCreator for Eclipse Users

Visual Studio keymap for Eclipse is wrong

I tried setting the provided Visual Studio keymap in Eclipse, but the shortcuts just do not seem to match. For example, to comment current line / selection, the Visual Studio hotkey was CTRL+K,C and it does not work in Eclipse.
EDIT: Also, in VS the default key to go to previous cursor position was CTRL+- .. in Eclipse this seems to be ALT+- even with the VS keymap enabled.
Is there anywhere I could find a proper keymap?

Is it possible to customize the F12 goto definition behavior of Visual Studio Code C/C++ extension?

My C project has some special symbol lookup rules, which is very different from the conventional one. Is it possible to customize the Visual Studio Code or its C/C++ extension's F12 goto definition behavior? Thanks.

Cannot open solution file in Visual Studio Code

I have installed the Visual Studio Code on Windows. When I try to open a solution file in VS Code it opens the solution file, instead of opening all projects in solution. Is there a way to open existing project solutions in VS Code?
When you open a folder in VSCode, it will automatically scan the folder for typical project artifacts like project.json or solution files. From the status bar in the lower left side you can switch between solutions and projects.
Use vscode-solution-explorer extension:
This extension adds a Visual Studio Solution File explorer panel in Visual Studio Code. Now you can navigate into your solution following the original Visual Studio structure.
https://github.com/fernandoescolar/vscode-solution-explorer
Thanks #fernandoescolar
VSCode is a code editor, not a full IDE. Think of VSCode as a notepad on steroids with IntelliSense code completion, richer semantic code understanding of multiple languages, code refactoring, including navigation, keyboard support with customizable bindings, syntax highlighting, bracket matching, auto indentation, and snippets.
It's not meant to replace Visual Studio, but making "Visual Studio" part of the name in VSCode will of course confuse some people at first.
But you can open the folder with the .SLN in to edit the code in the project, which will detect the .SLN to select the library that provides Intellisense.
In the VSCode Marketplace look up and install vscode-solution-explorer