Summary of Vim shortcuts and summary of Vim shortcuts
In July, I had to add more than one piece of water each month. Record the simplest shortcut key. (Add a little bit every day)
Alt + 4: move the cursor to the end of the row quickly;
Alt + 6: move the cursor to the beginning of the row quickly;
Command Line Mode: vsp and sp multi-frequency Screen opening.
Non-edit mode:> indent, <undo, n>, n <,
Delete: dd, n + dd
Copy: yy
Paste: p
Undo: u
What is the shortcut key for VIM copy and paste?
The answer from others is clear.
The most basic copy is y, the paste is p, and the cut is d.
The copy and cut commands can be followed by a move command to copy the text in the cursor movement range.
The difference between p and P during pasting is the difference before and after the cursor is pasted.
If you want to paste data in insert mode, you can press ctrl-r * to paste the data in normal mode.
What is the shortcut key for vim multi-line comment?
I use my own customization. Share it with you. Hope to help you.
Add the following statement to. vimrc:
Vmap <C-S-P> dO # endif <Esc> PO # if 0 <Esc>
In normal mode, press "V" (uppercase) to enter the <visual line> mode, press the top and bottom keys, select the row to be annotated, and press CTRL + SHIFT + P, in this way, # if 0 and # endif will be added up and down the selected row. It serves as a comment.
In the C language, it is not safe to use/**/to annotate multiple rows, so the "# if 0" method is used. If you need other methods, you can also refer to this idea.