Why Vim is better than VSCode (2024)

Why Vim is better than VSCode (2)

After Github was bought by Microsoft it got a pretty significant feature update called Codespaces.

It lets you code directly from your repo rather than locally from your own machine. You can run code, serve it and update it using a super fast server running VSCode from your browser. Mental.

It used to be that Vim was the most portable text editor around because you can find it on almost any server machine and use it in a terminal over SSH.

Well now VSCode’s getting some of that action.

Not only can you run it in Github but there’s a version of VSCode you can serve yourself called Open VSCode Server. It allows you to install VSCode onto a server and serve the app on any port you want. Then you can go to the server address in your browser and use VSCode in the same way you would in Codespaces, but for free.

Microsoft’s xterm.js, which is used for VSCode’s own terminal, was released as it’s own distinct open-source project and it sprouted a ton of different browser-based terminals; now you can find a terminal in any number of different server hosting websites.

Why Vim is better than VSCode (3)

The company has now embraced open-source after a long time of apparently fighting against it and in the web-dev world they’re taking over. They own Github, npmjs.com and I rarely meet a dev that’s not using VSCode.

Once they started making the app this portable even I tried dipping my toes into Open VSCode. I wanted to see if I liked the feel of coding remotely with all of it’s squelchy GUI goodness.

After running the binary on my cheap £5 per month server it almost immediately crashed and forced me to reboot.

There’s some obvious reasons why Vim has an advantage over any GUI editor. It’s light and fast, you can code over SSH on a server, it keeps you in your terminal, it’s widely available, hugely portable and highly configurable.

All these reasons you’ve probably heard before so I want to go into more personal reasons I like it as well as some things that you might expect VSCode to be better at.

Which keeps the muggles out. No, I’m joking.

In actuality, learning Vim is much easier than learning, say a musical instrument, which lots of people can do; and much much easier than learning to read and write, which is a really difficult thing that almost everybody can do.

Something being difficult certainly shouldn’t be a deterrent for a programmer. Learning difficult things is basically our bread and butter.

There’s advantages to learning something difficult that aren’t directly connected to the thing itself. There are meta-skills you can gain from it.

My son Yuri learned to ride his bike recently and it was difficult for him because riding a bike isn’t something you can learn incrementally. There’s a jump or a leap-of-faith moment when you don’t rationally work it out you just have to do it and risk falling off.

There’s another thing that made it difficult as well: bikes are rubbish until you can ride them. So he was happy to just push his scooter around because it was easier and more fun at the start.

But since he learned to ride his bike Yuri hasn’t touched his scooter because it was way slower and less fun. He doesn’t know it but there’s a couple of meta-lessons he’s learned as well.

The first is that sometimes learning something takes a leap of faith, and you have to take a risk to make that jump. The other is that some things are rubbish until you learn them properly…then suddenly they’re brilliant.

VSCode is the scooter of text editors. Vim is the bike.

Have you ever used Sublime? Or maybe JetBrains? They’re pretty much the same as VSCode. JetBrains has better auto-completion, Sublime has worse plugins. But there’s not a huge difference.

In Vim I can put the cursor on the same line as a string, then press di’

Why Vim is better than VSCode (4)

It’ll find the first string on the line and delete its contents.

