You are not logged in.
Hi everyone,
I know that a lot of people use vi, and i know that a lot of them use vi to code python stuff.
So since i like vi a lot i tried to use it too. And as you know, vi is just awesome. But when it comes to gui-programing or other stuff, where you have 1000 different widgets with different functions it's hard to remember them all and that's where my problem start -> the omni-completion simply doesn't work as i want it to and after x hours of googling i haven't found a plugin which make it work as i expect it to.
as a side-note: at school and part-time jobs i was often forced to use visual-studio and it may be a bit hard too say, but when it comes to omni-completion it seems to be the best editor out there.
so what am I looking for?
A vi - plugin which makes the completion behave like the one in visual-studio or if that doesn't exist i would also be satisfied with another editor which have a code-completion like visualstudio.
(for those who are wondering what's wrong with the completion in vi:)
when i type gtk.<ctrl+p> it does show possibilities (although not all of them) but when i do something like
button = gtk.Button
button.<ctrl+p> won't find any methods
besides that, i also tend to dislike the behavor of what it does find (if it does find anything)
thanks already for ya helping me out
Offline
Eclipse with PyDev has great code completion. If you want to keep the vi editing style, viPlugin seems to fit the bill, though it's $15.
I don't know of any lighter editors/IDEs that have that level of code completion. It's not exactly trivial, as it essentially requires the editor to parse Python code.
Offline
Hi everyone,
I know that a lot of people use vi, and i know that a lot of them use vi to code python stuff.
So since i like vi a lot i tried to use it too. And as you know, vi is just awesome. But when it comes to gui-programing or other stuff, where you have 1000 different widgets with different functions it's hard to remember them all and that's where my problem start -> the omni-completion simply doesn't work as i want it to and after x hours of googling i haven't found a plugin which make it work as i expect it to.as a side-note: at school and part-time jobs i was often forced to use visual-studio and it may be a bit hard too say, but when it comes to omni-completion it seems to be the best editor out there.
so what am I looking for?
A vi - plugin which makes the completion behave like the one in visual-studio or if that doesn't exist i would also be satisfied with another editor which have a code-completion like visualstudio.(for those who are wondering what's wrong with the completion in vi:)
when i type gtk.<ctrl+p> it does show possibilities (although not all of them) but when i do something like
button = gtk.Button
button.<ctrl+p> won't find any methodsbesides that, i also tend to dislike the behavor of what it does find (if it does find anything)
thanks already for ya helping me out
I'm not exactly sure how the completion stuff in Visual Studio behaves, but when editing a Pythong file in vim, omni-completion works pretty well for me. I just press ^X^O to get a popup with possible completions and a window with a little help text for every option.
Here's a screenshot:
Offline
@skymt
ty, gonna try it for a while, didn't know that there is a viPlugin for eclipse that (and that elcipse bloated) prevented me to give it a try.
@smoon
as i said, the omni-completion works (i know that i have to type ^X^O first) but only for stuff like gtk.<completion>
but not for messagedialog = gtk.MessageDialog(..) messagedialog.<nocompletion>
first i thought that only happens when I import the widget from a gladefile (because then it was obvious for me that it doesn't know what type of object it is) but sadly it's also when i define them normal.
Offline
[...]
@smoon
as i said, the omni-completion works (i know that i have to type ^X^O first) but only for stuff like gtk.<completion>
but not for messagedialog = gtk.MessageDialog(..) messagedialog.<nocompletion>first i thought that only happens when I import the widget from a gladefile (because then it was obvious for me that it doesn't know what type of object it is) but sadly it's also when i define them normal.
Maybe I still don't get what exactly you mean, but the example you gave works for me:
Offline
seems as if i had something in my .vimrc which broke the completion, now it works...
thanks so far.
Anyone, one more question: Is there a way to modify the behavor of the completion in vi, so that it doesn't insert the first match but only show the possibilities? (like in eclipse).
so that when i write msg.a<^X^O> it doesn't fill in msg.action_area but only shows the possibilities with a and remain at msg.a ?
(hope you understand what i mean)
Last edited by jordi (2007-09-03 12:32:14)
Offline
This is what I use with omnifunc :
"autocompletion stuff
set completeopt=longest,menuone
inoremap <expr> <cr> pumvisible() ? "\<c-y>" : "\<c-g>u\<cr>"
inoremap <expr> <c-n> pumvisible() ? "\<lt>c-n>" : "\<lt>c-n>\<lt>c-r>=pumvisible() ? \"\\<lt>down>\" : \"\"\<lt>cr>"
hth
Offline
but not for messagedialog = gtk.MessageDialog(..) messagedialog.<nocompletion>
Actually, this is probably different. It depends on your version, but there are a few outstanding bugs that could cause this.
I will tell you it has to do with scoping. All of this works at the top level, but depending on your scope, it may fail
Here's one case:
def foo(*args):
blah.<C-x,C-o>
This always fails because the plugin doesn't handle the *args and **kwargs arguments (whoops)
Additionally, here's the second issue:
def foo(): #No params here
blah.<C-x,C-o>
Yup. It fails for functions with no params too - however, this one is fixed in 0.8 (which may or may not be in our vim runtime files)
Offline
On a related note, any suggestions on how to make the window that appears with the description automatically close after selecting something or escaping?
Offline