Rookie Learn Vim

Source: Internet
Author: User

For a college graduate of the rookie, learning Vim will inevitably be some unprepared.

The school may be exposed to some of the vi editors in Linux, but it's a little bit smaller than gvim.

I think that the first thing to learn vim is to adjust their own ideas, to get rid of the view of the operation, do not take office in the operation of the way to vim;

next is to start from small start, from the simple practice, I am a rookie to learn the summary of vim:

Beginner's Junior article:

Normal state:
I→insert mode, press ESC to return to Normal mode.
x→ Delete the character of the current cursor.
: wq→ disk + exit (: W disk,: Q exit) (Note: W can be followed by file name)
dd→ Delete the current row and save the deleted row to the Clipboard
p→ pasting the Clipboard

HJKL (strong example recommends using it to move the cursor, but not necessary) → You can also use the cursor key (←↓↑→). Note: J is like the down arrow.
: Help <command>→ displays assistance with related commands. You can also enter: Help instead of the command.


1: Various insertion modes
A after the cursor is inserted
o Insert a new row after the current line
o Insert a new row before the current line
CW replaces characters from the position of the cursor to the end of a word


2: Simple Move cursor
0 number 0, to the wardrobe.
^ to the first position of the bank that is not a blank character (so-called blank character is space, tab, line break, carriage return, etc.)
$ to Bank line end
G_d to the last position of the bank that is not a blank character.
/pattern Search for pattern strings (if multiple matches are searched, press N to next)


3: Copy, paste
P Paste
YY copy current line equivalent to DDP

4:undo, Redo
U undo
Ctrl+r Redo


5: Open, Save, exit, change file
: E opens a file
: W Disk
: Save SaveAs as
: X,:wq Save and exit
: q! Exit does not save: qa! Forcibly quit all files that are being edited
: Bn and: BP You can open many files at the same time, then use these two commands to switch

For beginners, I am familiar with these commands and need to use VIM every day to edit some programs. The advantage is that you can not only practice the writing of the program code, but also master the VIM editor commands.

Rookie Learn Vim

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.