Introduction to the simple application of VIM tools for Linux

Source: Internet
Author: User

Vim Introduction:


Vim is an upgraded version of VI, VIM is a color display, install vim using yum install-y vim-enhanced.

Vim is divided into three modes: General mode, edit mode and command mode.


Vim color display and move cursor:


Vim is displayed color, and is based on the name or content of the file to display different colors, and can be/etc/vimre to edit the configuration file, or in the user's home directory to edit VIM/ROOT/.VIMRC this file, the default file does not exist.


Vim General mode to move the cursor:


Move Cursor Command

Keys

Role

h or LEFT ARROW key

The cursor moves one character to the left

L or right ARROW keys.

The cursor moves one character to the right

K or downward direction key

Move the cursor up one character

J or DOWN ARROW keys

Move the cursor down one character

Ctrl+b or PageUp key

Text page to turn one page forward

Ctrl+f or PageDown key

The text page turns backward one page

Number 0 or Shift+6

Move to the beginning of the bank

Shift+4

Move to the end of our line

Gg

Move to First line

G

Move to Tail line

NG (n is any number)

Move to Nth row


Vim general mode copy, cut and paste:


Use the following shortcut command

Keys

Role

X,x

X means to remove one character backwards and X to delete one character forward

Nx

Remove n characters backwards

Dd

Delete/Cut the row where the cursor is located

NDD (n is number abbreviation)

Delete/cut n rows after the row of the cursor

Yy

The copy cursor is in the row

P

From the line where the cursor is located, paste the contents that have been copied or pasted down

P

From the line where the cursor is located, paste the contents that have been copied or pasted up

Nyy

Copy n rows down from the line where the cursor is located

U

Revert back action

V

Moving the cursor after pressing v selects the specified character, and can be copied, pasted, and so on


This article is from the "Gary Blog" blog, please be sure to keep this source http://taoxie.blog.51cto.com/10245493/1979733

Introduction to the simple application of VIM tools for Linux

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.