[Tutor] multiline comment in Python

Scot W. Stevenson scot at possum.in-berlin.de
Fri Sep 5 12:52:56 EDT 2003


Hi -  

> And using vi(or vim or elvis) its nearly as easy.
> [using :m,ns/^/#/  and :m,ns/^#//  in vim you can use the visual
> block mode to select the comment region. I suppose you could even map
> it to a key if you wanted]

Good grief Alan, you're making it sound like vi is complicated =8)! 

If vim is set up correctly, all you have to do is start out with a '#' at the 
beginning of the line and keep typing past the end of the line, and the Best 
Editor On Earth will put the hash at the start of the next line as well. 

Now, I'm not sure which option actually does this (to be honest, I discovered 
this by accident), but it is out of the box with SuSE 8.2. It is not just 
part of the Python syntax-thingy (/usr/share/vim/vim61/syntax/python.vim), 
because a quick test shows that vim will does the same with a plain text 
file. Strange. 

Y, Scot

-- 
          How to quiet a crying baby with the X Window System: 
                  nice xlock -inwindow -mode kumppa

               Scot W. Stevenson - Zepernick, Germany




More information about the Tutor mailing list