Vim scripts for editing Python?

R

Rainy

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..
 
B

Bill Pursell

Rainy said:
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?
 
R

Rainy

Bill said:
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.
 
T

Tim Chase

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top