How can I enable VIM for mac in Visual Studio? - c#

I just got Visual Studio for my Mac. Although in Beta, it seems nice. Unfortunately, I can't seem to figure out where VIM could be. I've searched the marketplace, but cannot load any file or extension into the IDE to enable VIM. I've checked the preferences in keyboard behavior, but nothing.
Does this IDE really not have one of the most essential tools?

Use VsVim with Visual Studio for Mac 8.4 or newer.
Original Answer
Shameless plug - Use my plugin :) https://github.com/nosami/XSVim/releases
It's now available in the Visual Studio for Mac extension gallery (under IDE extensions)
You can usually find a more recent version on the github releases page than in the VS for Mac addin gallery.

Visual Studio for Mac is not a direct port of Visual Studio for Windows. It's essentially an alpha-level rebranding (with a lot of work put into it but still) of another IDE called Xamarin Studio, itself essentially a rebranding of MonoDevelop.
As such, you shouldn't expect any compatibility with other tools in the Visual Studio ecosystem for the time being.
However, you can set up MacVim as an external tool if you really want, but you won't get any kind of integration per se:

What worked for me was downloading VsVim addin as *.mpack file from this page: https://addins.monodevelop.com/Project/Index/403. In my case the file was named Vim.Mac.VsVim-2.8.0.7.mpack.
After downloading the file, I opened Visual Studio for Mac, selected Visual Studio - Extensions from the menu to open the Extension Manager pop-up window, clicked Install from file... button and selected the downloaded *.mpack file.
Needed to restart Visual Studio to get the extension to work.
This was done in Visual Studio for Mac 8.7.8.

After last VisualStudio update (8.1.3 - a new Editor is in place) Vim doesn't work anymore.
At least for now, you need to mark a setting in Visual Studio that forces use of the old editor, as described in the extension's README here.
From that page:

