VI Shortcut keys

Source: Internet
Author: User

VI several shortcut keys, record the memo

I. Cursor movement

1. Move the cursor to the file to start pressing the GG two key

2. Move the cursor to the end of the file press the G key

3. Move the cursor to the wardrobe press ^

4. Move the cursor to the end of the line by pressing $

Two. Editing

1. Delete a (cursor) word (alphanumeric string) press DW two key

2. Delete (cursor) line press DD two key

3. Press the * key at the full text search cursor

4. Search under (top) a match word press N (n) key

5. Search for {[(or}]) with the symbol that matches the current cursor by the% key

6. The man file that brings up the function at the cursor press the K key (that is, shift-k)

7. Find and replace 50 to 100:50, 100s/old/new/g

8. Full-text find and replace, and prompt before replacing:%S/OLD/NEW/GC

9. Add (delete) bookmark a press MA (:d Elm a)

10. Save all open files: WA

11. Exit all open files after saving all: WQA

Three. Other

1. Horizontal (vertical) Split screen view another file: vs (sp) newfile

2. Open the file name at the cursor (current directory), press G (O) F (ile) key

3. Turn on (OFF) syntax coloring: syntax on (off)

4. Show (hide) line number: Set Nu (Nonu)

5. The selected area re-syntax indent press the = key

6. Run a command:!command

7. Displaying files in ASCII code:%!XXD

8. Close other Windows outside the current window: only

9. Toggle the active window ctrl-w

10. Cursor moves between multiple Windows Ctrl-w-H (j,k,l)

11. Window Resizing ctrl-w-+ (-)

12. (When multi-window) Move the window (relative position) ctrl-w-H (j,k,l)

VI Shortcut keys

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.