------------------------------------------------------Multi-line annotations in the VIM compiler--------------------------------------------------------
When writing a Python program under the VIM command, it is sometimes difficult to make multiple lines of comments. Because Python does not use/*xxxx*/as a multi-line comment in the C language, it can only be annotated with # for each line, and if there are hundreds of lines, it has to be commented out. In addition to an honest line of comments, here are a few more ways to share:
The first kind: Use the comment as a string and comment it out with ' xxx ', but it is not recommended.
The second kind: Use the function to put the content to be annotated in it, do not call this function, then these to comment the content is useless, this is better than the first.
The Third kind: This is I more recommend, also today colleague teaches me, share to everybody.
There are a few small steps:
Ctrl + V; The view mode in Vim, select the content to be commented on
SHIFT + I; Insert character
SHIFT + #; Insert # in front of the line to be commented (shown in the first line)
ESC, at least 2 times, will have all the selected rows preceded by the #
The third method is not only useful for Python code multiline annotations, but also useful for multi-line annotations of programs in other languages.
------------------------------------------------------------Shell Multi-command-line operation------------------------------------------------------
For example, to restart all openstack-nova-* services, then if one to start, it is too much trouble, if you write a script can be started. But can be started directly with the command (also see colleague operation)
For item in ' ls | grep ' openstack-nova-* ';d o service $item restart; Done
There's a backup command: CP Test.py{,.bak}
Multi-line annotation methods in the Vim compiler (especially for Python code comments)