You need to use VsVim. Also, for those who find this via google, the workaround steps are:
Uninstall the broken VsVim extension and restart Visual Studio for Mac.
[Download](https://addins.monodevelop.com/Stable/Mac/8.5/Vim.Mac.VsVim-2.8.0.5.mpack via your browser)
In VsMac, go to the Extensions pane and click Install From File. Navigate to your Downloads folder and select the .mpack file you downloaded.
For some reason the extension doesn't work right away. You need to restart Visual Studio for Mac.
Reference: link

Related

Unity solution not compatible with visual studio

Since updating to the most recent version of Unity 5.4.0f3, whenever I doubleclick on a script, it launches both Visual Studio and Monodevelop, but I get an error saying that the this version of VS (Community 2015) is unable to open my project. Monodevelop displays it's own, somewhat less clear error message. Please see the screen shots below.
I can still manually open my script using Visual Studio's file menu, but the intellisense code completion no longer works. Anyone know how to fix this? I have Visual Studio's Tools for Unity installed.
I was having similar issues when doing a clean download of an existing Unity project onto a fresh install of Visual Studio Community 2019.
In the end the issue for me was that, although the correct version of VS Tools for Unity was installed, it was 'Disabled' by default in VS's Manage Extensions dialog (Extensions -> Manage Extensions). Just had to click 'Enable', restart Visual Studio, and all worked as expected again.
Turns out it was an issue with my existing install of Visual Studio Tools for Unity (VSTU).
I found a thread where users had experienced similar problems due to an unsupported version of VSTU running on Unity5.2 and beyond. Unity 5.2+ requires VSTU 2.1 or later for VS to work correctly with Unity, more information for anyone interested is available in the documentation here.
I had VSTU 2.3 installed, but removing and reinstalling VSTU resolved the issue, so there must have been a problem with my install. If anyone else has this or a similar issue you can download the latest installer for VSTU here. Thanks to all who chimed in your responses helped me look in the right place!
Please try following steps:
Delete old *.csproj and *.sln files on project's root folder
Check "Edit > Preferences > External Tools" and make sure you've selected "Visual Studio"
Re-open solution by "Assets > Open C# Project" menu
For me it was enough to right click the solution in Solution Explorer and run "Resolve errors".
I will complete what is said above. I experienced this issue today and it took me a while. In my case it was relative to a new install of the Unity Editor.
For some unknown reason the unity tool used on VS (intellisense) was uninstalled. I had to reinstall this : open Visual Studio Installer, select your project and reach the Gaming section where reside the tool for Unity.
The extension "Visual Studio 2019 Tools for Unity" seems no longer available for download via the extension manager. Luckily I recalled that I saw some game development features in the Visual Studio installer, so I picked that one:
It works for VS 2019 (16.11.11) and VS 2022 (17.2.0 Preview 1).

Is it possible to work on a ASP.NET application on Visual Studio 2015 and VS Code? [duplicate]

How do I open I a Visual Studio Code folder in Visual Studio 2015?
If I open it as a "Web Site", it tries to treat the node_modules directory as part of the project's normal JavaScript files and hits an error when the path exceed the maximum path length.
But I can't open it as any other project type unless I first create a project of that type and then move all the VS Code files into that folder.
Should I be trying to open it as a web site?
Or should I create a new project and then copy the files + folders into it?
Is there any advantage to having it as a project?
If I do create a project, it makes it difficult to work together with someone who is just using VS Code?
And if I use a project, which project type should I select?
Finally folder view has arrived in VS 2017 :)
You can find more details in here.
Currently there is no way to open a folder directly with Visual Studio.
Why? Because Visual Studio and Visual Studio Code only shared their name, not the idea behind it. To extend Jenny O'Reilly answer:
Visual Studio Code is a folder oriented editor
This means VSC has the same Point-of-View to your Project as the File Explorer.
Visual Studio (not Code) is a solution oriented integrated development environment (short IDE)
Instead every Project in Visual Studio needs a *.sln Solution-File as Root Component. From this point Visual Studio looks at your Project. An example would, if you copy File in your Project Folder, they wouldn't be recognized from Visual Studio. You have to add them first to your sln File, to see them. It also allows the developer to combine multiple projects (*.csproj,..) into one single Solution to build.
This means the idea behind these two editors is completely different.
Visual Studio (not code) Project-types for Web
There are Node.js Tools for Visual Studio
This will provide Node.js built-in project templates
Visual Studio 2015 comes with TypeScript templates
Workaround 1
A workaround would be a Blank Solution in which you set up your Visual Studio Code Project.
Workaround 2
Another trick would be the answer to this question. You can open your Project Folder as a Website Project.
File -> Open Website -> File System and choose the folder
Update
As you mentioned, there will be errors because Visual Studio tries to build the solutions. For the next few readers of this response, the work around for this (as John Pankowicz writes in the comment) is:
Right-click Web Site in Solution Explorer -> Property Pages -> Build -> Uncheck "Build Web Site as part of solution"
Update 2
(Thanks to JC1001 for this update)
The next version of Visual Studio (Visual Studio "15") will support opening a folder. This is mentioned in the Visual Studio Blog.
Also like in Visual Studio Code, there will be a prompt command for opening Folders. Right now you can use this in the preview version:
devenv /command “file.openfolder FOLDER_PATH”
In the future you will be able to use:
devenv FOLDER_PATH
Opinion
Personally I wouldn't recommend Visual Studio (not code) for HTML/Website projects without server-side-development, because I don't see any features. Even the intellisense suggests to me sometimes bad HTML Code (it's not the IDE's fault).
After all web projects are still text files. You can easily control group projects like this with Version Control. Visual Studio Code even provides an integrated Git support.
Visual Studio Code does not create "project files" that you can open in Visual Studio 2015. Basically, when you open up a Node website in Visual Studio, you need to re-create the folder structure in VS2015 and create a "project file".
I haven't seen any better ways of doing this, but will be happy when we can open a folder just as easilly as we can with VSCode
I'm sure it's not the best way but..
Open an existing .sln with notepad, change the names, save as [name of your project].sln.
Open with Visual Studio.

Is there a c# windows form Application in visual Studio 2015?

I installed Visual Studio 2015, and tried to create a windows form, just as I used to do it in the VS2010. I could not find a Windows form for C#.
How can I create one? Do I need to install another version or do I need a plugin or something?
Screenshot: http://prntscr.com/8rwzyl
Informations about my Visual Studio: http://prntscr.com/8rx0a1
It seems you are opening new project in Blend. You have to use Visual Studio (not Blend).
Blend and Visual Studio are installed together with Visual Studio Community Edition 2015 . You probably run a wrong shortcut (which starts Blend).
The Checked Answer is correct however there is no explanation of how to solve this. I just came to the same problem, but figured it out. When searching in your file directory C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE
Then you can search .exe and it will come up with Blend and devenv. Or just scroll till you find devenv. devenv is the clickable application for visual studio community. :)

Working with Unity3D and Visual Studio 2013

