if I have two files
file a.py:
class A(): pass
file b.py:
from a import A b = A()
When I use ctags and press Ctrl+] in vim, it redirects me to import statement, not to class definition. In this code all is ok:
file a.py:
class A(): pass
file b.py:
from a import * b = A()
Ctags supports indexing of many modern programming languages. Python is a powerful scriptable dynamic language. Using Python to access Ctags index file is a natural fit in extending an application's capability to examine source code. This project wrote a wrapper for readtags.
Exuberant Ctags (e-ctags) maintained by Darren Hiebert, the ancestor of Universal Ctags, improved traditional ctags with multi-language support, the ability for the user to define new languages searched by regular expressions (called optlib in Universal Ctags), and the ability to generate emacs-style TAGS files.
Import order does not matter. If a module relies on other modules, it needs to import them itself. Python treats each . py file as a self-contained unit as far as what's visible in that file.
You can add the following line to your ~/.ctags file.
--python-kinds=-i
to have ctags skip indexing import statements. To see what else you can enable/disable:
ctags --list-kinds=python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With