Eclipse shortcuts in Visual Studio 2013 - eclipse

Is there a way to set the shortcuts for Visual Studio to the shortcuts I'm used from eclipse?
I know I can go to the options and set every single shortcut manually. But I'm looking for a way to set them all at once. Some kind of key map import plus an eclipse key map file maybe!?

To set up your keyboard short cuts in VS2013, Go to the dialog: TOOLS->Options->Environment->Keyboard .
Once you have your environment the way you like it, export the setting in the following dialog:
TOOLS->Options->Environment->Import and Export Settings.
Once exported you can copy the file and import them to any other machine you may use. This can also be used for saving a common settings file for your team in TFS (or any other revision control system you may be using).
Personally, I have not played with this feature so your mileage may vary.

Related

Is it possible to paste files copied to the clipboard from other applications in VS Code?

Within the explorer panel of VS Code itself, if I want to copy a file to another directory in the workspace, I can use ctrl+c and ctrl+v, but if I find a file from another application on my computer such as the native File Explorer application, first pressing the shortcut key ctrl+c and then going to the VS Code window and pressing the shortcut key ctrl+v in the Explorer panel, there is no effect.
Note that I'm not talking about copying the contents of the file and pasting into VS Code. I'm talking about copying "the file" as in the notion of the file to the desktop environment.
The workaround is the use the native file explorer, copy the file first, then open the folder opened in VS Code, and finally paste it within the native file explorer. But I find this so troublesome.
Is there an easier way to do this? Does VS Code support such functionality to paste files copied to the clipboard from a different application (not VS Code) and paste into VS Code? Is that functionality hidden behind a setting that I need to change? Or is this possible via an extension?
Vscode does dragging the filename from a native file explorer (at least on Windows) and dropping in vscode's Explorer where you want it.
You can also use your OS's Open With... functionality and then drag the tab of that editor into whichever directory you want.
You can choose Add File from File to add a file to your workspace. Or you can use New File from File to create a new file in your workspace and copy the content of the file outside to it.
At the time of this writing, this is not supported... yet!
Work to implement this is tracked under this GitHub issue: Explorer: allow to paste files from the clipboard into target folder #130036, which is a subtask of a larger issue tracking a larger effort for Better drag and drop / clipboard integration of files across applications #164.
You can give a thumbs up reaction on those issue pages to increase their prioritization (but please don't leave "me too" comments there, as such comments are considered annoying noise).
pingren (a contributor to the VS Code repository) tried to implement this and found it to be more complicated than it looks. You can read their explanation of why in their comment there. One of the difficulties stems from itegration with system keybindings and VS Code's affordance for remapping keys:
the onPaste event could only be triggered by system paste (cmd+V on macOS). Users could change filesExplorer.paste command to any keybindings. So we need to consider how to merge native paste from clipboard and VSCode explorer paste.
There's another feature-request issue (Copy paste files from native explorer to vscode #89862, created before #130036) where isidorn (another VS Code contributor) commented:
This is a fair feature request however I believe there is a Chrome limtation which is preventing us from achieving this. [...]
As for extensions that might do this, I don't know of any (but haven't tried searching intently).
Other possible workarounds:
Try dragging the file from your native file explorer application to the VS Code file explorer panel. This is confirmed to work at least on Windows and Ubuntu.
From Mark's answer (copied under CC-BY-SA):
You can also use your OS's Open With... functionality and then drag the tab of that editor into whichever directory you want.
From user103's answer (copied under CC-BY-SA), and partially mentioned in the question post already:
You can choose Add File from File to add a file to your workspace. Or you can use New File from File to create a new file in your workspace and copy the content of the file outside to it.

Copy enable/disable extensions settings to another workspace

