The VIM Editor's shortcut keys are used

Source: Internet
Author: User

Shortcut keys for the VIM editor


(i) in command mode

To move the cursor:

Move front and back: H move forward one unit in the same line L backward

Move up and down: K move J up one line down



HL can only move one unit, inconvenient

Number 0 moves to the beginning of the line

$ End of line


The movement of a word

W move right to the beginning of a word B move forward the beginning of a word


Turn the page (using the usual method)

PageUp

PageDown


R replacement

Action: Enter r and enter characters, but only one character can be entered


Delete a character:

X

DW Delete A word amount for the current cursor

d$ Delete current cursor to end of line

DD Delete entire line

(Deleted text will also be saved in the buffer, after pasting can be used,)


Y generally means replication

YY Copy a row

YW copy a word

y$ Copy the current cursor to the end of the line


P Paste

DD P is equivalent to clipping (deleted, then move cursor, paste back)


In the delete, copy these shortcuts to the front plus numbers, you can manipulate multiple lines

3DD p Clip 3 lines

4yy P

For cursor navigation shortcut keys, you can also add a number eg:3w move three words in volume 10l move backwards by 10 characters


Undo and Redo (equivalent to Ctrl +z ctrl+y in Windows)

U undo

Ctrl+r Redo


(b) in the last line mode :


: s/old/new/the first matching character in the current row is replaced

: S/old/new/g plus G, the matching characters in a row are replaced

: 1,3s/old/new/The number of rows is limited to 1, 3 rows

:%s/old/new/g to the entire text bank



: W file name the currently written text is written to another file (such as a new file does not exist)

: w! FileName If the file already exists, w! will force overwrite the new file

: R file name loads a file into the current


The VIM Editor's shortcut keys are used

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.