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.
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
notvscode
in my terminal to kick things off. Any time I'm remoting into a machine, I runvim
. 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 😄❤️
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...
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.
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
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.
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
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.
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.
I always though of
i
as “inside” anda
as “around”.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).
Vscode wins cup🤾♂️🏆🥇
all community support extension and from web development perspective it is beast
It's camelCase, bro.
Yes I know but auto typing
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.
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.
I use this on my work Mac:
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
tognome-open
.VSCode for development in local, vim for editing env files in production server.
Each Vim developer had a custom layout and file tree that made it hard to follow during pairing. Again this is just my experience, but I didn't find much consistency between Vim environments either. There's also the fact that I had no indicator of what was going on when the host would start tapping away at key bindings. I think we've all been there when a Vim developer mistypes a command several times just so they can do it the "Vim way". During these times I would tune out or get frustrated with the inefficiency. I've also had several Vim devs tell me that X plugin is not working so they have to do things a little weird, then run linting/formatting outside as a post process to their normal workflow. Not show stoppers by any means, but IMO unnecessary friction points.
I think the key with any editor/tool is to learn it well to be more efficient. VSCode is easy to use so it doesn't necessarily force you to learn the hotkeys and get good with it. Vim has a learning curve in order to use it, so it is very much learning by doing and forcing you to get better with it. Customizing an editor like Vim may not be worth the investment in time saved typing, but it may be preferred or a fun hobby for some.
When I code, I am usually not furiously typing away, I'm thinking more about what I want to do and then entering it. I don't believe the editor or using the mouse is slowing me down, I would still want to take my time. Learning the default hotkeys and features is enough for me, so I prefer VSCode.
Not specifically VSCode/Vim, but I'm also a big mouse user (probably due to my PC gaming background), but there is more and more "mouse shaming" that I see going on in the developer community. It has equal priority to the keyboard for me. Sometimes there just isn't a good keyboard shortcut to get to something on the screen which is frustrating and inefficient for me. Tabbing through a webpage is kind of like iterating through all items in an array (O(n)), but clicking on the exact link is like accessing a specific array index (O(1)). At least that is how I think of it. 🤷♂️
For webpages, vimium is the browser extension. Imitates the whole vim experience.
I started using i3wm on Arch. Then, felt the need for something similar keyboard-driven in browser. That's when I came across Vimium.
Funnily though, I learnt vim/neovim after few months using Vimium.
i need to figure out how to set up tag bar. i love vim but i don’t have it set up well to be a great IDE.
Both are really good. I have ventured across all three lands including emacs, vim and vscode. The amount of time we can kill optimizing the configuration with vim and emacs is just 🤯 (both in a good and bad sense at the same time). Now while I get older, I realized that I don't have the time to tweak stuff until wee hours in the night. Having to manage time between work, family and my self. So these days , what ever gets me productive soon is my tool of choice. I might use vim to edit files and have a basic configuration that work out of the box. VSCode for majority of the other work purely because I work across PHP, Typescript, JavaScript, Ruby, Go and with Terraform. It just saves the time I have to configure the editor.
So this is just my circumstances and how I opt to use the little time I have available. It was a completely different ball game a decade ago for me.
I didn’t find VSCode to be that great without a similar amouint of configuration.
Possible. But most of the extensions work pretty fine out of the box.
One big thing which seems to be forgotten by a lot of people on both sides:
vim
is tiny by modern standards for how many features it provides. VSCode quite simply cannot compete here because it uses Electron and has all the baggage that comes with that.If that matters to you, sure. These days the smallest amount of RAM I have to work with is 16GB and I know I'm not the only one. From an absolute standpoint VIM uses a lot less resources but from a % standpoint they are both so low that their impact is effectively equivalent so I can compare them directly on ease-of-use, functionality, etc.
I get a ton more battery life on vim than I do on vscode and the JetBrains ides. Even when I load up vim with a ton of plugins. Sublime is also better than vscode, so thats a consideration if you like to work and not carry a brick with you. I do agree that for the most part the majority of us with modern computers the ram/cpu is a wash.
That is a much stronger point. To me this factor is still a wash because a) 95% of my development is done on a power cord and b) even if I'm out-and-about on my laptop what kills my battery is other intensive programs (aka FireFox) or running the program I'm working on rather than the editor itself. But I totally get that there are people who need to get more than a few hours out of their laptop at a time and will adjust their tools accordingly.
I've gone hog-wild for VS Code, but I've used vi(m) since the 1990s and it's still in my fingers.
The primary reason I would use
vi
overcode
these days is when I'm editing code on a remote host I haven't mounted, which I sometimes do from my mobile devices, although as a Perl guy,perltidy
usesperl
, which I don't have installed in Windows, so, when I want formatted code (and I'm not usingRemote-WSL
), I usevi
in WSL to tidy it.I have been irritated by the sluggishness of electron apps for a while, and while vscode is the best electron app there is, it's still electron. I finally made the switch to vim and I love it. It will take while to get used to the key bindings but I'm willing to put in the work. And man configuring vim is so much fun!
With modern LSP plugins + fuzzy finders, I feel that I get the best combination with NeoVim, and I can edit code in Docker containers + Servers with IDE-like functionality. My dotfiles bootstrap NeoVim and install everything I need, so taking over a container to debug it is relatively painless :D
I'm diehard Vim all the way. I think it has the best UX of any editor.
I don't think Vim is an IDE though, and I do think that VScode is a good IDE. In fact, it has one of the best Vim-mode extensions of any IDE I've tried, so it's pretty fun to use. It's not perfect, the Vim-ness isn't that customisable, and it loses out because it's not a console application which is something I value.
I love vim on xfce. I have a workspace for every function key, 12 in all. Then, I use window snapping and when I am working locally i typically fill out all the 4 corners. Whew, that's a lot of windows but it really helps my workflow especially when each of them is tagged for certain purposes. I try to keep 1 set of function keys tied to a single project. Then on f1 I will have db windows, command line stdout app running, etc. Utility screens. f2 is reserved for website previews and debugging on the server. f3 is backend files and f4 is front end files. Bigger projects I'll go into a second set of functions and then the purpose gets more muddy.
Ultimately this has been fantastic and it is so speedy. All these are opened on a virtual machine and if it ever runs out of memory it isn't because of vim! Amazing!
Yes, absolutely. cw combined with search and period (repeat last command) is an incredibly efficient way to change over code to new naming. I use this all the time when copying over boiler plate code that has just a few name changes needed and it saves so many frustration inducing mouse moves!
I love VIM and saved my computers but when IDEs would chew up resources. But, I also love VSCode for the number of extensions, features, and constant improvements.
But in the end... Why not both? I used VSCode with the VIM extension so I can have keyboard shortcuts to fly around my code with the need for a mouse.
I do admit I don't use VIM to its full potential but I feel like it's not an all or nothing thing.
I prefer to use Vim. It is really lightweight for my old computer.
I recently switched from heavy IDEs and vscode to vim an I have found that can do everything inellij or vscode can do if the correct extensions. if your willing to put in the time to learn the key bindings and install the extension I think vim is by far the better choice. :]
Could you pls share your vim config ? That would be immensely helpful as I'm setting up vim for the past few days.
My development work is fully in C++. My experience is thus: Began with Visual Studio IDE on Windows. Switched to VSCode since I had to develop the same code base on a Linux machine as well. Got swept up by the "VIM is faster/better than any other IDE" cult. Spent a few months using VIM as the IDE for C++. Then, got tired of polishing my .vimrc nonstop. Also was troubled that YCM autocomplete was very slow and buggy and lacking in features that VSCode and Visual Studio IDE have (for e.g., if you are filling the argument list of a function with large number of arguments, CtrlShiftSpace in VSCode/Visual Studio IDE tell you which parameter you are on. No such comparable feature in YCM). Vimspector debugging was not good enough (VSCode/Visual Studio provide logpoints capability, for instance) and there were tons of keyboard shortcut conflicts given all the plugins needed to turn VIM into a half-decent IDE. Gave up on VIM. I am now back to VSCode and Visual Studio IDE. They just work correctly and easily out of the box and have capabilities that are not available in VIM.
My advice for others reading this who are not yet committed to VIM -- do not get swept by the "VIM is smarter/better" madness. It is not. You are better of learning an actual IDE (any IDE would be fine) completely. You will be far more productive than you can every hope to be in VIM which is not an IDE nor was it ever meant to be one.
Visual Studio IDE also has the capability of integrating Intel VTune profiler which helps in finding hotstops in your algorithms much quicker. So, this IDE actually helps figure out how to make your code run faster. Of course this is possible in linux by running stuff through valgrind, etc. But that is outside of VIM. Visual Studio IDE is truly therefore an "Integrated" environment.
I started using Vim 6 years ago, and spent 2 quality years with it. I had a heavily modded config with tons of plugins for everything. At some point, I wanted to do my own customisations, and VimScript didn't strike me as an amazing language (at least back in the day).
Then I went from Spacemacs to Doom Emacs, and I'm currently switching between Doom Emacs on Linux and VS Code on Windows.
Emacs gave me the degree of freedom I wanted from my editor, and for some of the plugins (like Magit <3), I can't find a replacement anywhere.
For me, VS Code wins in terms of LSP support (rust-analyzer works amazingly well with it) and how easy it is to get going with on a new machine (yay Preferences Sync!), but there's still a lot to be desired.
And of course, Vim bindings everywhere, that's out of the question.
Always been a touch-typist and started using text editors before VIM existed (those old Suns, NeXTs, etc., if they offered you a choice at all, only really had ed/vi and EMACS). Too many decades of finger-memory (and bounce too frequently across new systems) to think about stuff that isn't "just there". These days, that's VIM.
It doesn’t have to be an either or. I’m quite happy using the vim plugins that are available in most IDEs, VSCode has a great vim plugin which does a good job of supporting the broad set of features I use (I guess I’m not a power user of vim).
I would be curious to see the difference in productivity between vim / emacs and plain IDE (with intelisense etc) at what point does vim make a difference?
I never used VIM as a full-blown editor. Back when I started using Linux I would use it to modify config and text files or write shell scripts. Back in those days, I was only learning programming at a very basic level (I was young). I would use the Python IDE when I first started learning because I used Python. When I tried to learn C++ I was able to use Code::Blocks, which was relatively new at the time. I abandoned programming after that.
By the time I started development again, it was already 2016. I started with learning game development using Unity. This came bundled with MonoDevelop which I enjoyed using for a month or two before an online tutorial used Visual Studio and I switched. When I took up web development a few years after that, I just naturally fell into VSCode. I'm so used to all of the shortcuts and the commands that come wrapped in VSCode and that I have created. The idea of switching to anything else is almost exhausting.
vs code with vim extension <3
I never could get into Vim's workflow. I know the hotkeys, but I guess my mindset just wasn't right for it. My university had both Vim and Emacs, so I got into Emacs and used it for a few years. But now, when I remote into any of my servers, I end up using Nano. Lightweight, and doesn't get in your way.
Once VSCode came out, that sealed the deal. Other than Visual Studio, I haven't found anything that equals its power, or flexibility.
:wq!
Yet more powerful is
:w !sudo tee %
.glad to learn a new line, ty bro ;-)
I am all in for VSCode. I was a Jerbrains guy and started using vscode since 2018 and loving it. I am a Polyglot, and VSCode works and supports all programming languages I use. Nowadays, I use IntelliJ ( only Java ) and VSCode ( rest ).
Sure! gitlab.com/jrop/dotfiles
VSCode has the best 'install and go' DX I've ever experienced. Even better than sublime, n++ - it just installs, starts, and goes really quickly with intellisense for TS/JS out of the box, and installing extensions is suggested and can be done without even reloading the editor.
Looks interesting. I've always avoided neovim, but I think I might give this a shufty.
Thanks, I will try it this weekend as I am trying to be more efficient with typing and navigation as a new developer!
hah, i never knew what it said in the help docs. i think i read a blog post once that gave me those mnemonics.
Me too :P
it's actually setting up a ctags library that i've had trouble with. although looks like you are using something called universal-ctags instead of exuberant-ctags. i'll give that a try.
As someone who uses both, I don't see why there must be a "vs". Both have their advantages and drawbacks. Use whatever fits your usecase best.
I love Vim, but currently I work with Javascript and use VSCode. For me, Vim is terrible on autocompleting in JS. Even Coc plugin does not fit well for me.
You can use coc.nvim which brings intellisense of vs code to vim
I only use VSCode and IntelliJ IDEs. If I have to do some quick edits on a remote server nano and vi usually does the job, but that happens very rarely.
I use both. But every Dev should know how to use vim.
I use and like both, but for different purposes :-)
VSCode is the best!! 😍
Is there a colemak fork you know of?
Vim for all cases. He works like I'm dictating commands to him on the phone.