Vim usage notes

Source: Internet
Author: User

1. Exit the current form: Q

2. Exit VIM: QA!

3. Jump to the tag, move the cursor to the tag, and press Ctrl +]

4. Set the left mouse button and double-click the tag to jump: Set mouse = a note that there are spaces on both sides of the equal sign

Jump back from the tag and press Ctrl + T or Ctrl + O

5. Word search function: helpgrep word

6. Check whether the compatible option command is set: Set compatible?

7. Enter the shortcut key I in the command mode and exit the insert mode. The shortcut key is ESC.

8. delete a letter, move the cursor over it, and press the X key. Press SHIFT + X to delete the first character of the current character.

9. Delete the content of a row and enter the command mode. move the cursor to the target line and press the DD key.

10. Merge the content of the current row and the next row into one row. In command mode, move the cursor to the target row and press the J key.

11. The undo command is the U key in command mode.

12. The key combination of the redo command is Ctrl + R.

13. append and insert. move the cursor to the character to be inserted and press the key to append the expected character.

14. The command for creating a new line (the next line of the current line) is to press the O key and press the O key to directly insert.

15. The number can be placed before the command, indicating that the command is executed many times (the number of times is determined by the number ). For example, you can use the command 100aj + ESC to append 100 J characters.

16. Save the file and exit with the combined key ZZ. This command only exits the file window being edited and does not exit vim.

17. Exit but do not save the file: Q! (: <-> Command line mode; q <-> quit ;! <-> Override command modifier)

18. Continue to use Vim to edit the file: E!

19. Move a word forward with the command W. The cursor is placed on the first letter of the word.

20. Move a word backwards. Use command B. The cursor is placed on the first letter of the word.

21. Move a word forward with command e. the cursor is placed at the end of the word.

22. Move a word backward. Use the command GE to place the cursor at the end of the word.

23. Locate the command at the end of the line $

24. Locate the command 0 at the beginning of the line.

25. Locate the first non-null character in the line header. ^

26. Find command F in Line Backward, for example, find the H character in the current line and command FH. Here F indicates find.

27. Run the forward SEARCH Command F in the same way as above.

28. Line Backward lookup command T is similar to F, but it leaves the optical calibration on the first character of the lookup character.

29. Line Forward query command T, where T/T represents

30. Brackets match command %, place the cursor on a bracket, and press command %. The cursor immediately jumps to another matching bracket.

31. Locate the command xxxg in a line.

32. Locate the command g at the end of the file.

33. Locate the command Gg starting with the file.

34. The command XX % to locate a line (range) of the file. For example, 50% move the cursor to half of the file.

35. Locate the command h/m/L before and after the current display page, indicating header, middle, and last respectively.

36. Command for displaying the row number: set number. Command for undisplaying the row number: Set nonumber

37. The full path name and total line number of the current file are displayed.

38. Command for displaying row number, column number, and percentage in the bottom right corner of the file: Set rquota. The command for canceling it is set northeasters.

39. Run Ctrl + U on the top 10 lines and press Ctrl + D on the top 10 lines. The cursor position remains unchanged during the turning process.

40. Run Ctrl + e to flip up the command line, and run CTR + Y to flip down the command line. The cursor position remains unchanged during the turning process.

41. display the command ZZ in the center of the screen where the cursor is located, locate the command ZT at the top of the screen, and locate the command ZB at the bottom of the screen.

03. 8 ......

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.