0

I have looked at some related posts, such as Vim as Visual Studio IDE.

The poster seems to want to bring the full power of VIM into Visual Studio, which I understand to be a fairly messy procedure. This is not what I want.

I just want plain vanilla VIM to be functional with the VS IDE. That is, all I want is to be able to switch between Normal and Insert mode (for starters), where I can move through code within Normal mode and type in text within Insert mode. Using the search and marking features would be nice as well, but I just want to make one step at a time. Of course I can just open up a terminal and VIM through the source code, but I would not have the useful VS IntelliSense at my disposal.

I am asking for suggestions/advice on how to achieve the above but a good reference (book, article, another stackoverflow post, etc.) on how to achieve the above also suffices for an answer.

4
  • what version of vim are you using, and on what operating system? Commented Jan 19, 2019 at 19:24
  • VIM 8.0, and Windows 7. Commented Jan 19, 2019 at 20:28
  • Did you give VsVim a try? It is not actually vim itself, but a quite solid emulation of vim's basic features in VS. Commented Jan 23, 2019 at 17:28
  • I really do like that it's a simple installation without any hassle afterwards. It would be perfect if there was an obvious way to scroll through the options provided by Intellisense without using the arrow keys! Commented Jan 24, 2019 at 1:56

1 Answer 1

0

I'll caveat this answer by saying that I don't use Visual Studio, but the options available are similar regardless of the IDE.

If I understand your question correctly, I think you have two options:

1) Install a vim emulation plugin. This should be able to integrate basic vim functionality into the IDE off the bat. Vim by vscode looks like it might satisfy your requirements; the repository states that it implements Normal Mode and Insert Mode, searching with / and ?, and some mark features. (source: ). VsVim by Jared Par, is also another option, although less well documented.

2) Set up vim as an External tool in your IDE. Open the External Tools (Tools > External Tools). Set the command to point to your vim installation and the arguments"+call cursor($(CurLine)$(CurCol))" $(ItemPath) (you might need to play around with escaping to get this to work). This should open the current file in native vim at the current position. To make this transition as seamless as possible, I would recommend creating a shortcut. Were you to choose this option, you could also experiment with utilising the other arguments provided by VScode, like passing over the currently selected text over to vim, for example.

Out of the two, installing a plugin is quicker and easier and might suit your needs. However, you may get frustrated at the differences to native vim - the lack of support for some features, the inability to configure using a vimrc and through native vim plugins. Ultimately, the right option will depend on how you use Vim at the moment. Personally, I settled for the second option.

Sign up to request clarification or add additional context in comments.

Comments