DEV Community

Why I use Vim

Igor Irianto on June 09, 2020

Why I use Vim My first experience with Vim was when I accidentally entered it and could not get out. I had to google how to exit vim to ...
Collapse
 
waylonwalker profile image
Waylon Walker

I've tried to switch to vim several times, but windows terminals are so terrible. The best way I have found to use vim is to open VSCode, set the terminal full screen toggle action bar and sidebar off and you have a decent terminal experience 😢

I mostly use VSCode, but the performance and extensibility of vim is wicked. That said any editor needs to have vim bindings.

Collapse
 
jonathansiddle profile image
Jonathan Siddle

Thanks for this, this is a really great article and I love it when references are included!

I tried to use Vim as my main editor but couldn't find a good flow with Flutter. I mostly use VS Code with the Vim extension, I am always striving for ways to become more keyboard driven and improve my Vim knowledge.

Collapse
 
iggredible profile image
Igor Irianto • Edited

Yup. Many IDEs' Vim extensions are great. They are not perfect, but for everyday purposes, plugins are more than enough to help develop Vim muscle!

I personally never developed with Flutter, so I can't help much. If you ever make the jump to use vim/neovim directly (not through IDE extensions), I think something like github.com/iamcco/coc-flutter might be a good place to start. Plus github.com/sheerun/vim-polyglot has dart support (I use vim-polyglot for all my language needs).

Best of luck!

Collapse
 
filbranden profile image
Filipe Brandenburger

Excellent article and you make great points! Your pros and cons are really balanced, which I find really refreshing on an article about Vim!

And so awesome that you mentioned the community aspect! Thank you so much for calling out the Vi and Vim Stack Exchange in particular. It's a great forum for all those interested in Vim, whether they're beginners or advanced users. It's very welcoming and you'll find many maintainers and authors of Vim and of Vim plug-ins hanging out there. (Disclaimer: I'm one of the three moderators.)

Collapse
 
aminmansuri profile image
hidden_dude

I'm heavily influenced by the book "Writing Solid Code" by Steve MacGuire.

In the book he argues that developers shouldn't run their code, they should debug it in a graphical debugger (even if there's no problem). Its a great way to inspect the code as it executes.

Thats why having an IDE with no integrated debugger is a bit of a show stopper for me.

Collapse
 
ferricoxide profile image
Thomas H Jones II • Edited

As someone whose first real editor was vi on SunOS 4.x, it's a hard habit to try to move on from. Plus, it's (well, vimis) still being actively developed/exteneded, so, if I want or need anything beyond the base functionality, it's easy enough to bolt on.

Collapse
 
itsjzt profile image
Saurabh Sharma

I usually don't code in vim, but when I do, I can't code in static typed languages without autocomplete, they are too verbose to write everything by hand. I use coc.nvim Intellisense engine for Vim8 & Neovim, full language server protocol support as VSCode.

Collapse
 
iggredible profile image
Igor Irianto

I use that too. It's been great. I have been working on large codebase and in my experience, coc.nvim doesn't work very well (I have a very large controller, and it lags pretty bad).

On medium to small codebase like microapps, it works great!

Recently I tried turning coc.nvim off to see how I would do without it and just use Vim's native autocompletion, so far it's been great! (:h ins-completion for more info).

Collapse
 
itsjzt profile image
Saurabh Sharma

even in small project is makes vim noticeably slower, but I can bear that for the benefit of intellisense.

Collapse
 
tamamcglinn profile image
Tama McGlinn

I love this article; you hit the nail on the head with composability.

However, I'm surprised you didn't know how to debug using vim; it doesn't just have a debugger, it has one of the best in any IDE, because you keep all the other features enabling you to quickly move around the code, and allows you to define your own keybindings. Also, unlike most IDE's, it supports all programming languages.

I used to use idanarye/vim-vebugger, but switched to puremourning/vimspector because it had more features. I can confirm it works out-of-the-box for Ada and C++.

Collapse
 
javiersalcedopuyo profile image
Javier Salcedo

Learning Vim was really a big boost in productivity (after surviving the dreaded learning curve).
I personally use mainly the Vim extension of VSCode. A match made in heaven ❤️
I can do almost anything that I can do with regular Vim, but with more IDE-like features and better highlighting.
Sometimes it can feel a bit more sluggish though.

Collapse
 
iggredible profile image
Igor Irianto

I agree. Once you get into the habit of thinking in Vim, it's hard to let go!
It's pretty cool when you realize that there is practically at least a Vim extension in every major IDE/editors (VSCode, IntelliJ, Emacs).

Collapse
 
bits-on-chip profile image
Bogdan C.

Honestly, I understand that many people use Vim (even some of my colleagues do this, although in our standard development process we have some clear guidelines to use Eclipse / VS Code), but I cannot get used with it. I'm trying to learn it and like it, but after some sporadic trials, I almost gave up. Mind you that I only tried to use it for fun, not at work, where definitely wouldn't increase my productivity, or might even help me to destroy the quality :D

I simply cannot see its "simplicity", unless one really hates the mouse (which I find it extremely powerful in combination with a keyboard) and only prefers to use shortcuts, like they do in the "hacker movies".

So, for my day to day work, where we have projects with tens of thousands of files spread over modules and submodules, I really cannot see the use of this tool. It's cool, it brings me back some '80s memories, but other than that...it is simply not even coming close to a modern IDE such as Eclipse or VS Code, designed pretty well for working on large projects.

Even when it comes to simply opening a file and modifying it, VS Code (or Notepad++) does the job neatly and I don't need to memorize a whole book of shortcuts.

So, as others have said, I'm trying to learn VIM just for fun and for the sake of the argument, but until now I haven't managed to master it and I have to keep the cheat sheet open to see all those combinations of letters :)

I've had this discussion with some of my colleagues who also keep insisting on using directly the terminal for some GIT commands, although we have very powerful GUIs for this purpose, which makes it faster, safer and easier to use...but, that's another topic :D

Collapse
 
justinkaffenberger profile image
JustinKaffenberger

I prefer full IDE's in the circumstance where I need to do large scale refactorings in a code base.

Collapse
 
iggredible profile image
Igor Irianto

As a Vim user, I do not disagree. There is truth in that.