Under linux vim common commands Multi-line comments and multiline delete

1. multi-line comments:
  1. First Press esc into the command line, the press Ctrl + v, into the column (also called blocks) mode;
  2. Use the arrow keys to select the beginning of a line of multi-line comment is required;
  3. Press the keyboard (uppercase) "I" key to enter the insert mode;
  4. enter a comment character ( "//", "#", etc.);
  5. Finally press the "Esc" key.
Note: After you press the esc key, the comment will wait a little longer to appear, do not worry ~ ~ very short time
 
2. Remove multi-line comments:
  1. First Press esc into the command line, the press Ctrl + v, into the column pattern;
  2. To cancel the selected multi-line comment;
  3. Press the "x" or "d".
Note: If "//" comment, that the operation needs to be performed twice, if the "#" comment, once
3. Delete multiple lines

 

1.vim file name, first in command mode, enter " : the SET NU " display line numbers;
2. determine the row you want to delete by line number;
3. Enter the command " : 32,65d ", Enter, 32 -65 line was deleted, it is very fast

If you accidentally delete the wrong, you can use the 'u' key recovery (command mode)

Guess you like

Origin www.cnblogs.com/jn1011/p/11307401.html