Or try putting the cursor inside the parenthesis of a function and pressing di(

Why Vim is better than VSCode (5)

Now try going to the return object’s contents and pressing di{

Why Vim is better than VSCode (6)

Now jump out of the whole function by pressing {, then delete the whole function just by pressing d}

Why Vim is better than VSCode (7)

So much easier than using a mouse. If you know any other editor that can do this out-of-the-box, I’m interested.

[Note: there are some editors out there that can do this and they’re not just Vim clones or editors running Vim plugins. For example check out Kakoune, it’s a pretty new Vim-like editor that actually has some really nice features, like piping and client/server architecture, that Vim doesn’t offer].

Why would this be an advantage? Well, that’s why it’s so fast. Apart from the fact it has about a 7MB footprint, Vim is only ever doing one thing at a time.

It’s not scanning your directory for function definitions, it’s not traversing a syntax tree to give you complex autocomplete suggestions, it’s not calculating the context of your cursor and doing requests to a documentation API, it’s not doing a git blame on every line of code and it’s not auto-downloading syntax for every file.

But Vim can do all of these things…when you tell it to.

Some people like automatic features because well, why wouldn’t you like your life to be easier? Or maybe you don’t have time or energy to sweat the small stuff.

I suppose it depends on what level you feel you’re working at as to whether you have the energy to spend using terminal commands to lint your files or reading the :help to find out how to config your .vimrc file (I never used :help when I started using Vim btw, the internet is definitely your friend in the early days).

But to be honest I know plenty of people who waste their time in much less interesting ways, like doom-scrolling facebook or re-watching Friends on Netflix.

Sometimes I want to do something interactive that isn’t full-blown coding. If I’m tired after work or on the weekend, in the past I would have played music or computer games; now I fix something in the house or I tinker with Vim.

Thinking up little features I could code in Vimscript or integrating a useful command line tool or even just reading bits of the :help that I’ve never seen before gives me something to do that’s not so super-important that I have to finish it but not totally a waste of time either.

I 100% stopped playing computer games when I got into Vim. This is because the controls are so game-like. They’ve got a modular structure that allows you to use combinations of commands in different variations. It’s a lot like the way you can do combos in a fighting game.

Most commands come in two, three or four parts. One version of the three-part structure goes like this: operator — text object — motion.

Operators are always one of delete, change, visual select and replace.

Why Vim is better than VSCode (8)

Text objects are always one of inside or around.

Why Vim is better than VSCode (9)

There’s a ton of different motions but we’ll get into that in a second, for now we can think of the motion as a kind of target for the command. To take an example I could press dib, meaning delete inside block.

The operator is delete, the text object is inside and the motion is block. This deletes everything inside a block of (parentheses).

There’s a ton of different combinations of these:

di’ delete inside the single quotes.

da” delete around the double quotes.

ditdelete inside the html tags.

ci[ change inside the [square brackets].

As I said earlier there’s lots of motion commands to choose from and they behave differently depending on whether you use them in three-part combos, like above, or two-part combos (where you miss out the text objects to make the command run from the position of the cursor on-wards).

Here’s a list of some of the relevant motions you could use in the above three-part combo:

--------------------------------------------------
| motions | key |
|-----------------------------------|------------|
| word | w |
| WORD (includes special chars) | W |
| block (of parentheses) | b or ( |
| BLOCK (of curly braces) | B or { |
| brackets | [ |
| single quotes | ' |
| double quotes | " |
| tag (html or xml <tag></tag>) | t |
| paragraph | p |
| sentence | s |
--------------------------------------------------

These commands let you change the arguments for a function or the contents of a string or the contents of an if block so quickly and easily. Once you learn them you’ll want to be able to use them everywhere.

Every other text editor will feel frustratingly cumbersome and clunky and you’ll be installing “Vim modes” in every environment you can find.

More About Motions

Motions are the type of key-command you’ll use the most in Vim because they can be used on their own to move the cursor around. Some motions work on their own and some only work when used as a part of a combo.

For example the w (for word) key will skip the cursor forward one word at a time, but the single-quote isn’t a motion on it’s own, and does something completely different.

Some motions become different types depending on if they’re used in combo or on their own. For example the b key in the above three-part combos meant block but when you use it on it’s own it means back, and moves the cursor backwards one word at a time.

Vim commands are sort of context-aware as well as being modular. Different keys mean and do different things depending on when you use them and where the cursor is.

It’s a lot like a language, and it helps that you can think of the commands like a sentence: delete inside thesesingle quotes.

Why Vim is better than VSCode (2024)

FAQs

Why should I use Vim instead of VSCode? ›

This is another area where Vim shines. Vim runs in the terminal and can be used in any environment, whether a GUI is present or not. Vim has the same keybinding set across all operating systems, unlike Vscode, which has different shortcuts for Linux, Mac, and Windows. So with Vim, you learn once and use it everywhere.

Why do programmers prefer Vim? ›

We have learned that Vim is a powerful text editor popular among developers. It's based on shortcuts, called the Vim language, which can make coding and writing faster and more efficient. With Vim, you can jump to any specific text position and rapidly make precise edits.

Why is Vim the best editor? ›

Benefits of Using Vim. Speed and Efficiency: Vim is designed to be an efficient text editor. Its modal editing and commands can help you work faster and more efficiently. You can use shortcuts and commands to perform complex operations with fewer keystrokes.

Why is Vim better than VSCode reddit? ›

Overall, Vim feels a bit more polished. One small example: VSCode has a word-count plugin. The plugin will tell you how many words are in your entire file. However, Vim will also tell you how many words are in an entire file and, if you select text, tell you how many words are in your selection.

Why do people use Vim over IDE? ›

Understanding the Underlying Processes: While IDEs provide powerful debugging and automation features, they often abstract away the intricate details of program execution. Vim, being a lightweight text editor, encourages a deeper understanding of the underlying processes.

Why should I switch to Vim? ›

The advantage of vim is that you can quickly edit files from command line and has very advanced text processing capabilities. But again, a good IDE can do all this.

Is Vim overhyped? ›

It might be overhyped as a programming tool (you won't write 2x the same amount of lines in a day; you will not be 5x more productive), but as an editor, it deserves every single bit of hype that it has. No other editor stands next to vim.

Why is Vim still popular? ›

Vim is always available. Any Linux machine has it. Vim has a small footprint, low latency, fast startup, allows for more screen space, customizable and most importantly, once the muscle-memory has been ingrained, it's nearly impossible to switch to something else.

Why Vim is superior? ›

VIM (or more exactly, the VIM motions) is far superior to a normal text editor. It gives you the power to edit code by it's properties. You can move by lines, words, paragraphs, parentheses, you name it. You use syntactic logic to move, edit, jump to definitions, you name it.

Is Vim still worth it? ›

While the path to mastering Vim may seem daunting, the endless possibilities it offers in terms of speed, health benefits, and adaptability make it a skill worth acquiring.

Should I use Vim for Git? ›

Using Git from within Vim can be very beneficial: you don't need to switch context or jump between windows. With some help from our friends (plugins), we can do almost anything from Vim.

What should I use instead of Vim? ›

Emacs, Neovim, Atom, Notepad++, and Sublime Text are the most popular alternatives and competitors to Vim.

Is there any point to using Vim? ›

Another small but still impactful benefit that fits within the portability benefit is the ability to edit things like config files directly on servers that you're accessing via SSH. With Vim, you can quickly navigate and edit files when working in a GUI-less environment.

Why every software engineer should use Vim? ›

VIM (or more exactly, the VIM motions) is far superior to a normal text editor. It gives you the power to edit code by it's properties. You can move by lines, words, paragraphs, parentheses, you name it. You use syntactic logic to move, edit, jump to definitions, you name it.

Why is Vim so important? ›

One of the primary reasons developers should consider learning Vim is its exceptional efficiency in text editing tasks. Vim's modal editing system, extensive keyboard shortcuts, and powerful text manipulation commands allow users to perform complex editing operations with speed and precision.

What is better than VSCode? ›

Atom, Visual Studio, Eclipse, IntelliJ IDEA, and WebStorm are the most popular alternatives and competitors to Visual Studio Code.

Top Articles
Most Viewed Crypto | CoinGecko
Best Crypto Exchanges & Apps: Top Cryptocurrency Trading Platforms in 2024
Matgyn
Pet For Sale Craigslist
Places 5 Hours Away From Me
Elleypoint
Brady Hughes Justified
Botw Royal Guard
Craigslist Motorcycles Jacksonville Florida
Crocodile Tears - Quest
Rainbird Wiring Diagram
Lost Ark Thar Rapport Unlock
Dr Klabzuba Okc
Richard Sambade Obituary
Calamity Hallowed Ore
Miss America Voy Forum
Local Dog Boarding Kennels Near Me
Nwi Arrests Lake County
Gdp E124
360 Tabc Answers
Site : Storagealamogordo.com Easy Call
How to Watch the Fifty Shades Trilogy and Rom-Coms
T Mobile Rival Crossword Clue
Obituaries Milwaukee Journal Sentinel
Airtable Concatenate
Tire Plus Hunters Creek
Pioneer Library Overdrive
Jayme's Upscale Resale Abilene Photos
Doctors of Optometry - Westchester Mall | Trusted Eye Doctors in White Plains, NY
Harrison 911 Cad Log
In hunt for cartel hitmen, Texas Ranger's biggest obstacle may be the border itself (2024)
The Bold and the Beautiful
Japanese Pokémon Cards vs English Pokémon Cards
Grapes And Hops Festival Jamestown Ny
How To Get Soul Reaper Knife In Critical Legends
Kelley Blue Book Recalls
Myanswers Com Abc Resources
Firestone Batteries Prices
Engr 2300 Osu
The best specialist spirits store | Spirituosengalerie Stuttgart
Homeloanserv Account Login
Uc Davis Tech Management Minor
Ups Authorized Shipping Provider Price Photos
Crystal Glassware Ebay
RubberDucks Front Office
N33.Ultipro
The Cutest Photos of Enrique Iglesias and Anna Kournikova with Their Three Kids
Bf273-11K-Cl
Read Love in Orbit - Chapter 2 - Page 974 | MangaBuddy
Round Yellow Adderall
Gelato 47 Allbud
Latest Posts
Article information

Author: Annamae Dooley

Last Updated:

Views: 5511

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.