DEV Community

Ben Halpern
Ben Halpern Subscriber

Posted on

Vscode Vim VSCode vs Vim

Your life as a developer depending on what you choose as an editor.

Let's compare and contrast your experience if you go down either of these paths. Feel free to branch the conversation on to other editors but I felt like this is the most relevant debate today.

Top comments (65)

Collapse
 
srepollock profile image
Spencer Pollock

VSCode (VSC) and VIM are my two main editors.

I sit within VSC almost all day every day. Editing on multiple devices gets annoying when switching over (Windows/macOS), but there are some plugins to help with that effort (search extension shan.code-settings-sync). VSC is a very powerful editor. Once you have keybinding setup, a few environment configs, and runners, you're good to go. The extension list is ever-expanding, and with that, you're more likely to find a few that really work well for you, or even make your own. Outside of the extensions, Intellisense is my saving grace. I often forget what functions are already implemented (or even the documentation and the argument variables) but that's when VSC is there holding my hand. The majority of work is in VSC because it's pretty on the eyes, integrated terminal for Windows (because no global hotkeys for iTerm2 like macOS) and the ability to work on various instances - even in the browser (see GitHub's new Codespaces?).

VIM is however my go-to editor. If I need things quick done now I run vim not vscode in my terminal to kick things off. Any time I'm remoting into a machine, I run vim. Even when VIM is not there, I install it, copy my dotfiles from GitHub, and continue with my day. VIM is excellent, fast to use - especially when you start understanding the basics - and there is still so much more I don't know about it and have to learn; but there's help with that (duh StackOverflow too). I recommend learning some of the basics in navigation for developers of any kind. Again, back to remoting into other machines, having an editor already there for you taking just a single config file and you're on your way is an amazing tool to have some skills with as a developer. It opens lots of doors, and just like the comments made here (by @wayofthepie) it's something that can take time doing, but once you get the basics, "[it's like playing an instrument...my fingers just know what to do.]"

Also, I know there are other terminal editors too, if one stands out then pick that one! Whatever makes you the most productive is the best for you and that's really all that matters. Stay safe πŸ˜„β€οΈ

Collapse
 
pianocomposer321 profile image
pianocomposer321 • Edited

The terminal buffer in Vim8 and NeoVim is good, but one plugin that I came across recently makes it awesome. It's called neoterm. Here's a great video on neoterm (hosted by Drew Neil, author of the amazing "Vimcasts").

You can also check out this snippet from my Neovim config:
gist.github.com/pianocomposer321/f...

Collapse
 
wayofthepie profile image
wayofthepie

They are both great. Used vscode mainly for about a year and really liked it. Didn't have to do much to get it working for most languages!

But I started getting some back, shoulder and wrist issues around that time. Not because of vscode, but because of how I sat and used my keyboard and mouse.

So I totally changed my whole workflow and setup. Moved to vim (well neovim) and switched to a tiling window manager so I could reduce mouse usage.

I spent a lot of time tweaking my vim setup to get what I wanted for the different languages and tooling I need to use. It's made me much more productive for sure. Not really faster overall - coding is mainly thinking πŸ˜„ - just more comfortable in translating those thoughts to code than I was with any other setup before.

It's become kind of like a musical instrument πŸ€” I don't have to think much about performing a certain action, my fingers just know and do it.

Collapse
 
0xdonut profile image
Mr F. • Edited

Vim is amazingly powerful - but I can't be bothered to keep a map of key shortcuts in my brain.
VS Code - I might lose some time pointing and clicking, but it requires no extra mental arithmetic.

I can save that effort for creative problem solving. :)

I should add that I do have a level of envy for people who can do the former (including emacs users) - its impressive and I admire it. It's just one skill I've been unable to learn

Collapse
 
n8io profile image
Nate Clark

Both VSCode and Vim are great editors with cult-like followings. Both have a great community built around them. For me it comes down to a few things that might not be of any importance to others. This is only my opinion and you're all welcome to take or leave it. First and foremost, I am not a Vim user nor will I ever be. I'm a strong advocate of pairing and Vim is painful to follow while pairing. I can't say the same for VSCode. If pairing is part of your team's workflow, Vim is a no go. In my experience VSCode just works and it doesn't require your pair to mind map to be efficient. I'll take the "slowdowns" that come with Electron apps in favor of all the built-in efficiencies for source control, debugging, and remote development. While the Vim community is large, it's ancient. Being a full stack engineer, I prefer my editor to stay as up to date as the technologies I'm using everyday. That's my two cents.

