I just found Sublime Text 2 and it’s awesome. The only thing I really miss is the ability to view the doc string of the function I’m dealing with. Are there any plugins that can do this?
for example:
def f(x):
'''a doc string for f'''
print x
f # << at this point, either automatically or with a keystroke,
# I would like to be able to somehow view "a doc string for f"
Edit: I’ve already attempted to using SublimeCodeIntel and SublimeRope, neither have such support.
Edit2: It should also work for other modules in the open project.
By tweaking SublimeCodeIntel, you can disable the “jump” to the file where the function is defined — this will allow you to see the function definition in the status bar upon alt-clicking.
To do this, select Preferences > Browse Packages and then open SublimeCodeIntel/SublimeCodeIntel.py.
Go to
class GotoPythonDefinition(sublime_plugin.TextCommand):and add areturnat line 890 so that the first lines of_triggerread:(you can also tweak the
msgstring formatting and remove thedefn.nameto save a bit of status bar space).It’s a bit disorienting to have to look down at the status bar to see the definition… also, the status bar won’t be able to display long definitions. However, it’s a start. Hopefully, tooltip/popup control will be made available through the API so that definitions can appear in the view next to alt-clicked functions.