Wednesday, April 21, 2010

Identifying your editors

Now that Django support is available, there are some niceties being added to make life more pleasant when dealing with files with the same name, which are very common when developing with Django (or any other application in the case of __init__.py).

There are 2 levels of support for those cases:

1. Really common files (__init__.py or in Django projects models.py, tests.py and views.py) have a special option in which the title of the editor is no longer the file name, but the name of the package containing that file, while a different icon is shown for those files (as the image below shows).





2. If there are 2 files that would be shown with the same name, PyDev will change the title of both to contain not only the name of the file, but also the name of the parent package.





Those options can be tweaked at the preferences (hope those are self-explanatory):





And with the icon available you already know it's Python right? -- So, there's an option to hide the file extensions from the tab title.

Those features are already available in the current nightly build (and will be available in the 1.5.7 release).

Hope you enjoy!

7 comments:

Anonymous said...

I upgrade to eclipse 3.6 M7 and pydev 1.5.6 , open a python project will stop responding

Fabio Zadrozny said...

Please report that as a bug, following the steps at: http://pydev.org/faq.html#how_do_i_report_a_bug (note that there's a session about how to get the stack traces, which need to be added to the bug to have a halting bug resolved).

Anonymous said...

I would have liked the option to have the normal icon but with "(appname) views.py", it would produce longer names for sure, but on my 24" and the fact I seldom have that many editors open at the same time this would have been great!.

Ciantic said...

have a special option in which the title of the editor is no longer the file name, but the name of the package containing that file

Greatest improvement in century! I have tried to push such a change for Eclipse for this specific reason for a long (though my idea was to show the upmost directory behind the file in tab).

Now if someone goes to improve the tabs even more (like different color for different projects). E.g. I have many projects open and all the files get mixed in the tab list because they are randomly ordered and in same color. Going through package/file explorer is very slow process.

Steven said...

Oh, this is great.

nick said...

This is a huge help! i always got lost when working with multiple django apps; no more!

B Coughlan said...

I just wanted to add that I upgraded my distribution (Ubuntu) which upgraded the interpreter, so my virtualenv was 2.7.3 while my system one was 2.7.4, which caused this problem with PyDev for me. If your /usr/lib/python2.7 version is different to your virtualenv version then you may have to recreate your virtualenv