Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 1.03 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. No omnicompletion for python class members in vim?
  2. class A(object):
  3.  
  4.     def __init__(self):
  5.         self.x = "whatever"    # x will not seen in ctags/omnicompletion!!!
  6.        
  7. class A(object):
  8.  
  9.     x = None
  10.  
  11.     def __init__(self):
  12.         self.x = whatever
  13.        
  14. $ ctags --version
  15. Exuberant Ctags 5.9~svn20110310, Copyright (C) 1996-2009 Darren Hiebert
  16.   Compiled: Mar 18 2011, 10:38:14
  17.        
  18. !_TAG_FILE_FORMAT       2       /extended format; --format=1 will not append ;" to lines/
  19. !_TAG_FILE_SORTED       1       /0=unsorted, 1=sorted, 2=foldcase/
  20. !_TAG_PROGRAM_AUTHOR    Darren Hiebert  /dhiebert@users.sourceforge.net/
  21. !_TAG_PROGRAM_NAME      Exuberant Ctags //
  22. !_TAG_PROGRAM_URL       http://ctags.sourceforge.net    /official site/
  23. !_TAG_PROGRAM_VERSION   5.9~svn20110310 //
  24. A       aaa.py  /^class A(object):$/;"  c
  25. __init__        aaa.py  /^   def __init__(self, x):$/;" m       class:A
  26. x       aaa.py  /^   x = None$/;"       v       class:A
  27.        
  28. ctags -e aaa.py  # where aaa.py - file with code snippet above
  29.        
  30. M-. x   (enter)
  31. ~/TAGS   (enter)