TranslateProject/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md
2016-02-20 16:46:59 +08:00

3.9 KiB
Raw Blame History

[Free Download] Vi Cheat Sheet For Beginners

I have often shared my Linux experience with you. Today I am going to share my Vi cheat sheet that has often saved me time in googling for a quick command.

Basic Vi commands

This is not a detailed tutorial to teach you each and every aspect of Vi editor. In fact, its not a tutorial at all. Its just a collection of basic Vi commands and their brief description for a quick reference.

command explain
:x Save the file and quit
:q! Quit without saving the file
i Insert starting left of the cursor
a Append starting right of the cursor
ESC Exit insert/append mode
arrows Move cursor
/text Search string text (case sensitive)
n Search next occurrence of the searched item
x Delete character under the cursor
dd Delete line under the cursor
u Undo last change
:0 Beginning of the file
:n Go to line n
G End of the file
^ Beginning of the line
$ End of the line
:set list See special characters in the file
yy Copy the line into the buffer
5yy Copy 5 lines into the buffer
p Paste buffer after the current line

You can download the above cheat sheet in a PDF format from the link below:

Download Vi Cheat Sheet

You can print it and keep it at your desk or just save it for offline use.

Why I created the Vi cheat sheet?

Several years ago, when I started working in Linux terminal, the idea of using a command line editor horrified me. I had used desktop Linux before but it was my personal computer so I happily used the GUI text editor like Gedit. But in the working environment, I was stuck with the command line and there was no scope of using a graphical editor.

I was forced to use Vi for basic edits in the files on remote Linux boxes and this is where I identified and started to admire the power of command line editing tool Vi.

Since, at that time, I was new at Vi editor, I found myself baffling with it. The first time, I could not even come out of the file because I did not know how to close Vi editor. No shame in accepting that I had to Google it.

So, I decided to make a list of all the basic commands that I used frequently for editing in Vi. This list or cheat sheet, as you may call it, helped me a lot in my early days with Vi. With time, I grew up with Vi and now I dont even need to look at the Vi cheat sheet because I have the commands memorized by heart.

Why should you use Vi cheat sheet?

I can understand your situation if you are just getting started with Vi. Your favorite Ctrl+S doesnt work for saving files. Ctrl+C and Ctrl+V were supposed to be the universal shortcut for copy and paste but it wont work in Vi universe.Thousands of people use cheat sheets

Thousands of people use such cheat sheets for various programming languages and / or tools that give them a quick reference to commonly used steps / commands. Trust me, using cheat sheets among the best practices advised to programmers.

This Vi cheat sheet will help you a lot if you are just starting with Vi or if you infrequently use the Vi editor (so you keep forgetting the commands). You can save it and use it for quick reference in future, that too offline.

Do you like it?

So far, I have refrained myself from going into too much on terminal side. How do you find this post? Do you want me to share more such cheat sheets and downloadable items? Your suggestions are welcomed.


via: http://itsfoss.com/download-vi-cheat-sheet/

作者:ABHISHEK 译者:译者ID 校对:校对者ID

本文由 LCTT 原创翻译,Linux中国 荣誉推出