God operation
Writing code in vim often comes across multiple lines of comments and uncomment, and in VS we can use the default shortcut keys or customize shortcuts in settings to solve this problem.
Since Vim is so powerful, it must also have shortcut keys to complete. Here are the steps:
Step 1: In command line mode, place the cursor in the first column and press CTRL + V shortcut key to enter VB Visualization mode:
Step 2: Move the cursor up or down and select the line you want to comment on:
Step 3: After selecting, press * * Capital **i key to enter insert mode, enter the comment "//" or "#":
Note that you must press the I key in uppercase, lowercase is not possible. The landlord just started to press the lowercase I, the result has not been (laughter cry)
Step 4: Finally press the ESC key (two times), the selected lines have been commented out, Roar Kai Sen ~
Step 5: Repeat STEP1-STEP2 when canceling multiline comments, but at this point the cursor is checked and the number of lines is selected. Simply press the D key (lowercase) and the comment is deleted:
Note that this will be done by pressing the lowercase d and then all the rows you have selected are deleted by capitalization.
Of course, if you feel that these steps can't be remembered, you can click the link below in the. vimrc file China joins the relevant configuration, custom actions: Point me to me ~
The End
Vim multi-line comment and cancel