VI

Jonathan Gardner gardner at cardomain.com
Fri Jun 22 19:33:49 EDT 2001


Michael Robin wrote:

> I just downloaded vim - wow! (I'm going to catch up on vim in the
> c.l.p archives and see what she can do python-wise. Don't suppose
> there's a VI mode for Scite, PythonWin or Komodo??)
> 
> It's like riding a bike! I'd forgotten how much sense a "modefull"
> editor made, and how fast you can edit by keeping your hands where
> they belong.
> I always thought a pointing device was great to draw pretty pictures
> with - how did it get thrust upon us to perform every possible
> function? Certainly a keystroke or two is more preferable than
> "navigating" to a toolbar hieroglyphic that needs to be looked up
> anyway? (If not WIMPS, what would have prevailed??)
> 
> It must be late...
> ZZ (works the same as :wq when you're tired...)
> 
> mike
> 
> 
> 

This is my setup for python:

"Turn on syntax highlighting 
syn on
" Tabstops should be at 8 where they always should be
set ts=8
" But people have generally agreed upon 4 being where they would like it
set sts=4
" And you want the indention level to go 4 at a time.
set sw=4
" And this is to make sure no tabs get in your textfile.
set et
"And this is good for indenting. Don't need no advanced features.
set ai

If I could only figure out how to get it to indent the next line when I end 
a line with ":"...

And if I get a file with tabs mixed in, I use ":retab" and it will fix 
everything the same.

If you have a good version of the development (6.0ai is the last one that 
seemed to have no major problems... but there may be one past ak since I 
post this) you can do textfolding easily.

:he folding

I like to do this for python:
:set foldmethod=indent
:set minfoldlines=4

This makes it all easy to grok long functions in python and make sure 
everything is lined up right.

zc to close a fold
zC to close it all the way
zo to open it
zO to open it all the way
zR to open every fold
zM to close all the folds.

Pretty easy to pick it all up.
-- 
Jonathan Gardner
"Infinity isn't all that large - except at the end." -- Uncle Al

Please don't take anything I say seriously, even if you are really gullible.



More information about the Python-list mailing list