DEV Community

loading...
Cover image for Why Use Vim for Programming

Why Use Vim for Programming

jones268
・2 min read

Vim is the most famous text editor many programmers use for coding on the Linux terminal.

Vim is a text editor for Linux. Many people have grown up using Vim, that and its ubiquitous nature means it can be found on any Unix/Linux system.

Many “power users” swear by the power and functionality of Vim, however many people see it as intimidating and complicated. If you are new to vim, I recommend these exercises

Installation

Vim can be downloaded and installed from a software repository. Vim is often installed by default on Linux systems and even on Mac OS X.

You can install vim with your package manager

sudo apt-get install vim
Enter fullscreen mode Exit fullscreen mode

Why vim?

The reasons for this are simple: it's fast, it's powerful, and it comes in both a terminal emulator and a GUI version.

You can use it locally or over an ssh connection. It can even be used inside IDEs as a plugin.

Vim allows programmers to edit text quickly and efficiently. You can jump to the end of file using G, top of file using gg and to line 10 using 10G. Vim allows you to record and replay keystrokes and has many many more features.

vim keystrokes

Vim 8 comes with built-in support for Python, PHP, Perl, Ruby and Tcl programming languages.

Vim as a code editor but it's much more powerful than you may think. Before you do anything else, you should know that:

  • Vim is not a text editor that uses a mouse. It's a program that uses keyboard shortcuts to perform all of the tasks.
  • Vim is hard to learn. You will have to spend a lot of time practising and mastering your skills before using it effectively.

Discussion (2)

Collapse
shekhars094 profile image
Shashi shekhar

VSCode is most famous text editor. don't make statement based on your assumptions.

Collapse
jones268 profile image
jones268 Author • Edited

In the Linux/BSD community, vi/vim is more famous because it's a few decades old and can be used in the terminal. Google searches yield:

"vi linux" : 178.000.000 results
"vscode linux" : 25.900.000 results