how do i get Unity3D for debugging the code, and Visual Studio 2013 which i have now to only script the code. Example: Like Flash Professional for debugging and FlashDevelop for scripting only.
My question is, how do i get the Unity3D link with Visual Studio 2013. I already searching around the internet, and had found that Unity3D only works with VisualStudio 2010.
I wrote a blog article on this awhile back on my blog HERE for Visual Studio.
However I will paste it here too:
How to use Visual Studio 2013
Recently Microsoft bought and re-released the popular Unity3D plugin UnityVS. The now renamed Visual Studio Tools for Unity plugin smooths the connection between Unity and Visual Studio and even allows one to perform debugging too! Download it here.
In Unity Editor go to Edit->Preferences->External Tools and In External Script Editor choose Browse from the drop down box.
Browse to and select C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.
The External Script Editor should automatically show your selected editor as Visual Studio 2013.
That’s it! It should just work from that point on.
As an important update, I would like to notice, that former UnityVS (after Microsoft's acquisition of SyntaxTree) is now available for free as a rebranded Visual Studio 2013 Tools for Unity.
The versions for VS 2012 and VS 2010 are also available.
The integration of Unity3d and Visual Studio got simpler with latest Unity (version 5) and Visual Studio Tools. This is the current procedure.
To use Visual Studio as editor and debugger with Unity you must:
Install the Visual Studio Tools For Unity. For this download the package at http://unityvs.com (careful to get the version for the Visual Studio you are using) and import it (as is standard in Unity for packages) by going into Assets -> Import Package -> Custom Package and browse to the tools installation folder and pick the package.
Once installed in Unity you will get an additional menu Visual Studio Tools, go there and select "generate project files". Visual Studio will already be the default editor for your scripts.
This done, if you say put a breakpoint in Visual Studio, click on "Attach to Unity" in Visual Studio, and then run your Unity project, the process will stop at breakpoints in Visual Studio and allow variable inspection etc.
you can use unityvs VS plugin (but I'm not sure about current 2013 support, it's works with vs2012) http://unityvs.com/ - on windows it's works very well, but remote OSX debugging feature is not ready yet
I'd like to add to the fine answer given by Pietro Polsinelli, that for me, there was an extra step in his Step 1. And that is that, after installing Visual Studio Tools For Unity, I had to, in Unity, go to Assets->Import Package->Visual Studio 201X Tools and then click around on the menu bar until "Visual Studio Tools" showed up as an option. After that, I could Generate Project Files and Open in Visual Studio.
This enabled me to Attach to Unity in Visual Studio and debug.
None of these solutions worked for me. Renaming monodevelop just changed the default program to notepad++, and the next default program after that was simply notepad.
However, there is a known bug with Visual Studio 2013 (not sure if it was present in previous versions, or if it is present in the non-professional version) where if you try to open a C# file in visual studio, where Visual Studio is opened as administrator and Unity isn't, VS crashes.
I had to either run both programs (VS and Unity) as administrator, or not open VS as administrator (as per the solution found here: http://connect.microsoft.com/VisualStudio/feedback/details/597863/cannot-open-visual-studio-files-from-windows-explorer).
With Visual Studio You Can Use UnityVS Plugin But if You Use Monodevelop You Can Go To Run->Attach To Process.. And Connect The Debugger to Unity Editor It Work Perfectly.
To link Unity with Visual Studio, do the following:
Do this on Unity.
Go to file --> preferences --> external tools --> external script editor --> Choose visual studio.
If Visual Studio is not showing, you Re gonna have to browse Visual Studio by hand.
Then you open any script in the Unity Project window and Visual Studio should open the file.
I hope this is helpful.
Note that I am using Unity 2020.2 and Visual Studio 2019

Visual Studio Extensibility Package 2010 and 2012. Is there a way to have one package for both?

A while ago I created a Visual Studio Package/Add-In for Visual Studio 2010 (for those curious: http://visualstudiogallery.msdn.microsoft.com/ea23f9a7-a942-45b2-87e6-5df6ff0444ff). If I try to download that and install it in Visual Studio 2012, it doesn't work, I get a version error.
So my first thought was to see what happens if I try to port it to 2012. I downloaded and installed the VS2012 RC SDK, and basically recreated the whole thing in a separate solution and it all works. What I noticed was that many of the assemblies I had to reference (Microsoft.VisualStudio.*) were now version 11 as opposed to version 10 (for obvious reasons). After copying and pasting all the code over, I got it to work correctly in Visual Studio 2012.
My question now is this: Is it possible to have one .vsix file for multiple versions of Visual Studio (I'm guessing no.) If not, what's the correct approach to take as far as uploading the different versions? Can I upload two versions of a .vsix? Will the Add-In manager in visual studio pick the correct one automatically? Do I need to create a new package e.g. "Visual Pastie 2012"? Just looking for some guidance.
Rename the VSIX package to give it a ZIP extension and open it up. You'll find a file called extension.vsixmanifest. Inside this XML file you'll find an element called SupportedProducts which should look like the following to work in VS2012.
<SupportedProducts>
<VisualStudio Version="11.0">
<Edition>Pro</Edition>
</VisualStudio>
</SupportedProducts>
HTH

Categories

Resources