Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beautify __future__ #93

Closed
jabbalaci opened this issue Jan 4, 2014 · 5 comments
Closed

beautify __future__ #93

jabbalaci opened this issue Jan 4, 2014 · 5 comments
Labels
enhancement New feature or request

Comments

@jabbalaci
Copy link

Hi,

Thanks for this great project, I use it via vim and it works very well for me.
I have a little suggestion concerning the __future__ statement. isort formats it like this:

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

I would like to see print_function in the next line:

from __future__ import (absolute_import, division,
                        print_function, unicode_literals)

It looks more balanced :) It's not a big thing, I know.

Best,

Laszlo

@timothycrosley
Copy link
Member

Hi Laszlo,

I'm glad you find the project useful! I think this it a great suggestion, and Ill try to add general support for balanced wrapping for the next release.

Thanks!

Timothy

@timothycrosley
Copy link
Member

This is now available in version 3.1.0 with the 'balanced_wrapping' option: https://github.com/timothycrosley/isort#intelligently-balanced-multi-line-imports

Thanks again!

Timothy

@jabbalaci
Copy link
Author

Thanks to you for the quick reaction :) How to make this behaviour the default in vim? I use vundle and I just added this line:

Bundle 'fisadev/vim-isort'

I just select the import lines and press <Ctrl+i>.

@timothycrosley
Copy link
Member

I think it should be as simple as putting the following into an .isort.cfg file in your home directory:

 [settings]
 balanced_wrapping = true

and updating to the latest isort:

 sudo pip install isort --upgrade

Let me know if you encounter any problems :)

@jabbalaci
Copy link
Author

Thanks for your help. It works now with vim and it does balancing too :) Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants