Reputation: 1803
There is plenty of information about how to browse source code with vim/ctags, like jumping to a tag, navigating tag stack, searching for a tag match, etc.
However, I can't find information about how to actually inspect source code and its structure, similar to something like "source browser" tool in some IDEs.
The following is what I want to be able to do with Python source code using vim, though the same may be equally true for some other languages:
:tag ClassName.my_method
.Upvotes: 3
Views: 1838
Reputation: 3020
Have you looked at Rope?
http://rope.sourceforge.net/ropevim.html
Features
Rope refactorings:
- Rename anything!
- Extract method/local variable
- Move class/function/module/package/method
- Inline method/local variable/parameter
- Restructuring (like converting "${a}.f(${b})" to "${b}.g(${a})" where "a: type=mymod.A")
- Introduce factory
- Change method signature
- Transform module to package
- Encapsulate field
- Replace method with method object
- And a few others...
Rope can:
- Extract similar statements in extract refactorings
- Fix imports when needed
- Preview refactorings
- Undo/redo refactorings
- Interrupt refactorings
- Perform cross-project refactorings
- Handle basic implicit interfaces in rename and change signature
- Support Mercurial, GIT, Darcs and SVN in refactorings
Rope can also help IDE's with:
- Auto-completion
- Finding definition location
- Getting pydoc
- Finding occurrences
- Organizing imports (removing unused and duplicate imports and sorting them)
- Generating python elements
http://rope.sourceforge.net/index.html
Upvotes: 1