A quick way to comment/uncomment lines in
Put your cursor on the first # character, press
For commenting a block of text is almost the same:
- First, go to the first line you want to comment, press
- Then using the arrow key and select until the last line.
- Now press
- Then press
#vim #comment #comment_out #visual_block
vim:Put your cursor on the first # character, press
Ctrl+V, and go down until the last commented line and press x, that will delete all the # characters vertically.For commenting a block of text is almost the same:
- First, go to the first line you want to comment, press
Ctrl+V. This will put the editor in the VISUAL BLOCK mode.- Then using the arrow key and select until the last line.
- Now press
Shift+I, which will put the editor in INSERT mode and then press #. This will add a hash to the first line.- Then press
Esc (give it a second), and it will insert a # character on all other selected lines.#vim #comment #comment_out #visual_block
If you want to comment a block of code out in
#python #jinja2 #comment #comment_out
Jinja2 template, use {# ... #}. It can also span into multiple lines:{#
<tr class="">
<td colspan="2" style="font-family:Ubuntu,Helvetica,Arial,sans-serif; padding: 0px 0px 0px 20px;" class="">
Regards,
</td>
</tr>
<tr class="">
<td colspan="2" style="font-family:Ubuntu,Helvetica,Arial,sans-serif; padding: 0px 0px 30px 20px;" class="">
SYSTEM INFO
</td>
</tr>
#}#python #jinja2 #comment #comment_out