Collapse
 
shane profile image
Shane McGowan • Edited

VSCode is fantastic for large projects. I need the Intellisense training wheels at all times otherwise I would get nothing done.

Vim is nice for editing one line edits from the terminal or writing out a text file. Can't see myself ever using it for development

Collapse
 
matthewbdaly profile image
Matthew Daly

Out of the box, Vim isn't an environment that's terribly good for development. It does take some work to get it into a state where it's a genuinely good development environment because that tends to be language-specific.

I mostly do PHP, with some Javascript too, and I have, among other plugins, vim-ale for linting in multiple languages, and Deoplete for autocompletion. I also use PHPActor, which not only integrates with Deoplete to provide reasonably smart PHP completion, but also provides numerous refactoring tools of the sort that used to be the sole providence of IDE's.

In short, it can be done, but it's a very personal choice as to whether you think it's worth it for your own workflow. In my case, I have a degree of RSI from a previous non-coding role and it gets aggravated by using the mouse, so my workflow is very keyboard-heavy, and Vim fits that like a glove. I did migrate to Neovim nearly two years ago, but the experience is virtually identical.

Collapse
 
vlasales profile image
Vlastimil Pospichal

In the Vim, the size of the project is not limited. He doesn't care if there are 20 files in the directory or 20,000, whether the file has 20 lines or 20 million.

Collapse
 
katylava profile image
katy lavallee

I always though of i as β€œinside” and a as β€œaround”.

Collapse
 
katylava profile image
katy lavallee

I switched to vim from TextMate over 10 years ago. I love modal editing. I also love modally controlling the whole editor (like opening files and showing/hiding different buffers). I have more trouble learning to hit several keys at once than learning to hit them in series. I do have a few key combos set up in vim that I keep forgetting so I should probably turn them into mappings.

That said I think VSCode is pretty awesome. What attracts me to it most is the powerful intellisense, since I haven’t figured out how to get more robust completion with vim plugins.

I’ve tried getting into VSCode, since I can at least edit text modally with it (although it feels slower), but there’s just too much to set up. Back in 2008 or 09, it took me two weeks of being fairly unproductive to get vim set up well for me. At the time there wasn’t much work to do because of the economy, but right now I have a lot of work to do (in spite of the economy).

Collapse
 
krishnakakade profile image
krishna kakade • Edited

Vscode wins cupπŸ€Ύβ€β™‚οΈπŸ†πŸ₯‡
all community support extension and from web development perspective it is beast
Collapse
 
bravemaster619 profile image
bravemaster619

It's camelCase, bro.

Collapse
 
krishnakakade profile image
krishna kakade • Edited

Yes I know but auto typing

Collapse
 
waynejwerner profile image
Wayne Werner

Linux is my IDE.

In all seriousness, it is. Most IDEs have a way of navigating to web pages, editing text, running commands, attaching debuggers...

You know what Linux lets me do?

Navigate to web pages, edit text, run command, and attach debuggers. And I can configure it exactly how I want it.

But what's even better? Parts of my IDE are available everywhere in the world - even Vim, my usual text editor. But I can also edit text with emacs or nano or ed(browse) or... whatever.

It's definitely worth learning a tool like VSCode, but if you want to avoid vendor lock-in, Linux is the way to go.

Collapse
 
waynejwerner profile image
Wayne Werner

Also, if you do use something like Visual Studio or VS Code, I highly recommend a macro that will launch a proper editor like vim. Yeah, you can edit code in VS, but I really only find it's useful for composing code. You can edit code much, much, faster in Vim when you're doing anything but the most trivial actions.

Collapse
 
moopet profile image
Ben Sinclair

I use this on my work Mac:

nnoremap <leader>vs :silent exec "!open vscodium://file/" . expand("%:p") . ":" . line(".") . ":" . col(".")<cr>:redraw!<cr>
Enter fullscreen mode Exit fullscreen mode

That'll open VSCodium to the same line and column the cursor is on in Vim. I do that to make use of the former's debugger, which I find a lot easier to use than Vdebug.

I don't use VSCode on my personal machine, but if I did, I'd change open to gnome-open.

Collapse
 
bravemaster619 profile image
bravemaster619

VSCode for development in local, vim for editing env files in production server.