Linux centosvmware Vim Introduction, vim color display and move cursor, VIM general mode move cursor, VIM general mode copy, cut and paste

Source: Internet
Author: User

I. Introduction of VIM

Vim is a powerful text editor, the upgrade version of VI, with color display, the default has three modes: General mode, command mode, edit mode
Install Vim

[Email protected] ~]# VIM/ETC/PASSWD
-bash:vim: Command not found
[Email protected] ~]#
[email protected] ~]# Yum install-y vim-enhanced

...

second, color display, Move Cursor

[[email protected] ~]# VIM/ETC/PASSWD under etc will display color according to different files,

[[email protected] ~]# cp/etc/passwd/tmp/does not display color in/tmp

[[email protected] ~]# VIM/ETC/VIMRC vim configuration file

Move the cursor in general mode

h or LEFT ARROW key: The cursor moves one character to the left

I or have arrow keys: The cursor moves one character to the right

K or UP ARROW: The cursor moves up one character

J or DOWN ARROW: the cursor moves down one character

Ctrl+b: Text page forward one page

Ctrl+f: Text page to turn backward one page

Number 0 or shift+6: Move to the top of the bank

Shift+4: Move to the end of the bank

GG: Move to First line

G: Move to the tail line

NG (n is any number): Moves to nth row

Third, delete, copy, paste

X: Delete one character forward

X: Remove one character backwards

NX: Remove n characters backwards

DD: Which row of the delete/pre-tangent cursor

NDD: Delete/Pre-tangent the line after row n rows

YY: The copy cursor is in the row

Small p: Pastes the copied or pasted content from the line where the cursor is located

Large p: Pastes the copied or pasted content from the line where the cursor is located

Nyy: Starts at the line where the cursor is located, copying the n rows down

U: Restore previous action

V: Move the cursor after V to select the specified character, then you can implement copy and paste

Linux centosvmware Vim Introduction, vim color display and move cursor, VIM general mode move cursor, VIM general mode copy, cut and paste

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.