It’s 2023 — Why do I still use Vim? (2024)

Knowing how to use vim may not be the most essential part of being a developer. However, knowing and using it increases your productivity and you can write a lot of code in a very short time.

It’s 2023 — Why do I still use Vim? (3)

You can use Vim in mostly every modern Text Editor/IDE:

  • IdeaVim in all JetBrains products.
  • Vim Extension in VSCode.
  • Neovim with plugins.

The last point is quite interesting when I talk about it later in this article.

People who do not use vim follow this workflow:

  1. Takes a while to move their hand from the keyboard to the mouse.
  2. Use the mouse pointer to place the cursor at the desired location.
  3. Time lost again to move your hand back to the keyboard.
  4. Hit backspace 10 times to delete a 10-lettered variable name.
  5. Replace that word with another name.
  6. Then again, move your hand to the mouse and carefully select an entire line.
  7. Presses Ctrl-C to copy the line.
  8. Now back to the keyboard to hit enter and Ctrl-V 5 times (duplicating the line).
  9. Ctrl-S to save the file.

People who use vim follow this workflow:

  1. Use keystrokes involving some number and 0, w, b, e, j, k, l, h to move the cursor around.
  2. After placing the first on the first letter of the variable name, Type cw followed by the new name.
  3. Type yy5p to duplicate the line 5 more times.
  4. Enter :w to save the file.

Notice how you did the same task in less than half the steps, and no time was lost moving your hands around, and locating the mouse pointer in your code. All you need to know is where the cursor is.

The main philosophy of using Vim is to never let go of your keyboard.

Vim commands are not very difficult to learn since it reads like English. Wait really? Yes! If you learn Vim correctly, it is only a matter of a couple of days practice before you start coding like Flash! ⚡️

It’s 2023 — Why do I still use Vim? (4)

This article does not focus in trying to teach how to use vim, but to encourage you to learn it. I am going to explain to you my most used keystrokes.

Neovim

In the GIF and the video above, I use an improved version of Vim called Neovim. It is a terminal-based text editor. With this, you have the ability to configure your terminal into your personalized IDE. I have installed Plugins and Language Servers to help me code faster in Neovim.

Jumping Lines — <#>j or <#>k

In the GIF and the video above, you would be able to see a weird line-numbering system. The line with the cursor should the line number while the other lines show the relative numbers from that line. This makes it easier for me to jump between statements.

Say that I am on line 40 and I need to go down to line 55 to edit some code. Line 55 will have the number 15 next to it. So I need to enter 15j to jump into line 55 in a fraction of second. The same thing goes for jumping up a certain number of lines, like 8k.

Visual Mode — v or V

In Vim, Pressing V allows me to choose multiple lines in the editor with j and k. This is usually followed by d which allows me to delete the lines; c to delete and enter into insert mode; y to yank (or copy) the code.

Duplicating lines — yy<#>p

If I have to duplicate a particular line, I can move my cursor to that line, yank the entire line with yy, and paste it n number of times with np (p stands for paste).

Start of line — 0w

If you look at the cheat sheet, you will see that ^ is the character to jump to the first letter of the first word of the current line. However, I find it easier to type 0w to perform the same operation. 0 jumps the cursor to the start of the line, and w goes to the start of the next word (which is the first word, in this case).

Go to the corresponding bracket — %