Idea:
I wanted to clean up my vscode extensions, because I'm working with a lot of different languages/file types and having all these extensions installed and enabled at once is just too much.
Problem:
I disabled some extensions for a specific workspace, and wanted to copy these settings to another workspace, but vscode is not storing the information about enabled/disabled extensions in .vscode/settings.json.
Questions:
Is there any way to copy these settings from one workspace to another?
Is there a better way of dealing with lots of extensions?
Can you recommend tools/extensions for managing extensions per workspace or language(s)
I assume vscode is not loading all extensions at once, but rather when needed. But some extensions display icons on the left or bottom of the window and overcrowd the "Show All Commands" list/search.
VS Code stores this info in its internals instead of the .vscode folder, so you can't copy this info between workspaces. There is an open issue asking exactly what you want.
But, you have an alternative. Use the Profile Switcher extension.
Its description:
This extension allows you to define a number of settings profiles that you can easily switch between. The original idea for this extension came from my desire to have an easy way for me to switch my VS Code to a setup that was better optimised for presenting (changed themes, increase font size, etc).
And this is how it handles extensions:
A profile isn't just the settings you have enabled, but also the extensions that were installed. This allows you to create different profiles for different styles of development (e.g. a React profile and a Vue profile, loading their respective extensions only).
Hope this helps
There is a github issue for this problem: Feature Request: Enable/disable extensions from config file #40239.
I posted there a workaround using multiple vscode instances: link
Here is a copy-paste:
I use some kind of workaround to be able to use the extensions I want.
According to the vscode-cli your can specify the folders for extensions and user-data:
Options Description
--extensions-dir <dir> Set the root path for extensions.
--user-data-dir <dir> Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.
Basically, I create a specific folder for my specific tasks (one of front, one for back, ..) and set basic extensions to my default vscode.
To launch my custom config:
code --extensions-dir "$HOME/.vscode/profiles/my-super-profile/extensions" --user-data-dir "$HOME/.vscode/profiles/my-super-profile/data"
The problem are that:
It's not REALLY a project config file but a global preference file
I had to install manually the extensions. I believe there is a hackish way to do this
It use more size than necessary (multiple vscode data / duplicate extensions)
It doesn't solve in a clean way the team-sharing problem

How to set which extensions are enabled when opening a new folder or workspace?

So I have a great many extensions, and on any given project, I find myself using maybe a third of all of them (If I'm working on a Python project, I don't really need JavaScript related extensions now do I?). The problem is that right now VS Code loads and enables every single extension installed at the start of each new project. I find it a pain to then have to manually go and disable all the extensions I won't be needing for the project.
Is there a way to setup VS Code to only enable certain extensions when opening a new folder / workspace? I couldn't find anything in the docs on that subject and when looking at the extension section of the preferences I couldn't find such a functionality.
As of Feb 2023, it is now possible to create different Profiles in VS Code.
A Profile can include extensions, settings, keyboard shortcuts, UI state, tasks, and user snippets. You can customize VS Code for different development scenarios like data science, documentation writing, or for multiple programming languages like Python or Java. If you have different VS Code setups based on workflow such as "Work" or "Demo", you can also save those as different profiles. You can open multiple workspaces (folders) with different profiles applied simultaneously.
The following image demonstrates a folder opened with a Work profile that is customized for a work setup.
To my knowledge, the best you can do is use the Enable, Enable (Workspace) and Disable, Disable (Workspace) options.
Here is how ended up doing this:
Open a new workspace / folder.
Disable all extensions using Disable.
Enable all extension that you want to have enabled in every new project with Enable.
Enable extensions that you only want to use in this particular workspace / folder with Enable (Workspace)
From then on, when you open a new workspace, only the "default" extensions should be enabled. If ever you want to disable one of these "default" extensions in a particular workspace but still want it to be a "default" extension, make sure to use the Disable (Workspace) option.

Is there any trick to make Visual Studio Code Quick Open faster?

Quick Open is a must-have feature in any IDE, but in Visual Studio Code (by default bound to cmd+e on Mac) it seems to be very slow in finding anything. Is there any configuration option/trick to make it faster by indexing files etc.?
We plan to add indexing in future updates. Until then you can configure to exclude more folders from searches. The setting is called search.exclude and allows to set patterns.
Btw quick open learns about files you open often and keeps those in a MRU list. Quick open should be fast for those files.
This extension might be useful for opening files faster:
https://marketplace.visualstudio.com/items/astral-keks.folder-indexing
It allows user to navigate to any file in workspace by just typing part of its name in editbox opened by workbench.action.showAllSymbols (Go To Symbol In Workspace) command.

Workspace Editor Macros in Eclipse

Is there a way to record permanent workspace macros in Eclipse and assign them a shortcut key or template?
I'd like to automate some of the actions I routinely do. Workspace editor templates are not a solution since I need to include some conditional logic as well. For example check what is a symbol to the right/left of the cursor.
See my answer at How can I launch more than one debug session in Eclipse from a single click? . The same plugin can work for you as well.