vi and python?

Malcolm Tredinnick malcolmt at smart.net.au
Tue Jan 25 19:34:45 EST 2000


On Tue, Jan 25, 2000 at 04:22:14PM -0600, Ben Beuchler wrote:
> There seems to be a general preference for emacs in the python community.  I
> am personally much more comfortable working with vim.  Does anyone have any
> particular tips for python development within vim? Particular shortcuts to
> test code, autoindentation settings, etc...  I would particularly like to be
> able to use some of the idle features with, perhaps, gvim...

Leaving aside the "general preference for emacs" bit (they are possibly just a
bit more vocal than the others :-) ), there was a thread about vim settings
back in late November. The article that best summarised everything is at
http://www.deja.com/getdoc.xp?AN=555098950

Note that this only deals with indenting issues. There was another thread
about jumping over blocks of code in Python (some tricky issues handling
continuation lines), but when I went to look for it just now, Deja slowed down
to a crawl. Search for recent articles with 'vim' in the subject line -- this
thread will be one of the few (about 20 hits) that are returned.

Just in case Deja does not love you either, the short version of the above
thread was that people liked something of this order:
	set expandtabs
	set tabstop=8
	set shiftwidth=4
	set softtabstop=4
	set smarttab
	set autoindent

or, on a single line:
	se et ts=8 sw=4 sts=4 sta ai

Quinn Dunkan also auggested the mapping:
	im :<cr>    :<cr><tab>			(four spaces in the middle)

for automatically indenting after a colon at the end of a line.

Cheers,
Malcolm Tredinnick

--
42.7 percent of all statistics are made up on the spot.





More information about the Python-list mailing list