Taking a minute to love Vim


This article is a result of my love for Vim and not a single programmer would leave Vim without mocking. In fact, leaving Vim is considered tougher than getting a job interview from Google (insert your favorite Tech company here šŸ˜Š). Vim is the best editor to work on a Linux system. So here’s the getting started to Vim guide, which will be enough if you want to use it to write everyday code.

1 Insert something in a file

Open the file with Vim:

vim _filename_

and then, press ‘i’ or the insert key and you are done. Vim will show you which mode you are in.


2 Run a command

First press Esc key which will make theĀ screen look like this:


Then press ‘:’ (colon) and insert the command.


3 Exit Vim

Press the Esc key and then press colon and then press ‘q’ (quit).

If you want to quit without any warning you do:


Otherwise, Vim will show a warning that you are trying to quit a file without saving it.

4 Paste text without disturbing alignment

Use the paste mode:

:set paste

The paste mode converts tab character to space characters. To get out of this mode use:

:set nopaste

5 Copy

Forget Cltr + C, with Vim its even more easy (Wow, it rhymes šŸ˜Ž)

Put the cursor from where you want to start copying. Then press Esc and then ‘v’. You will get into theĀ visual mode.


Then select text and after you are done press ‘y’.

6 Cut

Get into visual mode, select text and press ‘x’.

7 Paste

After copying theĀ code, go to the character you want to paste and:

Ā * ‘p’ to paste after the character you are on.


* ‘P’ to paste before the character you are on.

8 Undo

Go to command prompt and:


9 Difference between two files


vim -d _file1_ _file2_

You would see something like this.


That’s all folks. Keep spreading theĀ love for Vim.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s