Linux editor Vim

Source: Internet
Author: User

VI Most original version

Vim modified version, more powerful

Open File

Vim file path (command line mode)

The command line mode enters edit mode:

A append to the current position

I insert forward in the current position

o Edit the next line in the current row

O edit a line at the current position

  

Save:

Switch back to command-line mode: Press ESC

Press: SHIFT +: Switch to Extended mode

command-line mode common commands:

NG: Jumps to the end of the file, n indicates the number of rows

GG: Jumping to the beginning of a file

$: Jump to end of line

0: Jump to the beginning of the line

YY: Copy

P: Paste (stick to next line)

P: Paste to Next line

N yy: copies n rows, n represents rows, such as 3,4

N p: Paste n rows

n DD: Delete, n indicates a few rows

DD with P: cut operation

U: Undo (Next step)

CTRL + R: Previous step

H: Current screen start

M: In the middle of the current screen

L: Current screen End

/find content Lookup Press N Next

Extended Mode common commands:

ESC return to command line mode

W: Save

Q: Exit

Wq Save and exit

Q! Force quit, do not save

wq! Force exit and save

    

Replace changes:

S/content to be modified/what to change/(cursor line)

%s/What to modify/what to change/(%: All lines, but only the first one in each row)

%s/What to modify/what to change/g (g: All contents of each line)

    

Linux editor 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.