Vim Operation Summary

Source: Internet
Author: User
Tags imap

I. Mobile

 

  1. H, J, K, L corresponds to left, bottom, top, right
  2. W move the cursor forward a word
  3. B. move the cursor one word backward.
  4. NW move cursor forward n words
  5. NB moves the cursor n words backward
  6. $ Move the cursor to the beginning of the line
  7. ^ Move the cursor to the first letter of the current row
  8. ) Move the cursor to the next sentence.
  9. (Move the cursor to the previous sentence.
  10. Gg move the cursor to the first line of the page
  11. G move the cursor to the last line of the page
  12. NJ move n rows down
  13. Ng jumps to line N
  14. H move the cursor over the screen
  15. M move the cursor to the center of the screen
  16. L move the cursor to the bottom of the screen
  17. FX moves the cursor to the next X of the row

 

 

Ii. Cut and copy

 

  1. <Shift-V> select text (visualization)
  2. V select text
  3. D. Cut the selected content to the clipboard.
  4. Y. Copy the selected content to the clipboard.
  5. Dd deletes the current row
  6. DW cut a word (or DAW)
  7. YY copy the current row
  8. CC cut the current row and enter the insert mode
  9. DFS cut the character from the current cursor to the next S
  10. C $ Delete the characters from the cursor position to the end of the line and enter the insert mode
  11. D $ Delete the character from the cursor position to the end of the line
  12. P Paste

 

 

Iii. insert and replace operations

 

  1. I insert in the current character
  2. I insert at the beginning of the current row
  3. A is inserted to the right of the Current Character
  4. A is inserted at the end of the current row.
  5. O Insert at the bottom of the current row
  6. O Insert above the current row
  7. R replaces a single character
  8. CL to modify a character
  9. CC to modify the entire line

 

Iv. Save

 

  1. : Q exit
  2. : Q! Force exit
  3. : W save
  4. : WQ disk storage and exit
  5. : New file name New File

 

 

5. window operations

 

  1. <C-H, J, K, L> switch to the upper and lower left windows.
  2. <C-H, J, K, L> window up and down
  3. WM: wmtoggle open the browser window
  4. F8 open or close the taglist window
  5. : Close current window
  6. <C-W> switch activity window
  7. : Only close other windows and keep only the current window
  8. : Split Horizontal Split Window
  9. : Vsplit Vertical Split Window
  10. : 4 split the window and make the new window only have four rows
  11. <C-U> text scroll up half screen
  12. <C-D> text scroll down half screen
  13. <C-F> scroll the whole screen forward
  14. <C-B> scroll back the whole screen
  15. ZZ current row is set to the center of the screen
  16. The current ZT row is placed at the top of the screen.
  17. ZB current row is placed at the bottom of the screen
  18. : Previous move to the previous file
  19. : Next move to the next file
  20. : 2 next skip two objects forward
  21. : Last move to the last file
  22. : First move to the first file
  23. Cal open the calendar window

 

 

Vi. Redo and search replacement

 

  1. X Delete the current character
  2. U undo
  3. <C-R> Redo (UNDO reverse)
  4. /Text: Search for text. After searching, use N to search for text and N to search for text.
  5. ? Text: Search for text. After the search, use N to search for text and N to search for text.
  6. /Text/> Search for a single word text
  7. //> Text/> Search for a single word text
  8. /^ The only match the word with the first line
  9. /The $/> only matches the word with the first line
  10. J. concatenate multiple rows into one row
  11. Gu: The current word is capitalized.
  12. Gu: The current word is lowercase.
  13. The current guu row is capitalized.
  14. The current guu row is changed to lowercase.
  15. : S/from/to replace the current row from with to, and replace only the first one (: S/from/to/G indicates replacing all of the current row)
  16. : 1, 5S/from/to replace from 1 to 5 rows from
  17. : % S/from/to/g replace all from with

 

 

 

VII. Common Vim setting commands

 

  1. : Set ignorecase ignore size
  2. : Set noignorecase exact match
  3. 3. Set nohlsearch to disable highlighted display
  4. 4.: Set hlsearch to enable highlighted display
  5. 5.: set number: displays the row number.
  6. 6.: Set nonumber does not display the row number
  7. 7. The Vim configuration file is _ vimrc

 

 

8. Jump (bookmarks)

 

: Jumps to list jump history

''Back to the place before the jump

Ma sets the current behavior bookmarks

'A jump to bookmarks

: Marks

'Start point before this jump

"The last position of the cursor when the file was last edited

[Start position of the last modification

] End position of the last modification

 

 

9. Miscellaneous

 

: Map list key-value ing

: Vmap list visualization key-value ing

: NMAP lists normal key-value ing

: IMAP list inserted key-value ing

: Cmap LIST command line key-value ing

: OMAP list system key-value ing

 

: Imap <F2> <CR> date: <ESC>: Read! Date <CR> kJ defines F2 as the insert date

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.