Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I enable VIM for mac in Visual Studio?

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?

like image 510
Ryan Shocker Avatar asked Apr 23 '17 09:04

Ryan Shocker


People also ask

Can you use Vim with Visual Studio?

Vim emulation for Visual Studio CodeVSCodeVim is a Vim emulator for Visual Studio Code.

Does VSCode support Vim?

Vim for VSCode lets you do just that.

How do I get out of Vim mode in VSCode?

TL;DR – How to Exit Vim If you didn't make any changes, type :q and press Enter / return. If you made some changes and would like to keep them, type :wq and press Enter / return. If you made some changes and would rather discard them, type :q! and press Enter / return.


3 Answers

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)

Visual Studio for Mac extension gallery

You can usually find a more recent version on the github releases page than in the VS for Mac addin gallery.

like image 107
jasoni Avatar answered Oct 19 '22 13:10

jasoni


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:

external tool

like image 31
romainl Avatar answered Oct 19 '22 11:10

romainl


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.

like image 3
Andrzej Stencel Avatar answered Oct 19 '22 13:10

Andrzej Stencel