Vim Tips Summary (keep in mind)

Source: Internet
Author: User

    1. Fast Jump (cmd model) within Vim's line

      ^: The cursor jumps quickly to the first character of the bank header .

      $: The cursor quickly jumps to the last character at the end of the bank.

      NW: The cursor quickly jumps to the header of n fields after the current cursor position, ex:. ? are all a field.

      NB: And NW are just the opposite.

      NC: The cursor jumps quickly to the end of N Fields after the current cursor position .

    2. Enter input in vim (CMD model)

CW: Deletes the cursor position (including itself) toWord TailCharacters and enter the input mode. C $: Deletes the cursor position (including itself) toBank TailAll the characters and enter the input mode. c^: Delete cursor location (excluding itself) toThe Bank's inauguralAll the characters and enter the input mode. 3. Delete character (cmd model) x: Delete one character in Vim.
DD: Deletes the entire row. DW: Deletes the current character (including itself) toWord TrailerCharacters (with spaces also deleted).
d$: Deletes the current character (including itself) toBank TailThe character. d^: Deletes the current character (excluding itself) toThe Bank's inauguralThe character. J: Merges the contents of the current row and the next row.Note: The cursor backwards contains itself, and the forward does not contain itself. 4. Undo operation (Cmd model) u: Undo the current operation.
U: Undo all current operation.
Ctrl +r: Restores using the U command.
5. Copy and paste yy: copy when moving forward
Nyy: Copy N rows (contains the current row)
y$: Copies the current cursor to the trailing character (with the cursor's own character). y^: Copy the current cursor to the first character (without the cursor's own character): M,ny: Copies the contents of line m to Nth row (containing the contents of the N,m row).
P: Paste (Copy the content). 6. Find and replace
Find (top-down)
:/word Press N is the next matching word,n is the previous matching word.
Find (bottom-up)
Word Press N is the next matching word,n that is the previous matching word. Replace
: s/old/new: Replace the current line with the first character old is new.    : s/old/new/g: Replaces the current line with all characters old is new. : m,ns/old/new/g: Replace the old character of the M,n line with new.
:%s/old/new/g: Replaces all old characters new in the entire text. If you use the Confirm function: To add a C after the four commands above. You can do it.

This article is from the "123" blog, please be sure to keep this source http://9014348.blog.51cto.com/9004348/1640979

Vim Tips Summary (keep in mind)

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.