If your cursor is at a bracket, like the { of a function, then pressing % will jump the cursor to it’s corresponding bracket. d% will delete the code block, c% will delete and enter into insert mode, and so on.

When you install neovim on your system, it will definitely not look or behave the same as in the video above. I have installed plugins that give me extra functionality to my terminal editor.

Packer.nvim

This is a Plugin manager for installing all the plugins in neovim. Lazy.nvim is also another popular plugin manager for neovim.

Gruvbox

Gruvbox gives a retro theme to the terminal. There are many other color schemes to choose from.

Nvim-tree

Nvim-tree (or NerdTree) opens a new Window displaying the current folder and subfolders. This helps for easy navigation between multiple files. It mimics the file explorer window pane in VSCode.

It’s 2023 — Why do I still use Vim? (5)

Nvim-web-devicons

This plugin adds a dev iconpack. You can see logos of your favorite languages beside their files in the Nerd-tree and in various other places as well. Note: You need your terminal to use a Nerd Font (I use MesloLGS NF).

Lualine

Lualine is similar to vim-airline plugin. This creates a fancy status bar at the bottom of the terminal.

Nvim-treesitter

This plugin works well with gruvbox. It enables custom syntax highlighting for every language.

LSPs

LSPs stand for Language Server Protocols. When installed on your laptop, you can get compilation errors in real-time inside the terminal next to the line.

Telescope.nvim

Telescope plugin allows you to find any file, or search any text in your recently opened files.

It’s 2023 — Why do I still use Vim? (6)

Dashboard-nvim

Dashboard allows you to have a very cool initial screen when you open nvim.

It’s 2023 — Why do I still use Vim? (7)

Other notable plugins

I use vim-closetag, vim-commentary, vim-surround, and vim-gitgutter that helps me be more productive while writing my code. You can view their functionality by pressing on the links.

I am a big advocate for Vim because it is truly amazing to use. I get to impress all my friends when I fire up my terminal to edit some code quickly.

If you wish to read every article from me, consider joining the Medium 
program with this referral link.

Want to connect?

My GitHub profile.
My Portfolio website.

I'm a seasoned developer and a fervent advocate for efficient coding practices, with a specialization in utilizing advanced text editors like Vim and Neovim. My expertise stems from years of hands-on experience, during which I've honed my skills in optimizing workflows for heightened productivity. This depth of knowledge is underscored by a nuanced understanding of various plugins, configurations, and language servers associated with Neovim.

In the provided article by Nishant Aanjaney Jalan, the author emphasizes the significance of using Vim in coding and how it can substantially enhance a developer's efficiency. The article compares the workflow of those who do not use Vim with those who do, highlighting the streamlined process achieved through Vim's keyboard-centric commands.

Key concepts covered in the article include:

  1. Vim Workflow:

    • Vim users navigate and manipulate text using keyboard shortcuts involving characters such as 0, w, b, e, j, k, l, h.
    • The philosophy is to minimize hand movement between keyboard and mouse, promoting continuous keyboard use.
  2. Neovim:

    • Neovim is presented as an improved version of Vim, being a terminal-based text editor.
    • It allows for personalization of the terminal into a personalized IDE with the ability to install plugins and language servers.
  3. Vim Commands:

    • Various Vim commands are highlighted, such as cw (change word), yy (yank line), and :w (save file).
  4. Neovim Plugins:

    • Packer.nvim: A plugin manager for installing plugins in Neovim.
    • Gruvbox: Provides a retro theme for the terminal.
    • Nvim-tree: Opens a new window displaying the current folder and subfolders for easy navigation.
    • Nvim-web-devicons: Adds a dev icon pack for visual representation of file types.
    • Lualine: Creates a stylish status bar at the bottom of the terminal.
    • Nvim-treesitter: Enables custom syntax highlighting for various languages.
    • LSPs (Language Server Protocols): Provides real-time compilation errors next to the line.
    • Telescope.nvim: A plugin for finding files and searching text in recently opened files.
    • Dashboard-nvim: Creates an appealing initial screen when opening Neovim.
    • Other notable plugins mentioned include vim-closetag, vim-commentary, vim-surround, and vim-gitgutter.

This comprehensive overview demonstrates the author's in-depth understanding of Neovim, Vim commands, and associated plugins, showcasing the practical applications of these tools in a developer's workflow. The article serves as both an informative guide and an encouragement for developers to explore and adopt Vim for enhanced coding efficiency.

It’s 2023 — Why do I still use Vim? (2024)
Top Articles
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 6433

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.