Wingide is a beautiful application

Tony Nelson *firstname*nlsnews at georgea*lastname*.com
Wed Dec 21 16:41:52 EST 2005


In article <1135122072.317411.62530 at z14g2000cwz.googlegroups.com>,
 "sjdevnull at yahoo.com" <sjdevnull at yahoo.com> wrote:

> Tony Nelson wrote:
> > > 1. Python syntax checking: as I'm typing along, if I input a syntax
> > > error then the line is immediately highlighted in red.
> >
> > What do you use to do this?  Cream doesn't seem to do this oob.
> 
> Nope.  I'll try to package up my vimrc and get it uploaded somewhere
> next week (busy with holiday stuff).

OK, thanks.

> The meat of it is:
> 
> import vim
> def cur_x():
>     return vim.current.window.cursor[1]
> def cur_y():
>     return vim.current.window.cursor[0]
> def find_current_block():
>     block = [vim.current.line]
>     current = cur_y()-1
>     while len(block[0])==0 or block[0][0] in " \t#":
>         current = current - 1
>         if current < 0:
>             break
>         block = [vim.current.buffer[current] ]+ block
>     return block
> def check_current_block():
>     import code
>     vim.command("syn clear Error")
>     block = find_current_block()
>     length = len(block)
>     try:
>         code.compile_command("\n".join(block))
>         print ""
>         return 0
>     except:
>         (type, value, tb) = sys.exc_info()
>         line_no = cur_y()-1+value.lineno-length
>         badline = vim.current.buffer[line_no]
>         badline = badline.replace('"', '\\"')
>         print "Error at line %d: " %(line_no+1), badline
>         return 1

OK, I can tell that this is Python code, not VI script stuff.  I'll need 
to see how your vimrc sets this up.  It looks like learning to use VI 
(even with Cream) would take a few weeks of hard work.


> > > 2. Normal tag-jump stuff: Ctrl-click on a function/method call (or
> > > class or whatever) will jump to the function/method/class definition
> > > (Ctrl-T works as well if you don't like clicking).  It keeps a stack of
> > > visited files so you can drill down through your call stack and then
> > > pop back up to where you came from.
> >
> > Do you set up ctags for this?  I get error messages "E433: No tags file"
> > and "E426: tag not found: xxx" when I Ctrl-click on a method call.
> 
> Umm, either click the "build tags in current directory" button on the
> toolbar, or "find . -name '*.py' | ctags -L -" in the top directory of
> your python file.

OK.


> > > 3. Python class browsing stuff: A Class menu shows the parent and child
> > > classes of the one you're currently in, and all the methods of the
> > > current class; selecting any of the above jumps to the appropriate file
> > > and line.
> >
> > Is this the Tag List?
> 
> No, this is more complex, I'll post it w/ the rest of my stuff.
 ...

Thanks.
________________________________________________________________________
TonyN.:'                        *firstname*nlsnews at georgea*lastname*.com
      '                                  <http://www.georgeanelson.com/>



More information about the Python-list mailing list