By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,768 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,768 IT Pros & Developers. It's quick & easy.

Vim scripts for editing Python?

P: n/a
Hi, did anyone make a good set of scripts for editing Python in Vim? I
know there is one on vim.org but it isn't very advanced. thx..

Nov 21 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a

Rainy wrote:
Hi, did anyone make a good set of scripts for editing Python in Vim? I
know there is one on vim.org but it isn't very advanced. thx..
What functionality are you looking for?

Nov 21 '06 #2

P: n/a

Bill Pursell wrote:
Rainy wrote:
Hi, did anyone make a good set of scripts for editing Python in Vim? I
know there is one on vim.org but it isn't very advanced. thx..

What functionality are you looking for?
For example, to auto-fold all function bodies while leaving the
function names visible. To indent after ':' but only when it's at the
end of line. Also to auto-close braces like [], (), {}, autoclose
quotes. Complete all standard lib module functions, and imported
functions. I don't exactly remember how much of this was done by the
script that is posted on vim.org.. I recall it was missing some things
and some others it had didn't work exactly right at all times.. But
that was a while ago.

Nov 21 '06 #3

P: n/a
For example, to auto-fold all function bodies while leaving
the function names visible.
Do you mean

:set foldmethod=indent

which does what I think you're describing...
Also to auto-close braces like [], (), {}, autoclose quotes.
You can map whatever you like:

:inoremap [ []<left>
:inoremap ( ()<left>
:inoremap { {}<left>
:inoremap " ""<left>
:inoremap ' ''<left>

which will do the trick for you.

As for the other things, I haven't monkeyed with them, but if you
drop by the vim mailing list, there are other smart cookies there
that can help you out. I've heard of such abilities...just
haven't played with them.

-tkc
Nov 21 '06 #4

P: n/a
For example, to auto-fold all function bodies while leaving
the function names visible.
Once I wrote a plugin for vim that folds python code:

http://www.vim.org/scripts/script.php?script_id=1494

It will make the docstrings and function names visible.

HTH,
Daniel
Nov 21 '06 #5

P: n/a

Rainy wrote:
Hi, did anyone make a good set of scripts for editing Python in Vim? I
know there is one on vim.org but it isn't very advanced. thx..
Here's what google has to say about it:
http://www.google.com/search?hl=en&q...=Google+Search
http://www.google.com/search?hl=en&l...on&btnG=Search

Danny

Nov 21 '06 #6

P: n/a


On Nov 21, 11:48 am, "Danny Colligan" <dannycolli...@gmail.comwrote:
Rainy wrote:
Hi, did anyone make a good set of scripts for editing Python in Vim? I
know there is one on vim.org but it isn't very advanced. thx..Here's what google has to say about it:http://www.google.com/search?hl=en&q...3Ahttp%3A%2F%2...

Danny
Almost forgot... if you do some searching around on comp.editors for
vim and python:

http://groups-beta.google.com/group/...rch+this+group

You'll find some helpful threads such as this one:

http://groups-beta.google.com/group/...5a6a9ed84e0eb2

Danny

Nov 21 '06 #7

P: n/a

Danny Colligan wrote:
On Nov 21, 11:48 am, "Danny Colligan" <dannycolli...@gmail.comwrote:
Rainy wrote:
Hi, did anyone make a good set of scripts for editing Python in Vim? I
know there is one on vim.org but it isn't very advanced. thx..Here's what google has to say about it:http://www.google.com/search?hl=en&q...3Ahttp%3A%2F%2...
Danny

Almost forgot... if you do some searching around on comp.editors for
vim and python:

http://groups-beta.google.com/group/...rch+this+group

You'll find some helpful threads such as this one:

http://groups-beta.google.com/group/...5a6a9ed84e0eb2

Danny
Thanks Danny, that's exactly what I was looking for!

Nov 22 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.