Shortcuts for VIM Learning (2)

Source: Internet
Author: User

I learned some simple mobile shortcuts for vim last time and used them for a period of time.

You are already familiar with these shortcut keys.


Continue learning now

This time, we will summarize some shortcut keys for inserting, searching, replacing, and copying and cutting.


Insert and delete shortcuts


A: insert after the cursor

B: Insert before the cursor
Dd: delete a row

D + number + direction: delete several lines/characters to a certain direction

After a row is deleted by cc or S, the row enters the insert mode at the beginning of the row.
Dw deletes a word (excluding the characters before the word after the current cursor), and the cursor reaches the first word of the next word.
Cw deletes a word and enters the insert mode.
X or dl delete a character on the right of the cursor
S or cl delete a character on the right of the cursor and enter insert mode


Search shortcuts


#: Search up the word with the current cursor

*: Find the word where the current light is changed.


Search for replacement shortcuts


Template:


: S/STRING/REPLACE


Instance

: S/of/OF Replace the next

: % S/of/OF all Replace with

: Replace 1, 3 s/of/OF/g 1st to 3 rows of



Copy and paste operations in visual mode


V highlighted by characters

V highlight by line

Ctrl + v highlight by block


After selection, you can perform the copy and cut operations.


D. Cut the content.

Y: copy the content.

C. Cut the content and enter the insert mode.


Paste a key.

P paste the previous content


There is also a copy cut command in command mode


Dd: Cut the current row

Yy: copy the current row

Cc: Cut the current row and enter the insert mode


This learning is here, and I will continue my next study after I have mastered it.


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.