- vim is the editor used in the terminal on Ubuntu. For example, enter vi test.c in the terminal to open it.
- Enter editing mode "i", general mode "esc"
- Move the cursor: Use the up, down, left, and right keys on the keyboard in editing mode. H, J, K, and L are not available. Both methods are available in normal mode.
- Copy: Double-click "y" to copy the first line, press "p" to paste in the next line
- Enter command line mode with ":"
- Enter "set number" in command line mode to display the line number
- Copy multiple lines: Press "v", move the cursor to select lines 1-3, press "y", move the cursor to the paste position, and press "p"
- Undo, "u" in normal mode, "u+r" to undo
- Text search: "/" or "?" plus the string to be searched, such as pressing "/" or "?" to enter the command line mode, "Enter" to start searching, "n" to search for the next
- Delete "delete" or "dd" to delete the entire line or "3dd" to delete 3 lines starting from the cursor
- The above is a summary of basic usage. If there are any errors or additions, please let us know in the comment area. Welcome to communicate.
Summary of how to use vim editor
Guess you like
Origin blog.csdn.net/shijizai/article/details/128170068
Recommended
Ranking