DEV Community

Cover image for Vim's Secret Language
Jaime González García
Jaime González García

Posted on • Originally published at barbarianmeetscoding.com

7 2

Vim's Secret Language

This is the chapter Vim's Secret Language to the book Boosting Your Coding Fu with VSCode and Vim.

As you may have noticed, all the Vim operators, counts and motions that you've learned make up a (programming) language of sorts. You can think of operators as functions and counts and motions as arguments, or using an even simpler analogy... You can think of operators as verbs, counts as adjectives and motions as objects.

The true magic of Vim is composition. As you go building up this vocabulary of operators and motions you will find that you can combine them to your heart's content. Just like you would with the words of a spoken language.

So that, once you know all about the cl, caw, ciw, ct. of the world, and you go and learn how dl works, you'll not only be able to use dl. No. You'll instantly know that you can also combine the d operator with all the vocabulary of motions you already have at your disposal and daw, diw, dt. until the end of times.

This is very cool.

When using Vim you'll feel you are navigating a meta-universe of text editing, it's like programming or controlling the very mechanism of editing and writing text. If you're familiar with git and how it feels to use the git command line to work with source control, you can think of Vim as the git of text editing. (Putting aside the fact that Vim predates git by almost 30 years).

With Vim, you'll look at a piece of text and you'll no longer see just words or text, you'll see the possibilities of an infinite number of operators and motions being applied at once1.


  1. Kadoooosh! MiNDBloWn... 

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs