Vim Editor Common commands

Source: Internet
Author: User

Vim is a powerful text editor under the Linux system. Trust the program that is familiar with the Linux development environment apes and OPS are playing well.

Here is a brief introduction of the commonly used command, I hope to help you

MACROS macro

  1. QA: Start looking for a registered macro record

  2. Q Start at the end of the record

  3. @a

    Multiple file multiple files editing

  4. : E edits a file from the cache

  5. : Bn enters next cache

  6. : BD Delete File cache or close file

  7. : SP FN Opens a file in a new window or opens in a cache

  8. Commands under Windows: Ctrl+w

    ctrl+w S Window Segmentation

    Ctrl+w W window switch

    Ctrl+w Q exit A window

    Ctrl+w v Vertical Split window

  9. Tab command

    : TAB FN tab after editing file

    GT next Tab

    GT last Tab

    : Tabr first Tab

    : Tabl Last Tab

    : tabm[n] Move current tab to N tab

  10. Exit exits

    : W Save

    : Wq Save Exit

    : x Save with Wq

    : Q Exit does not save

    : q! Force quit does not save

  11. Find and replace Search/replace

    /Enter a mode

    ?/pattern Backward Lookup mode

    n repeat search for same instruction

    N repeat search for opposite instructions

    : s/old/new/g Replace all old content

    : S/OLD/NEW/GC replace all old content with new one to ensure that each replaces

  12. Visual modes Visual mode

    1> Text Tags:

    V Enter visualization mode

    V begins line-oriented visualization mode

    Ctrl +v start oriented block visualization mode

    o Move to the end of another marker area

    U Mark area converted to uppercase

    O move to the corner of the other block

AW tag A word

Block of AB brackets included

AB a straight that was included in the

IB within ()

IB within {}

2> command

> = Right Shift

< = Shift Left

Y-Pull =yank

D Delete

~= switching

3> Cut and paste

DD Delete a row

DW Delete current one word

X Delete Current character

X Delete the character before the current character

D Delete the last line

YY Copy a row

2yy Copy 2 rows

YW cutting words to the clipboard

y$ cut the last line

P Paste the last line of the Clipboard current cursor

P pastes the line before the current line or cursor

]p paste the row of the Clipboard and indent it correctly.


This article is from the "Star Moon Love" blog, please be sure to keep this source http://xuegodxingyue.blog.51cto.com/5989753/1958601

Vim Editor Common commands

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.