For a long time, I used only one text editor - Vim. But here I came to a new job and the situation has changed. I was offered to work on a relatively large (> 300,000 lines) collective project. The project is written in Visual Studio, MS Source Safe is used as a version control system. I didn’t like to write VS at once, but since all the other conditions were more than satisfactory, I agreed.
For several days I worked in the “empty” VS and realized that this could not last long. After several years of regular use of Vim, the studio editor seemed too inconvenient. And I began to look for a way to continue working on the project and at the same time use my favorite editor.
A short search gave the following options for a partial solution to the problem.
Option 1: ViEmu
viemu.com')
The first thing that occurred to me was to find a plugin that would change the interface of the studio's test editor to Vim-like. Such a plugin exists and is called ViEmu. Immediately, I note that it does not support all the possibilities of Vim.
ViEmu Pros
- Elementary installation
- Bugless work inside VS
- Integration with IntelliSense and debugger
Cons ViEmu
- By default, not all hotkeys work, they must be manually configured.
- Minimum number of settings
- There is no support for scripts and, accordingly, plug-ins.
- Surely there is still not much support (I did not use it for long, so I can’t give you a detailed list)
- Worth the money (about $ 100 for a personal license)
In short, ViEmu implements the basic functionality of Vim, without interfering with the use of all VS functionality. But what is most important to me,
ViEmu is not Vim . Having played with ViEmu for several days, I refused it. It annoyed me too much when I entered the Vim commands on the machine or clicked hot keys that ViEmu does not support and every time I wondered why nothing worked. Thus, ViEmu is not the best solution for a Vim user with a lot of experience. It should be well suited to people who want to learn how to use Vim, while not abandoning the usual development environment, as well as people who in daily work use only the basic Vim functionality.
Option 2: ViVim
code.google.com/p/vivimViVim is another VS plugin that uses a fundamentally different approach compared to ViEmu. It just lets you run GVim inside the Visual Studio window. After its installation, the “Vim Editor” item appears in the “Open with” dialog of the studio. You can also set Vim as your default editor. In my opinion, this is the most simple and correct solution to the problem, but its implementation is far from ideal. On my computer, ViVim has repeatedly crashed and even crashed VS. If ViVim is modified a bit, I will definitely use it. In the meantime, I decided to look for other options.
Pluses of ViVim
- Full support for all Vim features
- Work inside the VS window
Cons ViVim
- Glitches
- The inability to use the VS functionality directly inside Vim (I would like to at least compile the project and view the list of errors with the Vim team)
Thus, ViVim is based on the right idea, but it’s still raw.
Option 3: script visual_studio.vim
www.vim.org/scripts/script.php?script_id=864If the previous two methods were implemented as additions to VS, then this is an addition to Vim. It works as follows: you need to start Visual Studio, open a project in it, then start Vim, execute a special command in it, the script will find the running studio and access it to compile the project.
Pros visual_studio.vim
- Ability to write code and compile inside Vim
Cons visual_studio.vim
- Need to keep VS running
- No integration with MS SourceSafe, IntelliSense, debugger
It may be worth trying to use ViVim with visual_studio.vim.
Option 4: Compiler files
www.vim.org/scripts/script.php?script_id=524www.vim.org/scripts/script.php?script_id=1437The last option is the most radical. You can simply edit the files in Vim and run VS instead of make only to compile the project.
pros
- You can work on a project without leaving Vim and manually starting VS
Minuses
- In addition to the compilation capability, no integration with VS is performed.
So, there are several ways to work with VS projects with Vim. None of them is perfect. For myself, I have not yet chosen which method to use. If you know other ways - please write in the comments.
UPD: With this post I did not want to show that Visual Studio is worse than Vim or vice versa. I just wanted to show how you can use the familiar interface where it was not originally provided.