Explore Vim Commands With The vimrc File

This is a blog that I write as I explore Vim commands with the help of my vimrc file.

In 2015, I discovered the Unix Stack Exchange website and its Vim chatroom on Gitter. The chatroom is full of Vim enthusiasts who have helped me understand more about the text editor and what it can do.

After learning the basics of Vim and how to use it, I started to wonder if there was any way that I could better understand what was happening when various plugins were loaded into my .vimrc file so that I could learn how to configure them.

I had recently read an article about learning Vim by Steve Losh titled Learn Vimscript the Hard Way which explained how you can use your .vimrc file to explore Vim commands.

In order to learn more about how Vim works, I decided to start using my own .vimrc file in a similar way by exploring the different things that happen when various plugins are enabled or disabled within it.

In an article on the Vim documentation, I wrote about how Vim commands work together to create a workflow. This is a common theme in posts about Vim and other editors. Instead of teaching individual commands, they teach a way of thinking about editing.

But most articles assume at least some familiarity with Vim and its commands. This makes it hard to get started. You can’t just read an article on Vim, and start editing your files like a wizard.

Because of this, I’ve created a project where you can explore Vim commands by making changes to your vimrc file. You can open up your vimrc file, read the comments, and see what happens when you make changes to it.

The vimrc file is the configuration file for Vim. It’s a great place to go if you want to explore Vim commands and customize your setup. You can access it through a terminal using the vim command.

However, in this article we’re going to look at how you can use the vimrc file itself as a learning tool. In other words, we’re going to learn Vim by reading — and trying out — other people’s customizations!

This article will show you how to find the vimrc files of some awesome developers (including me!), give you some tips for exploring them on your own, and show you my favorite customizations from my own .vimrc file.

I’ve always had a love-hate relationship with Vim. I love how powerful and versatile it can be, but I hate that it’s not very intuitive to use.

So, what better way to learn the ins and outs of Vim that by editing my own vimrc file? The vimrc file (short for “vim runtime configuration”) is a text file in which you can declare Vim commands that will be executed when Vim is launched.

For example, I put the following command in my vimrc file:

syntax on

This tells Vim to enable syntax highlighting when it starts up. There are many other commands that can be added to the vimrc file; you can see some examples here. But since this is a blog about learning Vim, I thought it would be more fun to explore new Vim commands by adding something random from this list of Vim commands to my vimrc file, trying it out in the editor and seeing what happens as a result of running that command!

One of the main reasons for the popularity of Vim is its simplicity. The editor is built on top of hjkl keys which can be found on any keyboard. Besides, it is a modal editor which means that you have to switch modes according to the purpose you want to achieve.

Hence, in order to master this tool, one must learn the commands given below. These are the commands that we’re going to use most often. For now we will not focus on explaining them, but rather on practicing them with the help of our vimrc file.

First, let’s get acquainted with modes and understand why they are so important in Vim.

Modes

Vim has six modes which tell you what actions it is going to perform next:

Normal – this mode allows you to navigate the text without changing it;

Insert – this mode lets you insert text at a current cursor position;

Visual – this mode enables you to select certain pieces of text in different ways;

Command-Line – this mode lets you type commands in a bottom window;

Ex-mode – this mode is similar to Command-Line but it opens a prompt at the top of the window;

Select – this mode allows you to use mouse

The best way to learn Vim commands is by practicing them and writing your own .vimrc file.

By the end of this blog post you’ll know how to get comfortable with Vim, how to use it in the real world and why Vim is so popular among developers.

vimrc is the configuration file that stores all of Vim’s settings, including the keyboard mappings.

To find out more about Vim, check out the online manual: https://www.vim.org/ug-vimrc.html

Leave a Reply